From 4b348782087a82b1378d132e04fe984aeed04618 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Thu, 15 Nov 2018 05:37:55 +0100 Subject: [PATCH 1/7] test: skip test that use --tls-v1.x flags Currently, configuring --without-ssl will cause the following test to fail: === release test-https-agent-additional-options === Path: parallel/test-https-agent-additional-options out/Release/node: bad option: --tls-v1.1 Command: out/Release/node --tls-v1.1 /node/test/parallel/test-https-agent-additional-options.js === release test-https-agent-session-eviction === Path: parallel/test-https-agent-session-eviction out/Release/node: bad option: --tls-v1.0 Command: out/Release/node --tls-v1.0 /node/test/parallel/test-https-agent-session-eviction.js This commit adds a check for the --tls-v.x flags and skips them if node was built without crypto support. --- test/testpy/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/testpy/__init__.py b/test/testpy/__init__.py index 27d7124bf2ed16..25a64fdb1969ac 100644 --- a/test/testpy/__init__.py +++ b/test/testpy/__init__.py @@ -73,7 +73,9 @@ def GetCommand(self): # failure so such tests are also skipped. if ('--inspect' in flag[0] or \ '--use-bundled-ca' in flag[0] or \ - '--use-openssl-ca' in flag[0]) and \ + '--use-openssl-ca' in flag[0] or \ + '--tls-v1.0' in flag[0] or \ + '--tls-v1.1' in flag[0]) and \ self.context.v8_enable_inspector == 0: print('Skipping as node was configured --without-ssl') else: From 799805907d00e10ee01ce5f7c6dfc88efbc568f5 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Thu, 15 Nov 2018 12:05:15 +0100 Subject: [PATCH 2/7] squash: check more than the first flag option --- test/testpy/__init__.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/testpy/__init__.py b/test/testpy/__init__.py index 25a64fdb1969ac..0222d94b2dab4f 100644 --- a/test/testpy/__init__.py +++ b/test/testpy/__init__.py @@ -61,7 +61,7 @@ def GetCommand(self): source = open(self.file).read() flags_match = FLAGS_PATTERN.search(source) if flags_match: - flag = flags_match.group(1).strip().split() + flags = flags_match.group(1).strip().split() # The following block reads config.gypi to extract the v8_enable_inspector # value. This is done to check if the inspector is disabled in which case # the '--inspect' flag cannot be passed to the node process as it will @@ -71,15 +71,15 @@ def GetCommand(self): # inspector related tests). Also, if there is no ssl support the options # '--use-bundled-ca' and '--use-openssl-ca' will also cause a similar # failure so such tests are also skipped. - if ('--inspect' in flag[0] or \ - '--use-bundled-ca' in flag[0] or \ - '--use-openssl-ca' in flag[0] or \ - '--tls-v1.0' in flag[0] or \ - '--tls-v1.1' in flag[0]) and \ - self.context.v8_enable_inspector == 0: + if ((any(flag.startswith('--inspect') for flag in flags) or + '--use-bundled-ca' in flags or + '--use-openssl-ca' in flags or + '--tls-v1.0' in flags or + '--tls-v1.1' in flags) and + self.context.v8_enable_inspector == 0): print('Skipping as node was configured --without-ssl') else: - result += flag + result += flags files_match = FILES_PATTERN.search(source); additional_files = [] if files_match: From ed7c5202987fd0b304e36ea2decc030ad7055bd4 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Thu, 15 Nov 2018 13:40:09 +0100 Subject: [PATCH 3/7] tools: add node_has_crypto Context class Currently, there is a check for crypto related flags used in tests, for example // Flags: --use-bundled-ca at the top of a test. The current implementation only checks if if the inspector is enabled or not and if not skips tests that use certain crypto flags. The has worked because when disabling the inspector also disables crypto (like configuring --without-ssl). But when configured --without-intl the inspector is disabled but not crypto causing failures. From configure.py: "Disable Intl, same as --with-intl=none (disables inspector)" The commit adds a node_has_crypto property to the Context class which is checked for crypto specific flags. --- test/testpy/__init__.py | 8 +++++--- tools/test.py | 6 ++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/test/testpy/__init__.py b/test/testpy/__init__.py index 0222d94b2dab4f..87c6f67fe3e573 100644 --- a/test/testpy/__init__.py +++ b/test/testpy/__init__.py @@ -71,12 +71,14 @@ def GetCommand(self): # inspector related tests). Also, if there is no ssl support the options # '--use-bundled-ca' and '--use-openssl-ca' will also cause a similar # failure so such tests are also skipped. - if ((any(flag.startswith('--inspect') for flag in flags) or - '--use-bundled-ca' in flags or + if (any(flag.startswith('--inspect') for flag in flags) and + not self.context.v8_enable_inspector): + print('Skipping as node was configured --without-inspector') + elif (('--use-bundled-ca' in flags or '--use-openssl-ca' in flags or '--tls-v1.0' in flags or '--tls-v1.1' in flags) and - self.context.v8_enable_inspector == 0): + not self.context.node_has_crypto): print('Skipping as node was configured --without-ssl') else: result += flags diff --git a/tools/test.py b/tools/test.py index 3a464be61da1b3..8f06e1358be1de 100755 --- a/tools/test.py +++ b/tools/test.py @@ -907,6 +907,7 @@ def __init__(self, workspace, buildspace, verbose, vm, args, expect_fail, self.repeat = repeat self.abort_on_timeout = abort_on_timeout self.v8_enable_inspector = True + self.node_has_crypto = True def GetVm(self, arch, mode): if arch == 'none': @@ -1636,6 +1637,11 @@ def Main(): if has_inspector.stdout.rstrip() == "0": context.v8_enable_inspector = False + has_crypto = Execute([vm, + "-p", "process.versions.openssl"], context) + if has_crypto.stdout.rstrip() == "undefined": + context.node_has_crypto = False + if options.cat: visited = set() for test in unclassified_tests: From 577558761187ce07efb9e7b43176e1b8bfbc28f7 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Thu, 15 Nov 2018 15:07:50 +0100 Subject: [PATCH 4/7] squash: update message when no inspector support --- test/testpy/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testpy/__init__.py b/test/testpy/__init__.py index 87c6f67fe3e573..e71d794d88532e 100644 --- a/test/testpy/__init__.py +++ b/test/testpy/__init__.py @@ -73,7 +73,7 @@ def GetCommand(self): # failure so such tests are also skipped. if (any(flag.startswith('--inspect') for flag in flags) and not self.context.v8_enable_inspector): - print('Skipping as node was configured --without-inspector') + print('Skipping as node was configured without inspector support') elif (('--use-bundled-ca' in flags or '--use-openssl-ca' in flags or '--tls-v1.0' in flags or From 971189c3606978405e0792439af9853619d0ab14 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Thu, 15 Nov 2018 15:25:59 +0100 Subject: [PATCH 5/7] squash: update skip messages --- test/testpy/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testpy/__init__.py b/test/testpy/__init__.py index e71d794d88532e..a590cccf296697 100644 --- a/test/testpy/__init__.py +++ b/test/testpy/__init__.py @@ -73,13 +73,13 @@ def GetCommand(self): # failure so such tests are also skipped. if (any(flag.startswith('--inspect') for flag in flags) and not self.context.v8_enable_inspector): - print('Skipping as node was configured without inspector support') + print('Skipping as node was compiled witout inspector support') elif (('--use-bundled-ca' in flags or '--use-openssl-ca' in flags or '--tls-v1.0' in flags or '--tls-v1.1' in flags) and not self.context.node_has_crypto): - print('Skipping as node was configured --without-ssl') + print('Skipping as node was compiled without crypto support') else: result += flags files_match = FILES_PATTERN.search(source); From 1cf14625338475b3f227bfab78dac5a76a7bcabd Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Thu, 15 Nov 2018 15:27:27 +0100 Subject: [PATCH 6/7] squash: fix typo in inspector message --- test/testpy/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testpy/__init__.py b/test/testpy/__init__.py index a590cccf296697..7ba9674d7d6e57 100644 --- a/test/testpy/__init__.py +++ b/test/testpy/__init__.py @@ -73,7 +73,7 @@ def GetCommand(self): # failure so such tests are also skipped. if (any(flag.startswith('--inspect') for flag in flags) and not self.context.v8_enable_inspector): - print('Skipping as node was compiled witout inspector support') + print('Skipping as node was compiled without inspector support') elif (('--use-bundled-ca' in flags or '--use-openssl-ca' in flags or '--tls-v1.0' in flags or From 57d17c30a084d3bc611e41bf7798fdaa36ceea6a Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Sun, 18 Nov 2018 09:49:50 +0100 Subject: [PATCH 7/7] squash: fix indentation and use single quotes --- tools/test.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/test.py b/tools/test.py index 8f06e1358be1de..67b8cb917e0db6 100755 --- a/tools/test.py +++ b/tools/test.py @@ -1633,14 +1633,14 @@ def Main(): # We want to skip the inspector tests if node was built without the inspector. has_inspector = Execute([vm, - "-p", "process.config.variables.v8_enable_inspector"], context) - if has_inspector.stdout.rstrip() == "0": - context.v8_enable_inspector = False + '-p', 'process.config.variables.v8_enable_inspector'], context) + if has_inspector.stdout.rstrip() == '0': + context.v8_enable_inspector = False has_crypto = Execute([vm, - "-p", "process.versions.openssl"], context) - if has_crypto.stdout.rstrip() == "undefined": - context.node_has_crypto = False + '-p', 'process.versions.openssl'], context) + if has_crypto.stdout.rstrip() == 'undefined': + context.node_has_crypto = False if options.cat: visited = set()