Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions tests/iface_namingmode/test_iface_namingmode.py
Original file line number Diff line number Diff line change
Expand Up @@ -944,13 +944,19 @@ def test_show_ipv6_interface(self, setup, setup_config_mode):
elif mode == 'default':
assert re.search(r'{}\s+{}'.format(item['attachto'], item['addr']), show_ipv6_interface) is not None

def test_show_ip_route_v4(self, setup_config_mode, spine_ports):
def test_show_ip_route_v4(self, setup_config_mode, spine_ports, tbinfo):
"""
Checks whether 'show ip route <ip>' lists the interface name as
per the configured naming mode
"""
dutHostGuest, mode, ifmode = setup_config_mode
route = dutHostGuest.shell('SONIC_CLI_IFACE_MODE={} show ip route 192.168.1.1'.format(ifmode))['stdout']
dip = '192.168.1.1'
# In T2 topo, 192.168.1.1 is forwarded via a route learnt over ibgp from other LC, which will fail the test
# because the vias in 'show ip route' output are Inband ports. Explicitly use '0.0.0.0' here to check the
# output of default route, whose vias should be local ports.
if tbinfo['topo']['type'].startswith('t2'):
dip = '0.0.0.0'
route = dutHostGuest.shell('SONIC_CLI_IFACE_MODE={} show ip route {}'.format(ifmode, dip))['stdout']
logger.info('route:\n{}'.format(route))

if mode == 'alias':
Expand Down