Skip to content

Commit d67ec59

Browse files
authored
multiasic support test_disk_exhaustion, Issue# 12419 (sonic-net#12450)
disk/test_disk_exhaustion.py part of test tries to send traffic to validate the data plane during disk exhaustion test. The current code uses dut_host router-mac as destination. For mutli-asic hardware needs to use asic specific router-mac (in case if each asic has it's own router-mac) to validate the test.
1 parent 5cea1ef commit d67ec59

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/disk/test_disk_exhaustion.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,15 @@ def construct_packet_and_get_params(duthost, ptfadapter, tbinfo):
9191
# use first port of first peer_ip_ifaces pair as input port
9292
# all ports in second peer_ip_ifaces pair will be output/forward port
9393
ptf_port_idx = mg_facts["minigraph_ptf_indices"][peer_ip_ifaces_pair[0][1][0].split(".")[0]]
94+
95+
# get router mac per asic for multi-asic dut
96+
if duthost.is_multi_asic:
97+
namespace = mg_facts['minigraph_neighbors'][peer_ip_ifaces_pair[0][1][0]]['namespace']
98+
asic_idx = duthost.get_asic_id_from_namespace(namespace)
99+
router_mac = duthost.asic_instance(asic_idx).get_router_mac()
100+
else:
101+
router_mac = duthost.facts["router_mac"]
102+
94103
# Some platforms do not support rif counter
95104
try:
96105
rif_counter_out = parse_rif_counters(duthost.show_and_parse("show interfaces counters rif"))
@@ -101,7 +110,7 @@ def construct_packet_and_get_params(duthost, ptfadapter, tbinfo):
101110
rif_support = False
102111

103112
pkt = testutils.simple_ip_packet(
104-
eth_dst=duthost.facts["router_mac"],
113+
eth_dst=router_mac,
105114
eth_src=ptfadapter.dataplane.get_mac(0, ptf_port_idx),
106115
ip_src=peer_ip_ifaces_pair[0][0],
107116
ip_dst=peer_ip_ifaces_pair[1][0])

0 commit comments

Comments
 (0)