Skip to content

Commit ac9e078

Browse files
committed
test: Enable specifying flaky tests on fips
Adds a way to mark a specified test as 'flaky' on fips compliant systems. Earlier, the ``tools/test.py`` script supported only 'mode', 'system' and 'arch' for test environment specification. This limits the ability to specify the behavior of tests and setting pre-determined behavior of the same on other types of systems. As an example, the feature request below indicates the need to specify certain tests as 'flaky' on fips compliant systems. It hints at future possibility of a shared library, which in turn may need a specifier for running tests. This commit introduces a new item in the ``env`` dict, called ``type`` which defaults to ``default`` type. It also adds an optional command line argument ``--type``, which inputs strings. Current functionality extends to checking ``default`` or ``fips`` for this ``type`` variable. However, extending it to further uses is rather simple by adding "if" conditions at appropriate places in the ``tools/test.py`` script. Fixes: issue 14746
1 parent c3ae57f commit ac9e078

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,6 +1427,9 @@ def BuildOptions():
14271427
result.add_option('--abort-on-timeout',
14281428
help='Send SIGABRT instead of SIGTERM to kill processes that time out',
14291429
default=False, action="store_true", dest="abort_on_timeout")
1430+
result.add_option("--type",
1431+
help="Specifies the environment type the tests will run on, for example 'fips'",
1432+
default="default")
14301433
return result
14311434

14321435

@@ -1642,6 +1645,7 @@ def Main():
16421645
all_unused = [ ]
16431646
unclassified_tests = [ ]
16441647
globally_unused_rules = None
1648+
env_type = options.type
16451649
for path in paths:
16461650
for arch in options.arch:
16471651
for mode in options.mode:
@@ -1659,6 +1663,7 @@ def Main():
16591663
'mode': mode,
16601664
'system': utils.GuessOS(),
16611665
'arch': vmArch,
1666+
'type': env_type,
16621667
}
16631668
test_list = root.ListTests([], path, context, arch, mode)
16641669
unclassified_tests += test_list

0 commit comments

Comments
 (0)