Skip to content

Commit

Permalink
added check for inband ports in ip route result parse (#4728)
Browse files Browse the repository at this point in the history
What is the motivation for this PR?
In T2 topology for a VOQ Chassis, if the linecard learns the default route from eBGP, an snmp entry is created in the ipCidrRouteTable
But if the linecard learns the default route through an in-band port (example a linecard connecting to only T1 VM's), there will not be any entry created in the snmp ipCidrRouteTable.

This is per SONiC design as defined in the following code in rfc4292.py

    if (ifn in port_table and
       multi_asic.PORT_ROLE in port_table[ifn] and
       port_table[ifn][multi_asic.PORT_ROLE] == multi_asic.INTERNAL_PORT):
          continue

Thus, the test case fails.

How did you do it?
Added a condition to check if the output from "show ip route " command has internal inband or backplane port in it, and if so don't add it to list of nexthops to check.

How did you verify/test it?
ran test_snmp_default_route on VOQ Chassis
  • Loading branch information
harish-kalyanaraman authored Dec 23, 2021
1 parent 0836020 commit e95452b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/snmp/test_snmp_default_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_snmp_default_route(duthosts, enum_rand_one_per_hwsku_frontend_hostname,
ip, interface = line.split('via')
ip = ip.strip("*, ")
interface = interface.strip("*, ")
if interface != "eth0":
if interface != "eth0" and 'Ethernet-IB' not in interface and 'Ethernet-BP' not in interface:
dut_result_nexthops.append(ip)

# If show ip route 0.0.0.0/0 has route only via eth0,
Expand Down

0 comments on commit e95452b

Please sign in to comment.