From 77408d86f40b77d4d0144b82e464f6c3bf2efbba Mon Sep 17 00:00:00 2001 From: stalarir Date: Wed, 20 Nov 2024 16:27:51 -0800 Subject: [PATCH] fix to use asichost mac when dut is multi-asic system --- tests/route/test_route_flap.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/route/test_route_flap.py b/tests/route/test_route_flap.py index b809ecf845c..cb21c878c3d 100644 --- a/tests/route/test_route_flap.py +++ b/tests/route/test_route_flap.py @@ -401,6 +401,11 @@ def test_route_flap(duthosts, tbinfo, ptfhost, ptfadapter, # On dual-tor, vlan mac is different with dut_mac. U0/L0 use same vlan mac for AR response # On single tor, vlan mac (if exists) is same as dut_mac dut_mac = duthost.facts['router_mac'] + # Each Asic has different MAC in multi-asic system. Traffic should be sent with asichost DMAC + # in multi-asic scenarios + if duthost.is_multi_asic: + dut_mac = asichost.get_router_mac().lower() + vlan_mac = "" if is_dualtor(tbinfo): # Just let it crash if missing vlan configs on dual-tor @@ -469,6 +474,14 @@ def switch(x): 't1': 100, }.get(x, 10) divisor = switch(tbinfo["topo"]["name"]) + route_index = route_nums/divisor + + # Traffic tests are not run if number of routes learnt are less than + # 1000 in t2 role, less than 100 in t1 role. log message in that scenario + if route_index < 1: + logger.info(" No of routes {} in topo {} is less, skipping \ + test ".format(route_nums, tbinfo["topo"]["name"])) + while loop_times > 0: logger.info("Round %s" % loop_times) route_index = 1