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
13 changes: 11 additions & 2 deletions ansible/roles/test/files/ptftests/py3/generic_hash_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,17 @@ def check_ip_route(self, pkt, masked_expected_pkt, sending_port):
send the packet and check it is received by one of the expected ports
"""
testutils.send_packet(self, sending_port, pkt)
port_index, received = testutils.verify_packet_any_port(
self, masked_expected_pkt, self.expected_port_list, timeout=0.1)
try:
port_index, received = testutils.verify_packet_any_port(
self, masked_expected_pkt, self.expected_port_list, timeout=0.1)
except AssertionError:
logging.error("Traffic wasn't sent successfully, trying again")
logging.info(f"Expected packet: {masked_expected_pkt}")
for _ in range(5):
testutils.send_packet(self, sending_port, pkt, count=1)
time.sleep(0.1)
port_index, received = testutils.verify_packet_any_port(
self, masked_expected_pkt, self.expected_port_list, timeout=1)
# The port_index is the index of expected_port_list, need to convert it to the ptf port index
return self.expected_port_list[port_index], received

Expand Down
2 changes: 1 addition & 1 deletion tests/hash/generic_hash_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
l2_ports = set()
vlans_to_remove = []
interfaces_to_startup = []
balancing_test_times = 240
balancing_test_times = 480
balancing_range = 0.25
vxlan_ecmp_utils = VxLAN_Ecmp_Utils()
vxlan_port_list = [13330, 4789]
Expand Down