From b86eb8e619a2520f1ff8e82376ef08c954430a6f Mon Sep 17 00:00:00 2001 From: dosas Date: Mon, 8 Apr 2024 09:13:21 +0200 Subject: [PATCH] Make oscap profile configurable in settings file (#14535) to enable tests for OS other than rhel (cherry picked from commit ca8ab783ccb7e10240515830a3b344f3a7c6c0f6) --- conf/oscap.yaml.template | 2 ++ pytest_fixtures/component/oscap.py | 2 +- robottelo/config/validators.py | 7 ++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/conf/oscap.yaml.template b/conf/oscap.yaml.template index bfeec7103fb..f23ec46ffb9 100644 --- a/conf/oscap.yaml.template +++ b/conf/oscap.yaml.template @@ -1,2 +1,4 @@ OSCAP: CONTENT_PATH: /usr/share/xml/scap/ssg/content/ssg-rhel7-ds.xml + # see: robottelo/constants/__init__.py OSCAP_PROFILE + PROFILE: security7 diff --git a/pytest_fixtures/component/oscap.py b/pytest_fixtures/component/oscap.py index e8a7d230603..786788914f2 100644 --- a/pytest_fixtures/component/oscap.py +++ b/pytest_fixtures/component/oscap.py @@ -39,7 +39,7 @@ def scap_content(import_ansible_roles, module_target_sat): scap_profile_id = [ profile['id'] for profile in scap_info.scap_content_profiles - if OSCAP_PROFILE['security7'] in profile['title'] + if OSCAP_PROFILE[settings.oscap.profile] in profile['title'] ][0] return { "title": title, diff --git a/robottelo/config/validators.py b/robottelo/config/validators.py index f598821839d..013be110fe0 100644 --- a/robottelo/config/validators.py +++ b/robottelo/config/validators.py @@ -225,7 +225,12 @@ Validator( 'oscap.content_path', must_exist=True, - ) + ), + Validator( + 'oscap.profile', + default='security7', + must_exist=True, + ), ], osp=[ Validator(