diff --git a/tests/gold_tests/autest-site/conditions.test.ext b/tests/gold_tests/autest-site/conditions.test.ext index e182e699ab3..35aaa6abc3d 100644 --- a/tests/gold_tests/autest-site/conditions.test.ext +++ b/tests/gold_tests/autest-site/conditions.test.ext @@ -29,10 +29,36 @@ def HasOpenSSLVersion(self, version): openssl_str = json.loads(json_data)['openssl_str'] exe_ver = re.search(r'\d\.\d\.\d', openssl_str).group(0) if exe_ver == '': - raise ValueError("Error determining version of openssl library needed by traffic_server executable") + raise ValueError("Error determining version of OpenSSL library needed by traffic_server executable") return self.Condition( lambda: exe_ver >= version, - "openssl library version is " + exe_ver + ", must be at least " + version + "OpenSSL library version is " + exe_ver + ", must be at least " + version + ) + + +def IsBoringSSL(self): + output = subprocess.check_output( + os.path.join(self.Variables.BINDIR, "traffic_layout") + " info --versions --json", shell=True + ) + json_data = output.decode('utf-8') + openssl_str = json.loads(json_data)['openssl_str'] + return self.Condition( + # OpenSSL 1.1.1 (compatible; BoringSSL) + lambda: "compatible; BoringSSL" in openssl_str, + "SSL library is not BoringSSL" + ) + + +def IsOpenSSL(self): + output = subprocess.check_output( + os.path.join(self.Variables.BINDIR, "traffic_layout") + " info --versions --json", shell=True + ) + json_data = output.decode('utf-8') + openssl_str = json.loads(json_data)['openssl_str'] + return self.Condition( + # OpenSSL 1.1.1k 25 Mar 2021 + lambda: "OpenSSL" in openssl_str and "compatible; BoringSSL" not in openssl_str, + "SSL library is not OpenSSL" ) @@ -104,6 +130,8 @@ def PluginExists(self, pluginname): ExtendCondition(HasOpenSSLVersion) +ExtendCondition(IsBoringSSL) +ExtendCondition(IsOpenSSL) ExtendCondition(HasATSFeature) ExtendCondition(HasCurlVersion) ExtendCondition(HasCurlFeature) diff --git a/tests/gold_tests/tls/tls_0rtt_server.test.py b/tests/gold_tests/tls/tls_0rtt_server.test.py index c2987475261..2c69ec087f2 100644 --- a/tests/gold_tests/tls/tls_0rtt_server.test.py +++ b/tests/gold_tests/tls/tls_0rtt_server.test.py @@ -20,7 +20,10 @@ Test ATS TLSv1.3 0-RTT support ''' -Test.SkipUnless(Condition.HasOpenSSLVersion('1.1.1')) +Test.SkipUnless( + Condition.HasOpenSSLVersion('1.1.1'), + Condition.IsOpenSSL(), +) ts = Test.MakeATSProcess('ts', enable_tls=True) server = Test.MakeOriginServer('server') diff --git a/tests/gold_tests/tls/tls_ocsp.test.py b/tests/gold_tests/tls/tls_ocsp.test.py index 3dbeb227925..688a1fa0732 100644 --- a/tests/gold_tests/tls/tls_ocsp.test.py +++ b/tests/gold_tests/tls/tls_ocsp.test.py @@ -21,9 +21,9 @@ Test tls server prefetched OCSP responses ''' -# curl --cert-status option has been introduced in version 7.41.0 Test.SkipUnless( - Condition.HasCurlVersion("7.41.0") + Condition.HasCurlVersion("7.41.0"), # curl --cert-status option has been introduced in version 7.41.0 + Condition.IsOpenSSL(), # functionality tested in this test requires OpenSSL specifc APIs ) # Define default ATS diff --git a/tests/gold_tests/tls_hooks/tls_hooks14.test.py b/tests/gold_tests/tls_hooks/tls_hooks14.test.py index e6c9ca06670..cb5370e533a 100644 --- a/tests/gold_tests/tls_hooks/tls_hooks14.test.py +++ b/tests/gold_tests/tls_hooks/tls_hooks14.test.py @@ -23,6 +23,10 @@ Test different combinations of TLS handshake hooks to ensure they are applied consistently. ''' +Test.SkipUnless( + Condition.IsOpenSSL() +) + ts = Test.MakeATSProcess("ts", select_ports=True, enable_tls=True) server = Test.MakeOriginServer("server", ssl=True) request_header = {"headers": "GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n", "timestamp": "1469733493.993", "body": ""} diff --git a/tests/gold_tests/tls_hooks/tls_hooks16.test.py b/tests/gold_tests/tls_hooks/tls_hooks16.test.py index c44e6c56f2f..9e3029ea99a 100644 --- a/tests/gold_tests/tls_hooks/tls_hooks16.test.py +++ b/tests/gold_tests/tls_hooks/tls_hooks16.test.py @@ -25,7 +25,9 @@ ''' Test.SkipUnless( - Condition.HasOpenSSLVersion("1.1.1")) + Condition.HasOpenSSLVersion("1.1.1"), + Condition.IsOpenSSL() +) ts = Test.MakeATSProcess("ts", select_ports=True, enable_tls=True) server = Test.MakeOriginServer("server") diff --git a/tests/gold_tests/tls_hooks/tls_hooks17.test.py b/tests/gold_tests/tls_hooks/tls_hooks17.test.py index ae625867070..e368168f645 100644 --- a/tests/gold_tests/tls_hooks/tls_hooks17.test.py +++ b/tests/gold_tests/tls_hooks/tls_hooks17.test.py @@ -25,7 +25,9 @@ ''' Test.SkipUnless( - Condition.HasOpenSSLVersion("1.1.1")) + Condition.HasOpenSSLVersion("1.1.1"), + Condition.IsOpenSSL() +) ts = Test.MakeATSProcess("ts", select_ports=True, enable_tls=True) server = Test.MakeOriginServer("server") diff --git a/tests/gold_tests/tls_hooks/tls_hooks18.test.py b/tests/gold_tests/tls_hooks/tls_hooks18.test.py index 6752bd6abab..5b49a3ce27f 100644 --- a/tests/gold_tests/tls_hooks/tls_hooks18.test.py +++ b/tests/gold_tests/tls_hooks/tls_hooks18.test.py @@ -25,7 +25,8 @@ ''' Test.SkipUnless( - Condition.HasOpenSSLVersion("1.1.1") + Condition.HasOpenSSLVersion("1.1.1"), + Condition.IsOpenSSL() ) ts = Test.MakeATSProcess("ts", select_ports=True, enable_tls=True)