Skip to content
Snippets Groups Projects
Commit c6cc4df7 authored by Rafael Guterres Jeffman's avatar Rafael Guterres Jeffman
Browse files

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.
parent b3ee4f9b
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,7 @@ REPO_ROOT = os.path.join(os.path.dirname(__file__), "..") ...@@ -15,6 +15,7 @@ REPO_ROOT = os.path.join(os.path.dirname(__file__), "..")
def get_tests(): def get_tests():
"""Retrieve a list of modules and its tests.""" """Retrieve a list of modules and its tests."""
def get_module(root): def get_module(root):
if root != _test_dir: if root != _test_dir:
while True: while True:
...@@ -95,9 +96,26 @@ def main(): ...@@ -95,9 +96,26 @@ def main():
disabled = {} disabled = {}
enabled = {} enabled = {}
for res, state in [(disabled, "disabled"), (enabled, "enabled")]: for res, state in [(disabled, "disabled"), (enabled, "enabled")]:
for module in config.get(f"ipa_{state}_modules", []): 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]) 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}_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(): for module, tests in all_tests.items():
if test in tests: if test in tests:
mod = res.setdefault(module, set()) mod = res.setdefault(module, set())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment