Skip to content
Closed
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
24 changes: 20 additions & 4 deletions ansible/roles/test/files/ptftests/py3/mtu_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,23 @@ def runTest(self):
"""

self.pktlen = self.testbed_mtu
self.check_icmp_mtu()
self.check_icmp_mtu(ipv4=False)
self.check_ip_mtu()
self.check_ip_mtu(ipv4=False)
ipv4_available = (
self.src_host_ip is not None
and self.src_router_ip is not None
and self.dst_host_ip is not None
)
ipv6_available = (
self.src_host_ipv6 is not None
and self.src_router_ipv6 is not None
and self.dst_host_ipv6 is not None
)
if not ipv4_available and not ipv6_available:
raise Exception("Neither IPv4 nor IPv6 addresses are available for MTU testing")
if ipv4_available:
logging.info("Running IPv4 MTU tests")
self.check_icmp_mtu()
self.check_ip_mtu()
if ipv6_available:
logging.info("Running IPv6 MTU tests")
self.check_icmp_mtu(ipv4=False)
self.check_ip_mtu(ipv4=False)
16 changes: 8 additions & 8 deletions tests/ipfwd/test_mtu.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ def test_mtu(tbinfo, ptfhost, mtu, gather_facts):
params={"testbed_type": testbed_type,
"router_mac": gather_facts['src_router_mac'],
"testbed_mtu": mtu,
"src_host_ip": gather_facts['src_host_ipv4'],
"src_router_ip": gather_facts['src_router_ipv4'],
"dst_host_ip": gather_facts['dst_host_ipv4'],
"src_host_ipv6": gather_facts['src_host_ipv6'],
"src_router_ipv6": gather_facts['src_router_ipv6'],
"dst_host_ipv6": gather_facts['dst_host_ipv6'],
"src_ptf_port_list": gather_facts['src_port_ids'],
"dst_ptf_port_list": gather_facts['dst_port_ids'],
"src_host_ip": gather_facts.get('src_host_ipv4'),
"src_router_ip": gather_facts.get('src_router_ipv4'),
"dst_host_ip": gather_facts.get('dst_host_ipv4'),
"src_host_ipv6": gather_facts.get('src_host_ipv6'),
"src_router_ipv6": gather_facts.get('src_router_ipv6'),
"dst_host_ipv6": gather_facts.get('dst_host_ipv6'),
"src_ptf_port_list": gather_facts.get('src_port_ids'),
"dst_ptf_port_list": gather_facts.get('dst_port_ids'),
"kvm_support": True
},
log_file=log_file,
Expand Down
Loading