summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRefael Ackermann <refack@gmail.com>2017-11-28 19:35:58 -0500
committerRefael Ackermann <refack@gmail.com>2017-11-29 20:33:38 -0500
commitfff3792e7187eb2bebf8ee1bada93d2fb29802c3 (patch)
treef1231e10258817ef1010a829a114f823a091b640 /tools
parent58adb3cedf11800566b62c357fbef78ff8af2b72 (diff)
downloadnode-new-fff3792e7187eb2bebf8ee1bada93d2fb29802c3.tar.gz
tools,test: use Execute instead of check_output
subprocess.check_output is a python2.7 only feature. Using Execute allows keeping python2.6 compatibility PR-URL: https://github.com/nodejs/node/pull/17381 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/test.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/tools/test.py b/tools/test.py
index efb7c0e5b8..ccc25f2a88 100755
--- a/tools/test.py
+++ b/tools/test.py
@@ -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
@@ -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