Skip to content

Commit

Permalink
add mock tables for LAG_NAME_MAP_TABLE in COUNTERS_DB (#202)
Browse files Browse the repository at this point in the history
Same as #114 but target against 201911 branch
  • Loading branch information
qiluo-msft authored Mar 12, 2021
1 parent b8f0c3a commit 02dc2ce
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/sonic_ax_impl/mibs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ def init_mgmt_interface_tables(db_conn):

return oid_name_map, if_alias_map

# TODO: the function name include interface, but only return port by design. Fix the design or the name
def init_sync_d_interface_tables(db_conn):
"""
Initializes interface maps for SyncD-connected MIB(s).
Expand Down
105 changes: 105 additions & 0 deletions tests/mock_tables/counters_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,108 @@
"SAI_PORT_STAT_PFC_7_RX_PKTS": "8",
"SAI_PORT_STAT_PFC_7_TX_PKTS": "8"
},
"COUNTERS:oid:0x1000000000023": {
"SAI_PORT_STAT_ETHER_STATS_TX_NO_ERRORS": "0",
"SAI_PORT_STAT_ETHER_STATS_OVERSIZE_PKTS": "0",
"SAI_PORT_STAT_IF_OUT_ERRORS": "0",
"SAI_PORT_STAT_ETHER_TX_OVERSIZE_PKTS": "0",
"SAI_PORT_STAT_ETHER_STATS_PKTS_1519_TO_2047_OCTETS": "0",
"SAI_PORT_STAT_IP_IN_RECEIVES": "0",
"SAI_PORT_STAT_ETHER_IN_PKTS_64_OCTETS": "0",
"SAI_PORT_STAT_IPV6_OUT_UCAST_PKTS": "0",
"SAI_PORT_STAT_ETHER_OUT_PKTS_4096_TO_9216_OCTETS": "0",
"SAI_PORT_STAT_IF_IN_ERRORS": "0",
"SAI_PORT_STAT_ETHER_STATS_PKTS": "0",
"SAI_PORT_STAT_ETHER_STATS_BROADCAST_PKTS": "0",
"SAI_PORT_STAT_IF_IN_DISCARDS": "0",
"SAI_PORT_STAT_IP_OUT_DISCARDS": "0",
"SAI_PORT_STAT_IF_IN_UNKNOWN_PROTOS": "0",
"SAI_PORT_STAT_IPV6_IN_DISCARDS": "0",
"SAI_PORT_STAT_IPV6_OUT_DISCARDS": "0",
"SAI_PORT_STAT_IPV6_IN_OCTETS": "0",
"SAI_PORT_STAT_ETHER_OUT_PKTS_65_TO_127_OCTETS": "0",
"SAI_PORT_STAT_IF_IN_BROADCAST_PKTS": "0",
"SAI_PORT_STAT_ETHER_IN_PKTS_1519_TO_2047_OCTETS": "0",
"SAI_PORT_STAT_IF_OUT_MULTICAST_PKTS": "0",
"SAI_PORT_STAT_ETHER_OUT_PKTS_512_TO_1023_OCTETS": "0",
"SAI_PORT_STAT_ETHER_STATS_PKTS_256_TO_511_OCTETS": "0",
"SAI_PORT_STAT_ETHER_STATS_PKTS_9217_TO_16383_OCTETS": "0",
"SAI_PORT_STAT_ETHER_IN_PKTS_512_TO_1023_OCTETS": "0",
"SAI_PORT_STAT_IPV6_IN_NON_UCAST_PKTS": "0",
"SAI_PORT_STAT_ETHER_IN_PKTS_4096_TO_9216_OCTETS": "0",
"SAI_PORT_STAT_IF_OUT_BROADCAST_PKTS": "0",
"SAI_PORT_STAT_IPV6_OUT_NON_UCAST_PKTS": "0",
"SAI_PORT_STAT_IF_IN_VLAN_DISCARDS": "0",
"SAI_PORT_STAT_ETHER_IN_PKTS_65_TO_127_OCTETS": "0",
"SAI_PORT_STAT_IP_IN_NON_UCAST_PKTS": "0",
"SAI_PORT_STAT_ETHER_STATS_FRAGMENTS": "0",
"SAI_PORT_STAT_IPV6_IN_UCAST_PKTS": "0",
"SAI_PORT_STAT_IPV6_IN_RECEIVES": "0",
"SAI_PORT_STAT_ETHER_STATS_PKTS_4096_TO_9216_OCTETS": "0",
"SAI_PORT_STAT_IF_OUT_DISCARDS": "0",
"SAI_PORT_STAT_ETHER_STATS_DROP_EVENTS": "0",
"SAI_PORT_STAT_IPV6_OUT_MCAST_PKTS": "0",
"SAI_PORT_STAT_ETHER_RX_OVERSIZE_PKTS": "0",
"SAI_PORT_STAT_IF_OUT_OCTETS": "0",
"SAI_PORT_STAT_IF_IN_NON_UCAST_PKTS": "0",
"SAI_PORT_STAT_ETHER_IN_PKTS_9217_TO_16383_OCTETS": "0",
"SAI_PORT_STAT_ETHER_OUT_PKTS_1024_TO_1518_OCTETS": "0",
"SAI_PORT_STAT_ETHER_STATS_PKTS_2048_TO_4095_OCTETS": "0",
"SAI_PORT_STAT_ETHER_STATS_PKTS_512_TO_1023_OCTETS": "0",
"SAI_PORT_STAT_ETHER_OUT_PKTS_1519_TO_2047_OCTETS": "0",
"SAI_PORT_STAT_ETHER_STATS_RX_NO_ERRORS": "0",
"SAI_PORT_STAT_ETHER_OUT_PKTS_64_OCTETS": "0",
"SAI_PORT_STAT_ETHER_STATS_COLLISIONS": "0",
"SAI_PORT_STAT_ETHER_IN_PKTS_1024_TO_1518_OCTETS": "0",
"SAI_PORT_STAT_ETHER_STATS_PKTS_1024_TO_1518_OCTETS": "0",
"SAI_PORT_STAT_ETHER_IN_PKTS_256_TO_511_OCTETS": "0",
"SAI_PORT_STAT_ETHER_OUT_PKTS_2048_TO_4095_OCTETS": "0",
"SAI_PORT_STAT_ETHER_STATS_OCTETS": "0",
"SAI_PORT_STAT_IF_OUT_UCAST_PKTS": "0",
"SAI_PORT_STAT_ETHER_STATS_UNDERSIZE_PKTS": "0",
"SAI_PORT_STAT_ETHER_OUT_PKTS_128_TO_255_OCTETS": "0",
"SAI_PORT_STAT_ETHER_STATS_PKTS_64_OCTETS": "0",
"SAI_PORT_STAT_IP_OUT_OCTETS": "0",
"SAI_PORT_STAT_IF_IN_UCAST_PKTS": "0",
"SAI_PORT_STAT_ETHER_OUT_PKTS_9217_TO_16383_OCTETS": "0",
"SAI_PORT_STAT_ETHER_IN_PKTS_2048_TO_4095_OCTETS": "0",
"SAI_PORT_STAT_IP_OUT_NON_UCAST_PKTS": "0",
"SAI_PORT_STAT_ETHER_STATS_JABBERS": "0",
"SAI_PORT_STAT_IF_IN_OCTETS": "0",
"SAI_PORT_STAT_IPV6_IN_MCAST_PKTS": "0",
"SAI_PORT_STAT_ETHER_STATS_PKTS_65_TO_127_OCTETS": "0",
"SAI_PORT_STAT_IF_OUT_QLEN": "0",
"SAI_PORT_STAT_ETHER_STATS_PKTS_128_TO_255_OCTETS": "0",
"SAI_PORT_STAT_IP_IN_DISCARDS": "0",
"SAI_PORT_STAT_IPV6_OUT_OCTETS": "0",
"SAI_PORT_STAT_IF_OUT_NON_UCAST_PKTS": "0",
"SAI_PORT_STAT_IP_IN_OCTETS": "0",
"SAI_PORT_STAT_ETHER_OUT_PKTS_256_TO_511_OCTETS": "0",
"SAI_PORT_STAT_ETHER_STATS_CRC_ALIGN_ERRORS": "0",
"SAI_PORT_STAT_IP_OUT_UCAST_PKTS": "0",
"SAI_PORT_STAT_IP_IN_UCAST_PKTS": "0",
"SAI_PORT_STAT_ETHER_STATS_MULTICAST_PKTS": "0",
"SAI_PORT_STAT_ETHER_IN_PKTS_128_TO_255_OCTETS": "0",
"SAI_PORT_STAT_IF_IN_MULTICAST_PKTS": "0",
"SAI_PORT_STAT_PAUSE_RX_PKTS": "0",
"SAI_PORT_STAT_PAUSE_TX_PKTS": "0",
"SAI_PORT_STAT_PFC_0_RX_PKTS": "1",
"SAI_PORT_STAT_PFC_0_TX_PKTS": "1",
"SAI_PORT_STAT_PFC_1_RX_PKTS": "2",
"SAI_PORT_STAT_PFC_1_TX_PKTS": "2",
"SAI_PORT_STAT_PFC_2_RX_PKTS": "3",
"SAI_PORT_STAT_PFC_2_TX_PKTS": "3",
"SAI_PORT_STAT_PFC_3_RX_PKTS": "4",
"SAI_PORT_STAT_PFC_3_TX_PKTS": "4",
"SAI_PORT_STAT_PFC_4_RX_PKTS": "5",
"SAI_PORT_STAT_PFC_4_TX_PKTS": "5",
"SAI_PORT_STAT_PFC_5_RX_PKTS": "6",
"SAI_PORT_STAT_PFC_5_TX_PKTS": "6",
"SAI_PORT_STAT_PFC_6_RX_PKTS": "7",
"SAI_PORT_STAT_PFC_6_TX_PKTS": "7",
"SAI_PORT_STAT_PFC_7_RX_PKTS": "8",
"SAI_PORT_STAT_PFC_7_TX_PKTS": "8"
},
"COUNTERS:oid:0x100000000000f": {
"SAI_PORT_STAT_ETHER_STATS_TX_NO_ERRORS": "0",
"SAI_PORT_STAT_ETHER_STATS_OVERSIZE_PKTS": "0",
Expand Down Expand Up @@ -2175,6 +2277,9 @@
"Ethernet20": "oid:0x1000000000015",
"Ethernet68": "oid:0x1000000000020"
},
"COUNTERS_LAG_NAME_MAP": {
"PortChannel01": "oid:0x1000000000023"
},
"COUNTERS:oid:0x1000000000009": {
"SAI_PORT_STAT_ETHER_STATS_TX_NO_ERRORS": "0",
"SAI_PORT_STAT_ETHER_STATS_OVERSIZE_PKTS": "0",
Expand Down

0 comments on commit 02dc2ce

Please sign in to comment.