Skip to content

Commit 67664cb

Browse files
tudupamssonicbld
authored andcommitted
[CRM]: Fix test_crm_nexthop testcase due to all interfaces in down state (sonic-net#11294)
What is the motivation for this PR? In the PR - sonic-net#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.
1 parent 0317c62 commit 67664cb

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

tests/crm/test_crm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ def test_crm_nexthop(duthosts, enum_rand_one_per_hwsku_frontend_hostname, enum_f
630630
nexthop_del_cmd = "config route del prefix 3001::0/64 nexthop {}".format(nexthop)
631631
asichost.sonichost.del_member_from_vlan(1000, 'Ethernet1')
632632
asichost.shell(ip_add_cmd)
633+
asichost.shell("config interface startup Ethernet1")
633634
else:
634635
nexthop_add_cmd = "{ip_cmd} neigh replace {nexthop} \
635636
lladdr 11:22:33:44:55:66 dev {iface}"\

0 commit comments

Comments
 (0)