diff --git a/tests/plugins_tests/certificate_info/test_certificate_info_plugin.py b/tests/plugins_tests/certificate_info/test_certificate_info_plugin.py index 20d6276b..78671a20 100644 --- a/tests/plugins_tests/certificate_info/test_certificate_info_plugin.py +++ b/tests/plugins_tests/certificate_info/test_certificate_info_plugin.py @@ -10,6 +10,8 @@ from tests.openssl_server import ModernOpenSslServer, ClientAuthConfigEnum import pytest +from tests.server_connectivity_tests.test_direct_connection import is_ipv6_available + class TestCertificateInfoPlugin: def test_ca_file_bad_file(self): @@ -190,9 +192,10 @@ def test_multiple_certificates(self): # And multiple certificates were detected assert len(plugin_result.certificate_deployments) > 1 + @pytest.mark.skipif(not is_ipv6_available(), reason="IPv6 not available") def test_ipv6_server_string(self): - # Given a server to scan for which SSLyze only received an IPv6 address # Test for https://github.com/nabla-c0d3/sslyze/issues/675 + # Given a server to scan for which SSLyze only received an IPv6 address server_location = ServerNetworkLocation("2a00:1450:4007:80d::200e", 443, ip_address="2a00:1450:4007:80d::200e") server_info = check_connectivity_to_server_and_return_info(server_location) diff --git a/tests/server_connectivity_tests/test_direct_connection.py b/tests/server_connectivity_tests/test_direct_connection.py index 185fab59..e5f86573 100644 --- a/tests/server_connectivity_tests/test_direct_connection.py +++ b/tests/server_connectivity_tests/test_direct_connection.py @@ -16,7 +16,7 @@ from tests.markers import can_only_run_on_linux_64 -def _is_ipv6_available() -> bool: +def is_ipv6_available() -> bool: has_ipv6 = False s = socket.socket(socket.AF_INET6) try: @@ -103,7 +103,7 @@ def test_tls_1_only(self): # And it detected that only TLS 1.0 is supported assert tls_probing_result.highest_tls_version_supported == TlsVersionEnum.TLS_1_0 - @pytest.mark.skipif(not _is_ipv6_available(), reason="IPv6 not available") + @pytest.mark.skipif(not is_ipv6_available(), reason="IPv6 not available") def test_ipv6(self): # Given a server accessible via IPv6 server_location = ServerNetworkLocation(