From 44b70a24c68f1e1830b6349ad9d28bf5e21c4b3a Mon Sep 17 00:00:00 2001 From: TANMAYA UDUPA <143127557+tudupa@users.noreply.github.com> Date: Fri, 19 Jan 2024 01:15:16 -0500 Subject: [PATCH] [CRM]: Fix test_crm_nexthop testcase due to all interfaces in down state (#11294) What is the motivation for this PR? In the PR - #8051: There was a new fixture added to shut down all interfaces before the testcase (test_crm_nexthop) starts. This however does not work well for test_crm_nexthop testcase. This testcase adds a static route via one of the ptf interfaces(ethernet1). The interface which is directly connected to the PTF's interface needs to be up in order for the added static route to be effective. Only if it is up, the crm resources will be utilized and the used and available counter for ipv4_nexthop will be incremented and decremented respectively. Since all interfaces are shut down, the static route added by this testcase wont be effective and hence will not use any crm resources. How did you do it? The fix here is to bring up the interface used in the testcase so that the static route added will be in effect and the crm resource will be utilized. Since the interface in test is "Ethernet1", code is added to bring this interface up and then continue the testcase. How did you verify/test it? Ran test_crm_nexthop to see if the testcase passes both ipv4 and ipv6 cases. --- tests/crm/test_crm.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/crm/test_crm.py b/tests/crm/test_crm.py index 18ad7e5a4ef..6bb275d12c5 100755 --- a/tests/crm/test_crm.py +++ b/tests/crm/test_crm.py @@ -624,6 +624,7 @@ def test_crm_nexthop(duthosts, enum_rand_one_per_hwsku_frontend_hostname, nexthop_del_cmd = "config route del prefix 3001::0/64 nexthop {}".format(nexthop) asichost.sonichost.del_member_from_vlan(1000, 'Ethernet1') asichost.shell(ip_add_cmd) + asichost.shell("config interface startup Ethernet1") else: nexthop_add_cmd = "{ip_cmd} neigh replace {nexthop} \ lladdr 11:22:33:44:55:66 dev {iface}"\