Skip to content

Commit 0bacba4

Browse files
weiguo-nvidiaselldinesh
authored andcommitted
Fix test_static_route issue import by PR 20793 (#20987)
Change-Id: I184870ec6b88ff8e0c264f0a962631b6b30bd695 Signed-off-by: selldinesh <[email protected]>
1 parent 3753390 commit 0bacba4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/route/test_static_route.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
from tests.common.helpers.dut_ports import get_vlan_interface_list, get_vlan_interface_info
2929

3030

31+
# packet count for traffic test
32+
COUNT = 10
33+
3134
pytestmark = [
3235
pytest.mark.topology('t0', 'm0', 'mx'),
3336
pytest.mark.device_type('vs')
@@ -122,7 +125,7 @@ def generate_and_verify_traffic(duthost, ptfadapter, tbinfo, ip_dst, expected_po
122125
upstream_name = UPSTREAM_NEIGHBOR_MAP[topo_type]
123126
ptf_upstream_intf = random.choice(get_neighbor_ptf_port_list(duthost, upstream_name, tbinfo))
124127
ptfadapter.dataplane.flush()
125-
testutils.send(ptfadapter, ptf_upstream_intf, pkt, count=10)
128+
testutils.send(ptfadapter, ptf_upstream_intf, pkt, count=COUNT)
126129
testutils.verify_packet_any_port(ptfadapter, exp_pkt, ports=expected_ports)
127130

128131

@@ -256,7 +259,7 @@ def run_static_route_test(duthost, unselected_duthost, ptfadapter, ptfhost, tbin
256259
duthost.shell("dualtor_neighbor_check.py")
257260

258261
with RouteFlowCounterTestContext(is_route_flow_counter_supported,
259-
duthost, [prefix], {prefix: {'packets': '1'}}):
262+
duthost, [prefix], {prefix: {'packets': COUNT}}):
260263
generate_and_verify_traffic(duthost, ptfadapter, tbinfo, ip_dst, nexthop_devs, ipv6=ipv6)
261264

262265
# Check the route is advertised to the neighbors
@@ -285,7 +288,7 @@ def run_static_route_test(duthost, unselected_duthost, ptfadapter, ptfhost, tbin
285288
for nexthop_addr in nexthop_addrs:
286289
duthost.shell("timeout 1 ping -c 1 -w 1 {}".format(nexthop_addr), module_ignore_errors=True)
287290
with RouteFlowCounterTestContext(is_route_flow_counter_supported, duthost,
288-
[prefix], {prefix: {'packets': '1'}}):
291+
[prefix], {prefix: {'packets': COUNT}}):
289292
generate_and_verify_traffic(duthost, ptfadapter, tbinfo, ip_dst, nexthop_devs, ipv6=ipv6)
290293
check_route_redistribution(duthost, prefix, ipv6)
291294

0 commit comments

Comments
 (0)