Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions show/bgp_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,10 @@ def show_routes(args, namespace, display, verbose, ipver):
else:
combined_route = route_info

if not combined_route:
return

if not found_json:
if len(combined_route) == 0:
return

#print out the header if this is not a json request
if not filter_by_ip:
print_show_ip_route_hdr()
Expand Down
59 changes: 59 additions & 0 deletions tests/route_check_test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1704,4 +1704,63 @@
},
RET: -1,
},
"33": {
DESCR: "Good test case, only IPv4 routes",
MULTI_ASIC: False,
NAMESPACE: [''],
ARGS: "route_check -m INFO -i 1000",
PRE: {
DEFAULTNS: {
APPL_DB: {
ROUTE_TABLE: {
"0.0.0.0/0": {"ifname": "portchannel0"},
"10.10.196.12/31": {"ifname": "portchannel0"},
"10.10.196.20/31": {"ifname": "portchannel0"},
"10.10.196.30/31": {"ifname": "lo"}
},
INTF_TABLE: {
"PortChannel1013:10.10.196.24/31": {},
"PortChannel1024": {}
}
},
ASIC_DB: {
RT_ENTRY_TABLE: {
ASIC_RT_ENTRY_KEY_PREFIX + "10.10.196.12/31" + ASIC_RT_ENTRY_KEY_SUFFIX: {},
ASIC_RT_ENTRY_KEY_PREFIX + "10.10.196.20/31" + ASIC_RT_ENTRY_KEY_SUFFIX: {},
ASIC_RT_ENTRY_KEY_PREFIX + "10.10.196.24/32" + ASIC_RT_ENTRY_KEY_SUFFIX: {},
ASIC_RT_ENTRY_KEY_PREFIX + "0.0.0.0/0" + ASIC_RT_ENTRY_KEY_SUFFIX: {}
}
}
}
}
},
"34": {
DESCR: "Good test case, only IPv6 routes",
MULTI_ASIC: False,
NAMESPACE: [''],
ARGS: "route_check -m INFO -i 1000",
PRE: {
DEFAULTNS: {
APPL_DB: {
ROUTE_TABLE: {
"::/0": {"ifname": "portchannel0"},
"2603:10b0:503:df4::6c/126": {"ifname": "portchannel0"},
"2603:10b0:503:df4::7c/126": {"ifname": "portchannel0"},
},
INTF_TABLE: {
"PortChannel1023:2603:10b0:503:df4::5d/126": {},
"PortChannel1024": {}
}
},
ASIC_DB: {
RT_ENTRY_TABLE: {
ASIC_RT_ENTRY_KEY_PREFIX + "2603:10b0:503:df4::5d/128" + ASIC_RT_ENTRY_KEY_SUFFIX: {},
ASIC_RT_ENTRY_KEY_PREFIX + "2603:10b0:503:df4::6c/126" + ASIC_RT_ENTRY_KEY_SUFFIX: {},
ASIC_RT_ENTRY_KEY_PREFIX + "2603:10b0:503:df4::7c/126" + ASIC_RT_ENTRY_KEY_SUFFIX: {},
ASIC_RT_ENTRY_KEY_PREFIX + "::/0" + ASIC_RT_ENTRY_KEY_SUFFIX: {}
}
}
}
}
},
}
Loading