From c6cc4df77bebb8880ef9b665e594d603984282de Mon Sep 17 00:00:00 2001 From: Rafael Guterres Jeffman <rjeffman@redhat.com> Date: Thu, 25 Aug 2022 16:29:18 -0300 Subject: [PATCH] check_test_configuration: Add support for IPA_* environment variables This patch adds support for IPA_ENABLED_* and IPA_DISABLED_* environment variables as existing global configuration for the tests. --- utils/check_test_configuration.py | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/utils/check_test_configuration.py b/utils/check_test_configuration.py index 1500e1dc..162ad906 100755 --- a/utils/check_test_configuration.py +++ b/utils/check_test_configuration.py @@ -15,6 +15,7 @@ REPO_ROOT = os.path.join(os.path.dirname(__file__), "..") def get_tests(): """Retrieve a list of modules and its tests.""" + def get_module(root): if root != _test_dir: while True: @@ -95,9 +96,26 @@ def main(): disabled = {} enabled = {} for res, state in [(disabled, "disabled"), (enabled, "enabled")]: - for module in config.get(f"ipa_{state}_modules", []): - res[module] = set(all_tests[module]) - for test in config.get(f"ipa_{state}_tests", []): + items = [ + x.strip() + for x in + os.environ.get(f"ipa_{state}_modules".upper(), "").split(",") + if x.strip() + ] if scenario == "All" else [] + modules = config.get(f"ipa_{state}_modules", []) + items + for module in modules: + if module != "None": + res[module] = set(all_tests[module]) + items = [ + x.strip() + for x in + os.environ.get(f"ipa_{state}_tests".upper(), "").split(",") + if x.strip() + ] if scenario == "All" else [] + test_list = config.get(f"ipa_{state}_tests", []) + items + for test in test_list: + if test == "None": + continue for module, tests in all_tests.items(): if test in tests: mod = res.setdefault(module, set()) -- GitLab