From 194600bbe8f7d413077cde9be090838202160a23 Mon Sep 17 00:00:00 2001 From: dosas Date: Wed, 27 Mar 2024 09:46:17 +0100 Subject: [PATCH] Make oscap profile configurable in settings file to enable tests for OS other than rhel --- 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(