Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Enable specifying flaky tests on fips #16329

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions tools/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1427,6 +1427,9 @@ def BuildOptions():
result.add_option('--abort-on-timeout',
help='Send SIGABRT instead of SIGTERM to kill processes that time out',
default=False, action="store_true", dest="abort_on_timeout")
result.add_option("--type",
help="Type of build (simple, fips)",
default=None)
return result


Expand Down Expand Up @@ -1576,6 +1579,21 @@ def ArgsToTestPaths(test_root, args, suites):
return paths


def get_env_type(vm, options_type):
if options_type is not None:
env_type = options_type
else:
if "fips" in subprocess.check_output([vm, "-p",
"process.versions.openssl"]):
env_type = "fips"
# NOTE(nikhil): "simple" is the default value for var 'env_type' and should
# be set last if no if/elif matches. If you plan to add more values, use
# 'elif' above.
else:
env_type = "simple"
return env_type


def Main():
parser = BuildOptions()
(options, args) = parser.parse_args()
Expand Down Expand Up @@ -1659,6 +1677,7 @@ def Main():
'mode': mode,
'system': utils.GuessOS(),
'arch': vmArch,
'type': get_env_type(vm, options.type),
}
test_list = root.ListTests([], path, context, arch, mode)
unclassified_tests += test_list
Expand Down