Skip to content

Commit

Permalink
Add support for multi asic system
Browse files Browse the repository at this point in the history
Add UT for multi asic
  • Loading branch information
DavidZagury committed Dec 28, 2023
1 parent aecfeb0 commit ab65bd0
Show file tree
Hide file tree
Showing 8 changed files with 307 additions and 12 deletions.
4 changes: 4 additions & 0 deletions tests/mock_tables/asic0/appl_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
"alias": "etp2",
"speed": 100000
},
"PORT_TABLE:Ethernet24": {
"alias": "etp17",
"speed": 100000
},
"PORT_TABLE:Ethernet-BP0": {
"description": "snowflake",
"alias": "etp3",
Expand Down
70 changes: 66 additions & 4 deletions tests/mock_tables/asic0/counters_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,8 @@
"Ethernet-BP0": "oid:0x1000000000005",
"Ethernet-BP4": "oid:0x1000000000006",
"Ethernet-IB0": "oid:0x1000000000080",
"Ethernet-Rec0": "oid:0x1000000000081"
"Ethernet-Rec0": "oid:0x1000000000081",
"Ethernet24": "oid:0x1000000000014"
},
"COUNTERS_LAG_NAME_MAP": {
"PortChannel01": "oid:0x1000000000007"
Expand Down Expand Up @@ -592,7 +593,13 @@
"Ethernet4:12": "oid:0x15000000010244",
"Ethernet4:13": "oid:0x15000000010245",
"Ethernet4:14": "oid:0x15000000010246",
"Ethernet4:15": "oid:0x15000000010247"
"Ethernet4:15": "oid:0x15000000010247",
"Ethernet24:0": "oid:0x15000000000260",
"Ethernet24:1": "oid:0x15000000000261",
"Ethernet24:2": "oid:0x15000000000262",
"Ethernet24:3": "oid:0x15000000000263",
"Ethernet24:4": "oid:0x15000000000264",
"Ethernet24:6": "oid:0x15000000000266"
},
"COUNTERS_QUEUE_TYPE_MAP": {
"oid:0x15000000000230": "SAI_QUEUE_TYPE_UNICAST",
Expand Down Expand Up @@ -626,7 +633,13 @@
"oid:0x15000000010244": "SAI_QUEUE_TYPE_MULTICAST",
"oid:0x15000000010245": "SAI_QUEUE_TYPE_MULTICAST",
"oid:0x15000000010246": "SAI_QUEUE_TYPE_MULTICAST",
"oid:0x15000000010247": "SAI_QUEUE_TYPE_MULTICAST"
"oid:0x15000000010247": "SAI_QUEUE_TYPE_MULTICAST",
"oid:0x15000000000260": "SAI_QUEUE_TYPE_UNICAST",
"oid:0x15000000000261": "SAI_QUEUE_TYPE_UNICAST",
"oid:0x15000000000262": "SAI_QUEUE_TYPE_UNICAST",
"oid:0x15000000000263": "SAI_QUEUE_TYPE_UNICAST",
"oid:0x15000000000264": "SAI_QUEUE_TYPE_UNICAST",
"oid:0x15000000000266": "SAI_QUEUE_TYPE_UNICAST"
},
"COUNTERS:oid:0x15000000000230": {
"SAI_QUEUE_STAT_PACKETS": "1",
Expand Down Expand Up @@ -883,4 +896,53 @@
"SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS": "4",
"SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES": "5",
"SAI_QUEUE_STAT_WATERMARK_BYTES": "6"
}}
},
"COUNTERS:oid:0x15000000000260": {
"SAI_QUEUE_STAT_PACKETS": "1",
"SAI_QUEUE_STAT_BYTES": "23492723984237432",
"SAI_QUEUE_STAT_DROPPED_PACKETS": "3",
"SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS": "4",
"SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES": "5",
"SAI_QUEUE_STAT_WATERMARK_BYTES": "6"
},
"COUNTERS:oid:0x15000000000261": {
"SAI_QUEUE_STAT_PACKETS": "1",
"SAI_QUEUE_STAT_BYTES": "2",
"SAI_QUEUE_STAT_DROPPED_PACKETS": "3",
"SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS": "4",
"SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES": "5",
"SAI_QUEUE_STAT_WATERMARK_BYTES": "6"
},
"COUNTERS:oid:0x15000000000262": {
"SAI_QUEUE_STAT_PACKETS": "1",
"SAI_QUEUE_STAT_BYTES": "2",
"SAI_QUEUE_STAT_DROPPED_PACKETS": "3",
"SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS": "4",
"SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES": "5",
"SAI_QUEUE_STAT_WATERMARK_BYTES": "6"
},
"COUNTERS:oid:0x15000000000263": {
"SAI_QUEUE_STAT_PACKETS": "1",
"SAI_QUEUE_STAT_BYTES": "2",
"SAI_QUEUE_STAT_DROPPED_PACKETS": "3",
"SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS": "4",
"SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES": "5",
"SAI_QUEUE_STAT_WATERMARK_BYTES": "6"
},
"COUNTERS:oid:0x15000000000264": {
"SAI_QUEUE_STAT_PACKETS": "1",
"SAI_QUEUE_STAT_BYTES": "2",
"SAI_QUEUE_STAT_DROPPED_PACKETS": "3",
"SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS": "4",
"SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES": "5",
"SAI_QUEUE_STAT_WATERMARK_BYTES": "6"
},
"COUNTERS:oid:0x15000000000266": {
"SAI_QUEUE_STAT_PACKETS": "1",
"SAI_QUEUE_STAT_BYTES": "2",
"SAI_QUEUE_STAT_DROPPED_PACKETS": "3",
"SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS": "4",
"SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES": "5",
"SAI_QUEUE_STAT_WATERMARK_BYTES": "6"
}
}
4 changes: 4 additions & 0 deletions tests/mock_tables/asic1/appl_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
"speed": 1000,
"alias": "etp16"
},
"PORT_TABLE:Ethernet32": {
"speed": 1000,
"alias": "etp18"
},
"PORT_TABLE:Ethernet-BP8": {
"alias": "etp7"
},
Expand Down
70 changes: 66 additions & 4 deletions tests/mock_tables/asic1/counters_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,8 @@
"Ethernet12": "oid:0x1000000000004",
"Ethernet-BP8": "oid:0x1000000000005",
"Ethernet-BP12": "oid:0x1000000000006",
"Ethernet16": "oid:0x1000000000010"
"Ethernet16": "oid:0x1000000000010",
"Ethernet32": "oid:0x1000000000011"
},
"COUNTERS_LAG_NAME_MAP": {
"PortChannel02": "oid:0x1000000000007"
Expand Down Expand Up @@ -697,7 +698,13 @@
"Ethernet12:12": "oid:0x15000000010244",
"Ethernet12:13": "oid:0x15000000010245",
"Ethernet12:14": "oid:0x15000000010246",
"Ethernet12:15": "oid:0x15000000010247"
"Ethernet12:15": "oid:0x15000000010247",
"Ethernet32:8": "oid:0x15000000010270",
"Ethernet32:10": "oid:0x15000000010272",
"Ethernet32:11": "oid:0x15000000010273",
"Ethernet32:13": "oid:0x15000000010275",
"Ethernet32:14": "oid:0x15000000010276",
"Ethernet32:15": "oid:0x15000000010277"
},
"COUNTERS_QUEUE_TYPE_MAP": {
"oid:0x15000000000230": "SAI_QUEUE_TYPE_UNICAST",
Expand Down Expand Up @@ -731,7 +738,13 @@
"oid:0x15000000010244": "SAI_QUEUE_TYPE_MULTICAST",
"oid:0x15000000010245": "SAI_QUEUE_TYPE_MULTICAST",
"oid:0x15000000010246": "SAI_QUEUE_TYPE_MULTICAST",
"oid:0x15000000010247": "SAI_QUEUE_TYPE_MULTICAST"
"oid:0x15000000010247": "SAI_QUEUE_TYPE_MULTICAST",
"oid:0x15000000010270": "SAI_QUEUE_TYPE_MULTICAST",
"oid:0x15000000010272": "SAI_QUEUE_TYPE_MULTICAST",
"oid:0x15000000010273": "SAI_QUEUE_TYPE_MULTICAST",
"oid:0x15000000010275": "SAI_QUEUE_TYPE_MULTICAST",
"oid:0x15000000010276": "SAI_QUEUE_TYPE_MULTICAST",
"oid:0x15000000010277": "SAI_QUEUE_TYPE_MULTICAST"
},
"COUNTERS:oid:0x15000000000230": {
"SAI_QUEUE_STAT_PACKETS": "1",
Expand Down Expand Up @@ -988,4 +1001,53 @@
"SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS": "4",
"SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES": "5",
"SAI_QUEUE_STAT_WATERMARK_BYTES": "6"
}}
},
"COUNTERS:oid:0x15000000010270": {
"SAI_QUEUE_STAT_PACKETS": "1",
"SAI_QUEUE_STAT_BYTES": "2",
"SAI_QUEUE_STAT_DROPPED_PACKETS": "3",
"SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS": "4",
"SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES": "5",
"SAI_QUEUE_STAT_WATERMARK_BYTES": "6"
},
"COUNTERS:oid:0x15000000010272": {
"SAI_QUEUE_STAT_PACKETS": "1",
"SAI_QUEUE_STAT_BYTES": "2",
"SAI_QUEUE_STAT_DROPPED_PACKETS": "3",
"SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS": "4",
"SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES": "5",
"SAI_QUEUE_STAT_WATERMARK_BYTES": "6"
},
"COUNTERS:oid:0x15000000010273": {
"SAI_QUEUE_STAT_PACKETS": "1",
"SAI_QUEUE_STAT_BYTES": "2",
"SAI_QUEUE_STAT_DROPPED_PACKETS": "3",
"SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS": "4",
"SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES": "5",
"SAI_QUEUE_STAT_WATERMARK_BYTES": "6"
},
"COUNTERS:oid:0x15000000010275": {
"SAI_QUEUE_STAT_PACKETS": "1",
"SAI_QUEUE_STAT_BYTES": "2",
"SAI_QUEUE_STAT_DROPPED_PACKETS": "3",
"SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS": "4",
"SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES": "5",
"SAI_QUEUE_STAT_WATERMARK_BYTES": "6"
},
"COUNTERS:oid:0x15000000010276": {
"SAI_QUEUE_STAT_PACKETS": "1",
"SAI_QUEUE_STAT_BYTES": "2",
"SAI_QUEUE_STAT_DROPPED_PACKETS": "3",
"SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS": "4",
"SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES": "5",
"SAI_QUEUE_STAT_WATERMARK_BYTES": "6"
},
"COUNTERS:oid:0x15000000010277": {
"SAI_QUEUE_STAT_PACKETS": "1",
"SAI_QUEUE_STAT_BYTES": "2",
"SAI_QUEUE_STAT_DROPPED_PACKETS": "3",
"SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS": "4",
"SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES": "5",
"SAI_QUEUE_STAT_WATERMARK_BYTES": "6"
}
}
5 changes: 5 additions & 0 deletions tests/mock_tables/asic2/appl_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
"alias": "etp12",
"speed": 100000
},
"PORT_TABLE:Ethernet40": {
"description": "snowflake",
"alias": "etp19",
"speed": 100000
},
"ROUTE_TABLE:10.1.0.32": {
"nexthop": "",
"ifname": "lo"
Expand Down
111 changes: 107 additions & 4 deletions tests/mock_tables/asic2/counters_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@
"Ethernet-BP16": "oid:0x1000000000003",
"Ethernet-BP20": "oid:0x1000000000004",
"Ethernet-BP24": "oid:0x1000000000005",
"Ethernet-BP28": "oid:0x1000000000006"
"Ethernet-BP28": "oid:0x1000000000006",
"Ethernet40": "oid:0x100000000000d"
},
"COUNTERS_LAG_NAME_MAP": {
"PortChannel03": "oid:0x1000000000007",
Expand Down Expand Up @@ -659,7 +660,18 @@
"Ethernet-BP20:12": "oid:0x15000000010244",
"Ethernet-BP20:13": "oid:0x15000000010245",
"Ethernet-BP20:14": "oid:0x15000000010246",
"Ethernet-BP20:15": "oid:0x15000000010247"
"Ethernet-BP20:15": "oid:0x15000000010247",
"Ethernet40:1": "oid:0x15000000000281",
"Ethernet40:2": "oid:0x15000000000282",
"Ethernet40:4": "oid:0x15000000000284",
"Ethernet40:6": "oid:0x15000000000286",
"Ethernet40:7": "oid:0x15000000000287",
"Ethernet40:8": "oid:0x15000000010280",
"Ethernet40:9": "oid:0x15000000010281",
"Ethernet40:11": "oid:0x15000000010283",
"Ethernet40:13": "oid:0x15000000010285",
"Ethernet40:14": "oid:0x15000000010286"

},
"COUNTERS_QUEUE_TYPE_MAP": {
"oid:0x15000000000230": "SAI_QUEUE_TYPE_UNICAST",
Expand Down Expand Up @@ -693,7 +705,17 @@
"oid:0x15000000010244": "SAI_QUEUE_TYPE_MULTICAST",
"oid:0x15000000010245": "SAI_QUEUE_TYPE_MULTICAST",
"oid:0x15000000010246": "SAI_QUEUE_TYPE_MULTICAST",
"oid:0x15000000010247": "SAI_QUEUE_TYPE_MULTICAST"
"oid:0x15000000010247": "SAI_QUEUE_TYPE_MULTICAST",
"oid:0x15000000000281": "SAI_QUEUE_TYPE_UNICAST",
"oid:0x15000000000282": "SAI_QUEUE_TYPE_UNICAST",
"oid:0x15000000000284": "SAI_QUEUE_TYPE_UNICAST",
"oid:0x15000000000286": "SAI_QUEUE_TYPE_UNICAST",
"oid:0x15000000000287": "SAI_QUEUE_TYPE_UNICAST",
"oid:0x15000000010280": "SAI_QUEUE_TYPE_MULTICAST",
"oid:0x15000000010281": "SAI_QUEUE_TYPE_MULTICAST",
"oid:0x15000000010283": "SAI_QUEUE_TYPE_MULTICAST",
"oid:0x15000000010285": "SAI_QUEUE_TYPE_MULTICAST",
"oid:0x15000000010286": "SAI_QUEUE_TYPE_MULTICAST"
},
"COUNTERS:oid:0x15000000000230": {
"SAI_QUEUE_STAT_PACKETS": "1",
Expand Down Expand Up @@ -950,4 +972,85 @@
"SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS": "4",
"SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES": "5",
"SAI_QUEUE_STAT_WATERMARK_BYTES": "6"
}}
},
"COUNTERS:oid:0x15000000000281": {
"SAI_QUEUE_STAT_PACKETS": "1",
"SAI_QUEUE_STAT_BYTES": "2",
"SAI_QUEUE_STAT_DROPPED_PACKETS": "3",
"SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS": "4",
"SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES": "5",
"SAI_QUEUE_STAT_WATERMARK_BYTES": "6"
},
"COUNTERS:oid:0x15000000000282": {
"SAI_QUEUE_STAT_PACKETS": "1",
"SAI_QUEUE_STAT_BYTES": "2",
"SAI_QUEUE_STAT_DROPPED_PACKETS": "3",
"SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS": "4",
"SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES": "5",
"SAI_QUEUE_STAT_WATERMARK_BYTES": "6"
},
"COUNTERS:oid:0x15000000000284": {
"SAI_QUEUE_STAT_PACKETS": "1",
"SAI_QUEUE_STAT_BYTES": "2",
"SAI_QUEUE_STAT_DROPPED_PACKETS": "3",
"SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS": "4",
"SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES": "5",
"SAI_QUEUE_STAT_WATERMARK_BYTES": "6"
},
"COUNTERS:oid:0x15000000000286": {
"SAI_QUEUE_STAT_PACKETS": "1",
"SAI_QUEUE_STAT_BYTES": "2",
"SAI_QUEUE_STAT_DROPPED_PACKETS": "3",
"SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS": "4",
"SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES": "5",
"SAI_QUEUE_STAT_WATERMARK_BYTES": "6"
},
"COUNTERS:oid:0x15000000000287": {
"SAI_QUEUE_STAT_PACKETS": "1",
"SAI_QUEUE_STAT_BYTES": "2",
"SAI_QUEUE_STAT_DROPPED_PACKETS": "3",
"SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS": "4",
"SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES": "5",
"SAI_QUEUE_STAT_WATERMARK_BYTES": "6"
},
"COUNTERS:oid:0x15000000010280": {
"SAI_QUEUE_STAT_PACKETS": "123459",
"SAI_QUEUE_STAT_BYTES": "23492723984237432",
"SAI_QUEUE_STAT_DROPPED_PACKETS": "3",
"SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS": "4",
"SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES": "5",
"SAI_QUEUE_STAT_WATERMARK_BYTES": "6"
},
"COUNTERS:oid:0x15000000010281": {
"SAI_QUEUE_STAT_PACKETS": "1",
"SAI_QUEUE_STAT_BYTES": "2",
"SAI_QUEUE_STAT_DROPPED_PACKETS": "3",
"SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS": "4",
"SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES": "5",
"SAI_QUEUE_STAT_WATERMARK_BYTES": "6"
},
"COUNTERS:oid:0x15000000010283": {
"SAI_QUEUE_STAT_PACKETS": "1",
"SAI_QUEUE_STAT_BYTES": "2",
"SAI_QUEUE_STAT_DROPPED_PACKETS": "3",
"SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS": "4",
"SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES": "5",
"SAI_QUEUE_STAT_WATERMARK_BYTES": "6"
},
"COUNTERS:oid:0x15000000010285": {
"SAI_QUEUE_STAT_PACKETS": "1",
"SAI_QUEUE_STAT_BYTES": "2",
"SAI_QUEUE_STAT_DROPPED_PACKETS": "3",
"SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS": "4",
"SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES": "5",
"SAI_QUEUE_STAT_WATERMARK_BYTES": "6"
},
"COUNTERS:oid:0x15000000010286": {
"SAI_QUEUE_STAT_PACKETS": "1",
"SAI_QUEUE_STAT_BYTES": "2",
"SAI_QUEUE_STAT_DROPPED_PACKETS": "3",
"SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS": "4",
"SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES": "5",
"SAI_QUEUE_STAT_WATERMARK_BYTES": "6"
}
}
9 changes: 9 additions & 0 deletions tests/mock_tables/global_db/state_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,14 @@
},
"BUFFER_MAX_PARAM_TABLE|Ethernet-BP20": {
"max_queues": "16"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet24": {
"max_queues": "16"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet32": {
"max_queues": "16"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet40": {
"max_queues": "16"
}
}
Loading

0 comments on commit ab65bd0

Please sign in to comment.