Skip to content
Merged
Show file tree
Hide file tree
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
32 changes: 30 additions & 2 deletions tests/gold_tests/autest-site/conditions.test.ext
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)


Expand Down Expand Up @@ -104,6 +130,8 @@ def PluginExists(self, pluginname):


ExtendCondition(HasOpenSSLVersion)
ExtendCondition(IsBoringSSL)
ExtendCondition(IsOpenSSL)
ExtendCondition(HasATSFeature)
ExtendCondition(HasCurlVersion)
ExtendCondition(HasCurlFeature)
Expand Down
5 changes: 4 additions & 1 deletion tests/gold_tests/tls/tls_0rtt_server.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
4 changes: 2 additions & 2 deletions tests/gold_tests/tls/tls_ocsp.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions tests/gold_tests/tls_hooks/tls_hooks14.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": ""}
Expand Down
4 changes: 3 additions & 1 deletion tests/gold_tests/tls_hooks/tls_hooks16.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 3 additions & 1 deletion tests/gold_tests/tls_hooks/tls_hooks17.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 2 additions & 1 deletion tests/gold_tests/tls_hooks/tls_hooks18.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down