forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[test] Update unit test coverage for command 'show mac' (sonic-net#1504)
* Adding unit tests for CLI command 'show mac'. Testing both CLI command and 'fdbshow' script. Signed-off-by: Maksym Belei <Maksym_Belei@jabil.com>
- Loading branch information
maksymbelei95
authored
Mar 18, 2021
1 parent
4a0c010
commit 3a482ac
Showing
8 changed files
with
446 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{ | ||
"ASIC_STATE:SAI_OBJECT_TYPE_SWITCH:oid:0x21000000000000": { | ||
"SAI_SWITCH_ATTR_INIT_SWITCH": "true", | ||
"SAI_SWITCH_ATTR_SRC_MAC_ADDRESS": "DE:AD:BE:EF:CA:FE" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_BRIDGE_PORT:oid:0x3a0000000005cb": { | ||
"SAI_BRIDGE_PORT_ATTR_TYPE": "SAI_BRIDGE_PORT_TYPE_PORT", | ||
"SAI_BRIDGE_PORT_ATTR_PORT_ID": "oid:0x1000000000528", | ||
"SAI_BRIDGE_PORT_ATTR_ADMIN_STATE": "true", | ||
"SAI_BRIDGE_PORT_ATTR_FDB_LEARNING_MODE": "SAI_BRIDGE_PORT_FDB_LEARNING_MODE_HW" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_BRIDGE_PORT:oid:0x3a0000000006cd": { | ||
"SAI_BRIDGE_PORT_ATTR_TYPE": "SAI_BRIDGE_PORT_TYPE_PORT", | ||
"SAI_BRIDGE_PORT_ATTR_PORT_ID": "oid:0x1000000000549", | ||
"SAI_BRIDGE_PORT_ATTR_ADMIN_STATE": "true", | ||
"SAI_BRIDGE_PORT_ATTR_FDB_LEARNING_MODE": "SAI_BRIDGE_PORT_FDB_LEARNING_MODE_HW" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_BRIDGE_PORT:oid:0x3a0000000007ef": { | ||
"SAI_BRIDGE_PORT_ATTR_TYPE": "SAI_BRIDGE_PORT_TYPE_PORT", | ||
"SAI_BRIDGE_PORT_ATTR_PORT_ID": "oid:0x1000000000fff", | ||
"SAI_BRIDGE_PORT_ATTR_ADMIN_STATE": "true", | ||
"SAI_BRIDGE_PORT_ATTR_FDB_LEARNING_MODE": "SAI_BRIDGE_PORT_FDB_LEARNING_MODE_HW" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_FDB_ENTRY:{\"bvid\":\"oid:0x260000000005c5\",\"mac\":\"11:22:33:44:55:66\",\"switch_id\":\"oid:0x21000000000000\"}": { | ||
"SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID": "oid:0x3a0000000005cb", | ||
"SAI_FDB_ENTRY_ATTR_TYPE": "SAI_FDB_ENTRY_TYPE_DYNAMIC", | ||
"SAI_FDB_ENTRY_ATTR_PACKET_ACTION": "SAI_PACKET_ACTION_FORWARD" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_FDB_ENTRY:{\"bvid\":\"oid:0x260000000006c6\",\"mac\":\"11:22:33:66:55:44\",\"switch_id\":\"oid:0x21000000000000\"}": { | ||
"SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID": "oid:0x3a0000000006cd", | ||
"SAI_FDB_ENTRY_ATTR_TYPE": "SAI_FDB_ENTRY_TYPE_STATIC", | ||
"SAI_FDB_ENTRY_ATTR_PACKET_ACTION": "SAI_PACKET_ACTION_FORWARD" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_FDB_ENTRY:{\"bvid\":\"oid:0x260000000007c7\",\"mac\":\"66:55:44:33:22:11\",\"switch_id\":\"oid:0x21000000000000\"}": { | ||
"SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID": "oid:0x3a0000000005cb", | ||
"SAI_FDB_ENTRY_ATTR_TYPE": "SAI_FDB_ENTRY_TYPE_DYNAMIC", | ||
"SAI_FDB_ENTRY_ATTR_PACKET_ACTION": "SAI_PACKET_ACTION_FORWARD" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_FDB_ENTRY:{}": { | ||
"SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID": "oid:0x3a0000000005ff", | ||
"SAI_FDB_ENTRY_ATTR_TYPE": "SAI_FDB_ENTRY_TYPE_DYNAMIC", | ||
"SAI_FDB_ENTRY_ATTR_PACKET_ACTION": "SAI_PACKET_ACTION_FORWARD" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_FDB_ENTRY:{\"bvid\":\"oid:0x260000000007c7\",\"mac\":\"77:55:44:33:22:11\",\"switch_id\":\"oid:0x21000000000000\"}": { | ||
"SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID": "oid:0x3a000000000fff", | ||
"SAI_FDB_ENTRY_ATTR_TYPE": "SAI_FDB_ENTRY_TYPE_DYNAMIC", | ||
"SAI_FDB_ENTRY_ATTR_PACKET_ACTION": "SAI_PACKET_ACTION_FORWARD" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_FDB_ENTRY:{\"bvid\":\"oid:0x260000000007c7\",\"mac\":\"77:66:44:33:22:11\",\"switch_id\":\"oid:0x21000000000000\"}": { | ||
"SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID": "oid:0x3a0000000007ef", | ||
"SAI_FDB_ENTRY_ATTR_TYPE": "SAI_FDB_ENTRY_TYPE_DYNAMIC", | ||
"SAI_FDB_ENTRY_ATTR_PACKET_ACTION": "SAI_PACKET_ACTION_FORWARD" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_FDB_ENTRY:{\"vlan\":\"5\",\"mac\":\"77:66:55:44:22:11\",\"switch_id\":\"oid:0x21000000000000\"}": { | ||
"SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID": "oid:0x3a0000000006cd", | ||
"SAI_FDB_ENTRY_ATTR_TYPE": "SAI_FDB_ENTRY_TYPE_DYNAMIC", | ||
"SAI_FDB_ENTRY_ATTR_PACKET_ACTION": "SAI_PACKET_ACTION_FORWARD" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_FDB_ENTRY:{\"mac\":\"77:66:55:33:22:11\",\"switch_id\":\"oid:0x21000000000000\"}": { | ||
"SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID": "oid:0x3a0000000007ef", | ||
"SAI_FDB_ENTRY_ATTR_TYPE": "SAI_FDB_ENTRY_TYPE_DYNAMIC", | ||
"SAI_FDB_ENTRY_ATTR_PACKET_ACTION": "SAI_PACKET_ACTION_FORWARD" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_VLAN:oid:0x260000000005c5": { | ||
"SAI_VLAN_ATTR_VLAN_ID": "2" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_VLAN:oid:0x260000000006c6": { | ||
"SAI_VLAN_ATTR_VLAN_ID": "3" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_VLAN:oid:0x260000000007c7": { | ||
"SAI_VLAN_ATTR_VLAN_ID": "4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"ASIC_STATE:SAI_OBJECT_TYPE_SWITCH:oid:0x21000000000000": { | ||
"SAI_SWITCH_ATTR_INIT_SWITCH": "true", | ||
"SAI_SWITCH_ATTR_SRC_MAC_ADDRESS": "DE:AD:BE:EF:CA:FE" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_BRIDGE_PORT:oid:0x3a0000000005cb": { | ||
"SAI_BRIDGE_PORT_ATTR_TYPE": "SAI_BRIDGE_PORT_TYPE_PORT", | ||
"SAI_BRIDGE_PORT_ATTR_PORT_ID": "oid:0x1000000000528", | ||
"SAI_BRIDGE_PORT_ATTR_ADMIN_STATE": "true", | ||
"SAI_BRIDGE_PORT_ATTR_FDB_LEARNING_MODE": "SAI_BRIDGE_PORT_FDB_LEARNING_MODE_HW" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_BRIDGE_PORT:oid:0x3a0000000006cd": { | ||
"SAI_BRIDGE_PORT_ATTR_TYPE": "SAI_BRIDGE_PORT_TYPE_PORT", | ||
"SAI_BRIDGE_PORT_ATTR_PORT_ID": "oid:0x1000000000549", | ||
"SAI_BRIDGE_PORT_ATTR_ADMIN_STATE": "true", | ||
"SAI_BRIDGE_PORT_ATTR_FDB_LEARNING_MODE": "SAI_BRIDGE_PORT_FDB_LEARNING_MODE_HW" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_FDB_ENTRY:{\"bvid\":\"oid:0x260000000005c5\",\"mac\":\"11:22:33:44:55:66\",\"switch_id\":\"oid:0x21000000000000\"}": { | ||
"SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID": "oid:0x3a0000000005cb", | ||
"SAI_FDB_ENTRY_ATTR_TYPE": "SAI_FDB_ENTRY_TYPE_DYNAMIC", | ||
"SAI_FDB_ENTRY_ATTR_PACKET_ACTION": "SAI_PACKET_ACTION_FORWARD" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_FDB_ENTRY:{\"bvid\":\"oid:0x260000000006c6\",\"mac\":\"11:22:33:66:55:44\",\"switch_id\":\"oid:0x21000000000000\"}": { | ||
"SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID": "oid:0x3a0000000006cd", | ||
"SAI_FDB_ENTRY_ATTR_TYPE": "SAI_FDB_ENTRY_TYPE_STATIC", | ||
"SAI_FDB_ENTRY_ATTR_PACKET_ACTION": "SAI_PACKET_ACTION_FORWARD" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_FDB_ENTRY:{\"bvid\":\"oid:0x26000000000013\",\"mac\":\"66:55:44:33:22:11\",\"switch_id\":\"oid:0x21000000000000\"}": { | ||
"SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID": "oid:0x3a0000000005cb", | ||
"SAI_FDB_ENTRY_ATTR_TYPE": "SAI_FDB_ENTRY_TYPE_DYNAMIC", | ||
"SAI_FDB_ENTRY_ATTR_PACKET_ACTION": "SAI_PACKET_ACTION_FORWARD" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_VLAN:oid:0x260000000005c5": { | ||
"SAI_VLAN_ATTR_VLAN_ID": "2" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_VLAN:oid:0x260000000006c6": { | ||
"SAI_VLAN_ATTR_VLAN_ID": "3" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_VLAN:oid:0x26000000000013": { | ||
"NULL": "NULL" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"ASIC_STATE:SAI_OBJECT_TYPE_SWITCH:oid:0x21000000000000": { | ||
"SAI_SWITCH_ATTR_INIT_SWITCH": "true", | ||
"SAI_SWITCH_ATTR_SRC_MAC_ADDRESS": "DE:AD:BE:EF:CA:FE" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_BRIDGE_PORT:oid:0x3a0000000005cb": { | ||
"SAI_BRIDGE_PORT_ATTR_TYPE": "SAI_BRIDGE_PORT_TYPE_PORT", | ||
"SAI_BRIDGE_PORT_ATTR_PORT_ID": "oid:0x1000000000528", | ||
"SAI_BRIDGE_PORT_ATTR_ADMIN_STATE": "true", | ||
"SAI_BRIDGE_PORT_ATTR_FDB_LEARNING_MODE": "SAI_BRIDGE_PORT_FDB_LEARNING_MODE_HW" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_BRIDGE_PORT:oid:0x3a0000000006cd": { | ||
"SAI_BRIDGE_PORT_ATTR_TYPE": "SAI_BRIDGE_PORT_TYPE_PORT", | ||
"SAI_BRIDGE_PORT_ATTR_PORT_ID": "oid:0x1000000000549", | ||
"SAI_BRIDGE_PORT_ATTR_ADMIN_STATE": "true", | ||
"SAI_BRIDGE_PORT_ATTR_FDB_LEARNING_MODE": "SAI_BRIDGE_PORT_FDB_LEARNING_MODE_HW" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_FDB_ENTRY:{\"bvid\":\"oid:0x260000000005c5\",\"mac\":\"11:22:33:44:55:66\",\"switch_id\":\"oid:0x21000000000000\"}": { | ||
"SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID": "oid:0x3a0000000005cb", | ||
"SAI_FDB_ENTRY_ATTR_TYPE": "SAI_FDB_ENTRY_TYPE_DYNAMIC", | ||
"SAI_FDB_ENTRY_ATTR_PACKET_ACTION": "SAI_PACKET_ACTION_FORWARD" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_FDB_ENTRY:{\"bvid\":\"oid:0x260000000006c6\",\"mac\":\"11:22:33:66:55:44\",\"switch_id\":\"oid:0x21000000000000\"}": { | ||
"SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID": "oid:0x3a0000000006cd", | ||
"SAI_FDB_ENTRY_ATTR_TYPE": "SAI_FDB_ENTRY_TYPE_STATIC", | ||
"SAI_FDB_ENTRY_ATTR_PACKET_ACTION": "SAI_PACKET_ACTION_FORWARD" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_FDB_ENTRY:{\"bvid\":\"oid:0x260000000007c7\",\"mac\":\"66:55:44:33:22:11\",\"switch_id\":\"oid:0x21000000000000\"}": { | ||
"SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID": "oid:0x3a0000000005cb", | ||
"SAI_FDB_ENTRY_ATTR_TYPE": "SAI_FDB_ENTRY_TYPE_DYNAMIC", | ||
"SAI_FDB_ENTRY_ATTR_PACKET_ACTION": "SAI_PACKET_ACTION_FORWARD" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_FDB_ENTRY:{}": { | ||
"SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID": "oid:0x3a0000000005ff", | ||
"SAI_FDB_ENTRY_ATTR_TYPE": "SAI_FDB_ENTRY_TYPE_DYNAMIC", | ||
"SAI_FDB_ENTRY_ATTR_PACKET_ACTION": "SAI_PACKET_ACTION_FORWARD" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_FDB_ENTRY:{\"bvid\":\"oid:0x260000000007c7\",\"mac\":\"77:55:44:33:22:11\",\"switch_id\":\"oid:0x21000000000000\"}": { | ||
"SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID": "oid:0x3a000000000fff", | ||
"SAI_FDB_ENTRY_ATTR_TYPE": "SAI_FDB_ENTRY_TYPE_DYNAMIC", | ||
"SAI_FDB_ENTRY_ATTR_PACKET_ACTION": "SAI_PACKET_ACTION_FORWARD" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_VLAN:oid:0x260000000005c5": { | ||
"SAI_VLAN_ATTR_VLAN_ID": "2" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_VLAN:oid:0x260000000006c6": { | ||
"SAI_VLAN_ATTR_VLAN_ID": "3" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_VLAN:oid:0x260000000007c7": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"ASIC_STATE:SAI_OBJECT_TYPE_SWITCH:oid:0x21000000000000": { | ||
"SAI_SWITCH_ATTR_INIT_SWITCH": "true", | ||
"SAI_SWITCH_ATTR_SRC_MAC_ADDRESS": "DE:AD:BE:EF:CA:FE" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_VLAN:oid:0x260000000005c5": { | ||
"SAI_VLAN_ATTR_VLAN_ID": "2" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_VLAN:oid:0x260000000006c6": { | ||
"SAI_VLAN_ATTR_VLAN_ID": "3" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_VLAN:oid:0x260000000007c7": { | ||
"SAI_VLAN_ATTR_VLAN_ID": "4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"ASIC_STATE:SAI_OBJECT_TYPE_SWITCH:oid:0x21000000000000": { | ||
"SAI_SWITCH_ATTR_INIT_SWITCH": "true", | ||
"SAI_SWITCH_ATTR_SRC_MAC_ADDRESS": "DE:AD:BE:EF:CA:FE" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_BRIDGE_PORT:oid:0x3a0000000005cb": { | ||
"SAI_BRIDGE_PORT_ATTR_TYPE": "SAI_BRIDGE_PORT_TYPE_PORT", | ||
"SAI_BRIDGE_PORT_ATTR_PORT_ID": "oid:0x1000000000528", | ||
"SAI_BRIDGE_PORT_ATTR_ADMIN_STATE": "true", | ||
"SAI_BRIDGE_PORT_ATTR_FDB_LEARNING_MODE": "SAI_BRIDGE_PORT_FDB_LEARNING_MODE_HW" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_BRIDGE_PORT:oid:0x3a0000000006cd": { | ||
"SAI_BRIDGE_PORT_ATTR_TYPE": "SAI_BRIDGE_PORT_TYPE_PORT", | ||
"SAI_BRIDGE_PORT_ATTR_PORT_ID": "oid:0x1000000000549", | ||
"SAI_BRIDGE_PORT_ATTR_ADMIN_STATE": "true", | ||
"SAI_BRIDGE_PORT_ATTR_FDB_LEARNING_MODE": "SAI_BRIDGE_PORT_FDB_LEARNING_MODE_HW" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_VLAN:oid:0x260000000005c5": { | ||
"SAI_VLAN_ATTR_VLAN_ID": "2" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_VLAN:oid:0x260000000006c6": { | ||
"SAI_VLAN_ATTR_VLAN_ID": "3" | ||
}, | ||
"ASIC_STATE:SAI_OBJECT_TYPE_VLAN:oid:0x260000000007c7": { | ||
"SAI_VLAN_ATTR_VLAN_ID": "4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"COUNTERS_PORT_NAME_MAP": { | ||
"Ethernet0": "oid:0x1000000000528", | ||
"Ethernet4": "oid:0x1000000000549" | ||
}, | ||
"COUNTERS_LAG_NAME_MAP": { | ||
"": "" | ||
} | ||
} |
Oops, something went wrong.