Skip to content

Commit 7ba87f6

Browse files
committed
tests, net, sanity: Add IPv6 family stack validation
Tests which are marked with the `ipv6` marker are expecting the cluster to support IPv6. If it does not support IPv6, the infra is considered incorrect and therefore no tests should execute. This change refactors the IPv4 sanity check and extends it to cover IPv6 as well. Follow up changes should convert usages of `fail_if_not_ipv6_supported_cluster` to a test marker. Signed-off-by: Edward Haas <[email protected]>
1 parent 0a827c2 commit 7ba87f6

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tests/network/conftest.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ def network_sanity(
224224
network_overhead,
225225
sriov_workers,
226226
ipv4_supported_cluster,
227+
ipv6_supported_cluster,
227228
conformance_tests,
228229
):
229230
"""
@@ -310,13 +311,13 @@ def _verify_sriov():
310311
f"has {len(sriov_workers)} SRIOV-capable worker nodes"
311312
)
312313

313-
def _verify_ipv4():
314-
if any(test.get_closest_marker("ipv4") for test in collected_tests):
314+
def _verify_ip_family(family, is_supported):
315+
if any(test.get_closest_marker(family) for test in collected_tests):
315316
LOGGER.info("Verifying if the cluster supports running IPV4 tests...")
316-
if not ipv4_supported_cluster:
317-
failure_msgs.append("IPv4 is not supported in this cluster")
317+
if not is_supported:
318+
failure_msgs.append(f"{family} is not supported in this cluster")
318319
else:
319-
LOGGER.info("Validated network lane is running against an IPV4 supported cluster")
320+
LOGGER.info(f"Validated network lane is running against an {family} supported cluster")
320321

321322
def _verify_bgp_env_vars():
322323
"""Verify if the cluster supports running BGP tests.
@@ -343,7 +344,8 @@ def _verify_bgp_env_vars():
343344
_verify_service_mesh()
344345
_verify_jumbo_frame()
345346
_verify_sriov()
346-
_verify_ipv4()
347+
_verify_ip_family(family="ipv4", is_supported=ipv4_supported_cluster)
348+
_verify_ip_family(family="ipv6", is_supported=ipv6_supported_cluster)
347349
_verify_bgp_env_vars()
348350

349351
if failure_msgs:

0 commit comments

Comments
 (0)