Skip to content

Commit c7d4947

Browse files
author
maksymbelei95
authored
[show] Fix int status of LAGs, configured as Vlan members (sonic-net#1478)
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]>
1 parent 553936b commit c7d4947

File tree

6 files changed

+140
-112
lines changed

6 files changed

+140
-112
lines changed

scripts/intfutil

+1-1
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ class IntfStatus(object):
409409
appl_db_portchannel_status_get(self.db, self.config_db, po, PORT_MTU_STATUS, self.portchannel_speed_dict),
410410
appl_db_portchannel_status_get(self.db, self.config_db, po, PORT_FEC, self.portchannel_speed_dict),
411411
appl_db_portchannel_status_get(self.db, self.config_db, po, PORT_ALIAS, self.portchannel_speed_dict),
412-
appl_db_portchannel_status_get(self.db, self.config_db, po, "vlan", self.portchannel_speed_dict),
412+
appl_db_portchannel_status_get(self.db, self.config_db, po, "vlan", self.portchannel_speed_dict, self.combined_int_to_vlan_po_dict),
413413
appl_db_portchannel_status_get(self.db, self.config_db, po, PORT_OPER_STATUS, self.portchannel_speed_dict),
414414
appl_db_portchannel_status_get(self.db, self.config_db, po, PORT_ADMIN_STATUS, self.portchannel_speed_dict),
415415
appl_db_portchannel_status_get(self.db, self.config_db, po, PORT_OPTICS_TYPE, self.portchannel_speed_dict),

tests/intfutil_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
PortChannel0002 N/A 40G 9100 N/A N/A routed up up N/A N/A
2424
PortChannel0003 N/A 40G 9100 N/A N/A routed up up N/A N/A
2525
PortChannel0004 N/A 40G 9100 N/A N/A routed up up N/A N/A
26-
PortChannel1001 N/A 40G 9100 N/A N/A routed N/A N/A N/A N/A
26+
PortChannel1001 N/A 40G 9100 N/A N/A trunk N/A N/A N/A N/A
2727
"""
2828

2929
show_interface_status_Ethernet32_output="""\

tests/mock_tables/asic0/config_db.json

+6
Original file line numberDiff line numberDiff line change
@@ -176,5 +176,11 @@
176176
"state": "enabled",
177177
"auto_restart": "enabled",
178178
"high_mem_alert": "disabled"
179+
},
180+
"VLAN|Vlan1000": {
181+
"vlanid": "1000"
182+
},
183+
"VLAN_MEMBER|Vlan1000|PortChannel1002": {
184+
"tagging_mode": "tagged"
179185
}
180186
}

tests/mock_tables/config_db.json

+6
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,9 @@
437437
"VLAN|Vlan3000": {
438438
"vlanid": "3000"
439439
},
440+
"VLAN|Vlan4000": {
441+
"vlanid": "4000"
442+
},
440443
"VLAN_INTERFACE|Vlan1000": {
441444
"NULL": "NULL"
442445
},
@@ -473,6 +476,9 @@
473476
"VLAN_MEMBER|Vlan2000|Ethernet28": {
474477
"tagging_mode": "untagged"
475478
},
479+
"VLAN_MEMBER|Vlan4000|PortChannel1001": {
480+
"tagging_mode": "tagged"
481+
},
476482
"PORTCHANNEL|PortChannel1001": {
477483
"admin_status": "up",
478484
"members@": "Ethernet32",

tests/multi_asic_intfutil_test.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Ethernet-BP4 97,98,99,100 40G 9100 N/A Ethernet-BP4 PortChannel4001 up up N/A off
2020
Ethernet-BP256 61,62,63,64 40G 9100 N/A Ethernet-BP256 PortChannel4009 up up N/A off
2121
Ethernet-BP260 57,58,59,60 40G 9100 N/A Ethernet-BP260 PortChannel4009 up up N/A off
22-
PortChannel1002 N/A 80G 9100 N/A N/A routed up up N/A N/A
22+
PortChannel1002 N/A 80G 9100 N/A N/A trunk up up N/A N/A
2323
PortChannel4001 N/A 80G 9100 N/A N/A routed up up N/A N/A
2424
PortChannel4009 N/A 80G 9100 N/A N/A routed up up N/A N/A
2525
"""
@@ -28,15 +28,15 @@
2828
--------------- ----------- ------- ----- ----- ----------- --------------- ------ ------- --------------- ----------
2929
Ethernet0 33,34,35,36 40G 9100 N/A Ethernet1/1 PortChannel1002 up up QSFP28 or later off
3030
Ethernet4 29,30,31,32 40G 9100 N/A Ethernet1/2 PortChannel1002 up up N/A off
31-
PortChannel1002 N/A 80G 9100 N/A N/A routed up up N/A N/A
31+
PortChannel1002 N/A 80G 9100 N/A N/A trunk up up N/A N/A
3232
"""
3333

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

4242
intf_status_asic0_all = """\
@@ -46,7 +46,7 @@
4646
Ethernet4 29,30,31,32 40G 9100 N/A Ethernet1/2 PortChannel1002 up up N/A off
4747
Ethernet-BP0 93,94,95,96 40G 9100 N/A Ethernet-BP0 PortChannel4001 up up N/A off
4848
Ethernet-BP4 97,98,99,100 40G 9100 N/A Ethernet-BP4 PortChannel4001 up up N/A off
49-
PortChannel1002 N/A 80G 9100 N/A N/A routed up up N/A N/A
49+
PortChannel1002 N/A 80G 9100 N/A N/A trunk up up N/A N/A
5050
PortChannel4001 N/A 80G 9100 N/A N/A routed up up N/A N/A
5151
"""
5252
intf_description = """\

0 commit comments

Comments
 (0)