Skip to content

Commit dc83d56

Browse files
JibinBaosaravanan-nexthop
authored andcommitted
Stabilize test_dscp_to_queue_mapping (sonic-net#21340)
1. To mitigate the impact of noise packets, flush the PTF dataplane before sending and verifying packets 2. Increase the timeout in case ptf can not handle all packet in the buffer during 1 second, the ptf buffer has a lot of packets Signed-off-by: Saravanan <saravanan@nexthop.ai>
1 parent 978504d commit dc83d56

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

tests/qos/test_qos_dscp_mapping.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,14 @@ def send_and_verify_traffic(ptfadapter,
188188
"""
189189
pkt_egress_index = 0
190190
ptf_dst_port_list = []
191-
ptfadapter.dataplane.flush()
192191
logger.info("Send packet(s) from port {} from downstream to upstream".format(ptf_src_port_id))
193192

194193
try:
195194
for pkt, exp_pkt in zip(pkt_list, exp_pkt_list):
195+
ptfadapter.dataplane.flush()
196196
testutils.send(ptfadapter, ptf_src_port_id, pkt, count=DEFAULT_PKT_COUNT)
197197
logger.info(f"Send packet: {pkt}, expected packet: {exp_pkt}")
198-
result = testutils.verify_packet_any_port(ptfadapter, exp_pkt, ports=ptf_dst_port_ids, timeout=1)
198+
result = testutils.verify_packet_any_port(ptfadapter, exp_pkt, ports=ptf_dst_port_ids, timeout=5)
199199
if isinstance(result, bool):
200200
logger.info("Return a dummy value for VS platform")
201201
port_index = 0
@@ -493,7 +493,8 @@ def test_dscp_to_queue_mapping(self, ptfadapter, rand_selected_dut, localhost, d
493493
with allure.step("Run test"):
494494
self._run_test(ptfadapter, duthost, tbinfo, test_params, inner_dst_ip_list, dut_qos_maps_module, dscp_mode)
495495

496-
if completeness_level != "basic":
496+
if completeness_level != "basic" and \
497+
not duthost.dut_basic_facts()['ansible_facts']['dut_basic_facts'].get("is_smartswitch"):
497498
with allure.step("Do warm-reboot"):
498499
reboot(duthost, localhost, reboot_type="warm", safe_reboot=True, check_intf_up_ports=True,
499500
wait_warmboot_finalizer=True)

0 commit comments

Comments
 (0)