'show lldp table' fails when have LLDP neighbors on frontpanel ports and also have internal ports running LLDP as well. Examples of internal ports include the Inband port 'Ethernet-IB' on a T2 chassis, or 'Ethernet-BP' on a multi-asic pizza box.
This fails iface_namingmode::TestShowLldp::test_show_lldp_tables test case in sonic-mgmt tests.
Steps to reproduce the issue:
On a multi-asic pizza box or linecard of a T2 chassis which has inband port that runs LLDP, as well as have LLDP neighbors on its frontpanel ports, run the command 'show lldp table'.
Describe the results you received:
admin@board7:/usr/local/bin$ show lldp table
'<' not supported between instances of 'str' and 'int'
Capability codes: (R) Router, (B) Bridge, (O) Other
admin@board7:/usr/local/bin$
Looking further into the issue in /usr/local/bin/lldpshow, the issue is that in internal function 'alphanum_key' in function sort_sum. For frontpanel port, this return a list of 2 ['Ethernet', '5'], but for inband port it returns a list of 3 ['Ethernet', 'IB', '0']. This the comparison fails.
If we include a '-' in the regexp ([-A-Za-z]+), then things work fine.
With multi-asic, they ignore interfaces that start with "Ethernet-BP", and thus the issue will not show in a multi-asic pizza box.
We will add similar exclusion for Inband port for T2 VOQ chassis.
Description
'show lldp table' fails when have LLDP neighbors on frontpanel ports and also have internal ports running LLDP as well. Examples of internal ports include the Inband port 'Ethernet-IB' on a T2 chassis, or 'Ethernet-BP' on a multi-asic pizza box.
This fails iface_namingmode::TestShowLldp::test_show_lldp_tables test case in sonic-mgmt tests.
Steps to reproduce the issue:
Describe the results you received:
Looking further into the issue in /usr/local/bin/lldpshow, the issue is that in internal function 'alphanum_key' in function sort_sum. For frontpanel port, this return a list of 2 ['Ethernet', '5'], but for inband port it returns a list of 3 ['Ethernet', 'IB', '0']. This the comparison fails.
If we include a '-' in the regexp ([-A-Za-z]+), then things work fine.
Describe the results you expected:
Output of
show version
:Additional information you deem important (e.g. issue happens only occasionally):