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

tools,test: use Execute instead of check_output #17381

Merged
merged 1 commit into from
Nov 30, 2017
Merged
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
17 changes: 7 additions & 10 deletions tools/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1562,18 +1562,15 @@ def ArgsToTestPaths(test_root, args, suites):
return paths


def get_env_type(vm, options_type):
def get_env_type(vm, options_type, context):
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"
# 'simple' is the default value for 'env_type'.
env_type = 'simple'
ssl_ver = Execute([vm, '-p', 'process.versions.openssl'], context).stdout
if 'fips' in ssl_ver:
env_type = 'fips'
return env_type


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