Skip to content

Commit

Permalink
[show] Fix int status of LAGs, configured as Vlan members (#1478)
Browse files Browse the repository at this point in the history
Pass missed argument to function "appl_db_portchannel_status_get" in "intfutil" script to provide correct information in "Vlan" column of command "show int status" for LAG interfaces.

- What I did
Fixed status of LAG interfaces in Vlan column. LAG interfaces, configured as a Vlan member, should be seen as trunk interface.

- How I did it
Missed argument "self.combined_int_to_vlan_po_dict" passed to function "appl_db_portchannel_status_get"
in "intfutil" script.

- How to verify it
admin@sonic:~$ show int status | grep PortChannel0011

Signed-off-by: Maksym Belei <[email protected]>
  • Loading branch information
maksymbelei95 authored Mar 24, 2021
1 parent 553936b commit c7d4947
Show file tree
Hide file tree
Showing 6 changed files with 140 additions and 112 deletions.
2 changes: 1 addition & 1 deletion scripts/intfutil
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ class IntfStatus(object):
appl_db_portchannel_status_get(self.db, self.config_db, po, PORT_MTU_STATUS, self.portchannel_speed_dict),
appl_db_portchannel_status_get(self.db, self.config_db, po, PORT_FEC, self.portchannel_speed_dict),
appl_db_portchannel_status_get(self.db, self.config_db, po, PORT_ALIAS, self.portchannel_speed_dict),
appl_db_portchannel_status_get(self.db, self.config_db, po, "vlan", self.portchannel_speed_dict),
appl_db_portchannel_status_get(self.db, self.config_db, po, "vlan", self.portchannel_speed_dict, self.combined_int_to_vlan_po_dict),
appl_db_portchannel_status_get(self.db, self.config_db, po, PORT_OPER_STATUS, self.portchannel_speed_dict),
appl_db_portchannel_status_get(self.db, self.config_db, po, PORT_ADMIN_STATUS, self.portchannel_speed_dict),
appl_db_portchannel_status_get(self.db, self.config_db, po, PORT_OPTICS_TYPE, self.portchannel_speed_dict),
Expand Down
2 changes: 1 addition & 1 deletion tests/intfutil_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
PortChannel0002 N/A 40G 9100 N/A N/A routed up up N/A N/A
PortChannel0003 N/A 40G 9100 N/A N/A routed up up N/A N/A
PortChannel0004 N/A 40G 9100 N/A N/A routed up up N/A N/A
PortChannel1001 N/A 40G 9100 N/A N/A routed N/A N/A N/A N/A
PortChannel1001 N/A 40G 9100 N/A N/A trunk N/A N/A N/A N/A
"""

show_interface_status_Ethernet32_output="""\
Expand Down
6 changes: 6 additions & 0 deletions tests/mock_tables/asic0/config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,11 @@
"state": "enabled",
"auto_restart": "enabled",
"high_mem_alert": "disabled"
},
"VLAN|Vlan1000": {
"vlanid": "1000"
},
"VLAN_MEMBER|Vlan1000|PortChannel1002": {
"tagging_mode": "tagged"
}
}
6 changes: 6 additions & 0 deletions tests/mock_tables/config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,9 @@
"VLAN|Vlan3000": {
"vlanid": "3000"
},
"VLAN|Vlan4000": {
"vlanid": "4000"
},
"VLAN_INTERFACE|Vlan1000": {
"NULL": "NULL"
},
Expand Down Expand Up @@ -473,6 +476,9 @@
"VLAN_MEMBER|Vlan2000|Ethernet28": {
"tagging_mode": "untagged"
},
"VLAN_MEMBER|Vlan4000|PortChannel1001": {
"tagging_mode": "tagged"
},
"PORTCHANNEL|PortChannel1001": {
"admin_status": "up",
"members@": "Ethernet32",
Expand Down
8 changes: 4 additions & 4 deletions tests/multi_asic_intfutil_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
Ethernet-BP4 97,98,99,100 40G 9100 N/A Ethernet-BP4 PortChannel4001 up up N/A off
Ethernet-BP256 61,62,63,64 40G 9100 N/A Ethernet-BP256 PortChannel4009 up up N/A off
Ethernet-BP260 57,58,59,60 40G 9100 N/A Ethernet-BP260 PortChannel4009 up up N/A off
PortChannel1002 N/A 80G 9100 N/A N/A routed up up N/A N/A
PortChannel1002 N/A 80G 9100 N/A N/A trunk up up N/A N/A
PortChannel4001 N/A 80G 9100 N/A N/A routed up up N/A N/A
PortChannel4009 N/A 80G 9100 N/A N/A routed up up N/A N/A
"""
Expand All @@ -28,15 +28,15 @@
--------------- ----------- ------- ----- ----- ----------- --------------- ------ ------- --------------- ----------
Ethernet0 33,34,35,36 40G 9100 N/A Ethernet1/1 PortChannel1002 up up QSFP28 or later off
Ethernet4 29,30,31,32 40G 9100 N/A Ethernet1/2 PortChannel1002 up up N/A off
PortChannel1002 N/A 80G 9100 N/A N/A routed up up N/A N/A
PortChannel1002 N/A 80G 9100 N/A N/A trunk up up N/A N/A
"""

intf_status_asic0 = """\
Interface Lanes Speed MTU FEC Alias Vlan Oper Admin Type Asym PFC
--------------- ----------- ------- ----- ----- ----------- --------------- ------ ------- --------------- ----------
Ethernet0 33,34,35,36 40G 9100 N/A Ethernet1/1 PortChannel1002 up up QSFP28 or later off
Ethernet4 29,30,31,32 40G 9100 N/A Ethernet1/2 PortChannel1002 up up N/A off
PortChannel1002 N/A 80G 9100 N/A N/A routed up up N/A N/A
PortChannel1002 N/A 80G 9100 N/A N/A trunk up up N/A N/A
"""

intf_status_asic0_all = """\
Expand All @@ -46,7 +46,7 @@
Ethernet4 29,30,31,32 40G 9100 N/A Ethernet1/2 PortChannel1002 up up N/A off
Ethernet-BP0 93,94,95,96 40G 9100 N/A Ethernet-BP0 PortChannel4001 up up N/A off
Ethernet-BP4 97,98,99,100 40G 9100 N/A Ethernet-BP4 PortChannel4001 up up N/A off
PortChannel1002 N/A 80G 9100 N/A N/A routed up up N/A N/A
PortChannel1002 N/A 80G 9100 N/A N/A trunk up up N/A N/A
PortChannel4001 N/A 80G 9100 N/A N/A routed up up N/A N/A
"""
intf_description = """\
Expand Down
Loading

0 comments on commit c7d4947

Please sign in to comment.