Skip to content

Commit 38913c9

Browse files
committed
Try to fix IPv6 test
1 parent 6e1e213 commit 38913c9

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

tests/plugins_tests/certificate_info/test_certificate_info_plugin.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
from tests.openssl_server import ModernOpenSslServer, ClientAuthConfigEnum
1111
import pytest
1212

13+
from tests.server_connectivity_tests.test_direct_connection import is_ipv6_available
14+
1315

1416
class TestCertificateInfoPlugin:
1517
def test_ca_file_bad_file(self):
@@ -190,9 +192,10 @@ def test_multiple_certificates(self):
190192
# And multiple certificates were detected
191193
assert len(plugin_result.certificate_deployments) > 1
192194

195+
@pytest.mark.skipif(not is_ipv6_available(), reason="IPv6 not available")
193196
def test_ipv6_server_string(self):
194-
# Given a server to scan for which SSLyze only received an IPv6 address
195197
# Test for https://github.com/nabla-c0d3/sslyze/issues/675
198+
# Given a server to scan for which SSLyze only received an IPv6 address
196199
server_location = ServerNetworkLocation("2a00:1450:4007:80d::200e", 443, ip_address="2a00:1450:4007:80d::200e")
197200
server_info = check_connectivity_to_server_and_return_info(server_location)
198201

tests/server_connectivity_tests/test_direct_connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from tests.markers import can_only_run_on_linux_64
1717

1818

19-
def _is_ipv6_available() -> bool:
19+
def is_ipv6_available() -> bool:
2020
has_ipv6 = False
2121
s = socket.socket(socket.AF_INET6)
2222
try:
@@ -103,7 +103,7 @@ def test_tls_1_only(self):
103103
# And it detected that only TLS 1.0 is supported
104104
assert tls_probing_result.highest_tls_version_supported == TlsVersionEnum.TLS_1_0
105105

106-
@pytest.mark.skipif(not _is_ipv6_available(), reason="IPv6 not available")
106+
@pytest.mark.skipif(not is_ipv6_available(), reason="IPv6 not available")
107107
def test_ipv6(self):
108108
# Given a server accessible via IPv6
109109
server_location = ServerNetworkLocation(

0 commit comments

Comments
 (0)