mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-30 19:34:45 +00:00
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.
This commit is contained in:
@@ -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():
|
|||||||
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 = [
|
||||||
res[module] = set(all_tests[module])
|
x.strip()
|
||||||
for test in config.get(f"ipa_{state}_tests", []):
|
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():
|
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())
|
||||||
|
|||||||
Reference in New Issue
Block a user