diff --git a/src/sonic_ax_impl/mibs/__init__.py b/src/sonic_ax_impl/mibs/__init__.py index 7e199644cd4b..e4996146a0f9 100644 --- a/src/sonic_ax_impl/mibs/__init__.py +++ b/src/sonic_ax_impl/mibs/__init__.py @@ -1,7 +1,9 @@ import pprint import re +import os from swsssdk import SonicV2Connector +from swsssdk import SonicDBConfig from swsssdk import port_util from swsssdk.port_util import get_index, get_index_from_str from ax_interface.mib import MIBUpdater @@ -148,7 +150,7 @@ def init_db(): """ # SyncD database connector. THIS MUST BE INITIALIZED ON A PER-THREAD BASIS. # Redis PubSub objects (such as those within swsssdk) are NOT thread-safe. - db_conn = SonicV2Connector(**redis_kwargs) + db_conn = SonicV2Connector(**redis_kwargs) return db_conn @@ -182,8 +184,6 @@ 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). @@ -196,9 +196,12 @@ def init_sync_d_interface_tables(db_conn): # { if_name (SONiC) -> sai_id } # ex: { "Ethernet76" : "1000000000023" } if_name_map, if_id_map = port_util.get_interface_oid_map(db_conn) - if_name_map = {if_name: sai_id for if_name, sai_id in if_name_map.items() if re.match(port_util.SONIC_ETHERNET_RE_PATTERN, if_name.decode())} - if_id_map = {sai_id: if_name for sai_id, if_name in if_id_map.items() if re.match(port_util.SONIC_ETHERNET_RE_PATTERN, if_name.decode())} - + if_name_map = {if_name: sai_id for if_name, sai_id in if_name_map.items() if \ + (re.match(port_util.SONIC_ETHERNET_RE_PATTERN, if_name.decode()) or \ + re.match(port_util.SONIC_ETHERNET_BP_RE_PATTERN, if_name.decode()))} + if_id_map = {sai_id: if_name for sai_id, if_name in if_id_map.items() if \ + (re.match(port_util.SONIC_ETHERNET_RE_PATTERN, if_name.decode()) or \ + re.match(port_util.SONIC_ETHERNET_BP_RE_PATTERN, if_name.decode()))} logger.debug("Port name map:\n" + pprint.pformat(if_name_map, indent=2)) logger.debug("Interface name map:\n" + pprint.pformat(if_id_map, indent=2)) @@ -241,7 +244,6 @@ def init_sync_d_interface_tables(db_conn): return if_name_map, if_alias_map, if_id_map, oid_sai_map, oid_name_map - def init_sync_d_lag_tables(db_conn): """ Helper method. Connects to and initializes LAG interface maps for SyncD-connected MIB(s). @@ -391,7 +393,7 @@ class RedisOidTreeUpdater(MIBUpdater): def __init__(self, prefix_str): super().__init__() - self.db_conn = init_db() + self.db_conn = Namespace.init_namespace_dbs() if prefix_str.startswith('.'): prefix_str = prefix_str[1:] self.prefix_str = prefix_str @@ -417,8 +419,7 @@ def update_data(self): self.oid_list = [] self.oid_map = {} - self.db_conn.connect(SNMP_OVERLAY_DB) - keys = self.db_conn.keys(SNMP_OVERLAY_DB, self.prefix_str + '*') + keys = Namespace.dbs_keys(self.db_conn, SNMP_OVERLAY_DB, self.prefix_str + '*') # TODO: fix db_conn.keys to return empty list instead of None if there is no match if keys is None: keys = [] @@ -427,7 +428,7 @@ def update_data(self): key = key.decode() oid = oid2tuple(key, dot_prefix=False) self.oid_list.append(oid) - value = self.db_conn.get_all(SNMP_OVERLAY_DB, key) + value = Namespace.dbs_get_all(self.db_conn, SNMP_OVERLAY_DB, key) if value[b'type'] in [b'COUNTER_32', b'COUNTER_64']: self.oid_map[oid] = int(value[b'data']) else: @@ -439,3 +440,134 @@ def get_oidvalue(self, oid): if oid not in self.oid_map: return None return self.oid_map[oid] + +class Namespace: + @staticmethod + def init_namespace_dbs(): + db_conn= [] + SonicDBConfig.load_sonic_global_db_config() + for namespace in SonicDBConfig.get_ns_list(): + db = SonicV2Connector(use_unix_socket_path=True, namespace=namespace) + db_conn.append(db) + + return db_conn + + @staticmethod + def connect_all_dbs(dbs, db_name): + for db_conn in dbs: + db_conn.connect(db_name) + + @staticmethod + def dbs_keys(dbs, db_name, pattern='*'): + """ + db keys function execute on global and all namespace DBs. + """ + result_keys=[] + for db_conn in dbs: + db_conn.connect(db_name) + keys = db_conn.keys(db_name, pattern) + if keys is not None: + result_keys.extend(keys) + return result_keys + + @staticmethod + def dbs_get_all(dbs, db_name, _hash, *args, **kwargs): + """ + db get_all function executed on global and all namespace DBs. + """ + result = {} + for db_conn in dbs: + db_conn.connect(db_name) + if(db_conn.exists(db_name, _hash)): + ns_result = db_conn.get_all(db_name, _hash, *args, **kwargs) + if ns_result is not None: + result.update(ns_result) + return result + + @staticmethod + def get_non_host_dbs(dbs): + """ + From the list of all dbs, return the list of dbs + which will have interface related tables. + For single namespace db, return the single db. + For multiple namespace dbs, return all dbs except the + host namespace db which is the first db in the list. + """ + if len(dbs) == 1: + return dbs + else: + return dbs[1:] + + + @staticmethod + def init_namespace_sync_d_interface_tables(dbs): + if_name_map = {} + if_alias_map = {} + if_id_map = {} + oid_sai_map = {} + oid_name_map = {} + + """ + all_ns_db - will have db_conn to all namespace DBs and + global db. First db in the list is global db. + Ignore first global db to get interface tables if there + are multiple namespaces. + """ + for db_conn in Namespace.get_non_host_dbs(dbs): + if_name_map_ns, \ + if_alias_map_ns, \ + if_id_map_ns, \ + oid_sai_map_ns, \ + oid_name_map_ns = init_sync_d_interface_tables(db_conn) + if_name_map.update(if_name_map_ns) + if_alias_map.update(if_alias_map_ns) + if_id_map.update(if_id_map_ns) + oid_sai_map.update(oid_sai_map_ns) + oid_name_map.update(oid_name_map_ns) + + return if_name_map, if_alias_map, if_id_map, oid_sai_map, oid_name_map + + @staticmethod + def init_namespace_sync_d_lag_tables(dbs): + + lag_name_if_name_map = {} + if_name_lag_name_map = {} + oid_lag_name_map = {} + + """ + all_ns_db - will have db_conn to all namespace DBs and + global db. First db in the list is global db. + Ignore first global db to get lag tables if + there are multiple namespaces. + """ + for db_conn in Namespace.get_non_host_dbs(dbs): + lag_name_if_name_map_ns, \ + if_name_lag_name_map_ns, \ + oid_lag_name_map_ns = init_sync_d_lag_tables(db_conn) + lag_name_if_name_map.update(lag_name_if_name_map_ns) + if_name_lag_name_map.update(if_name_lag_name_map_ns) + oid_lag_name_map.update(oid_lag_name_map_ns) + + return lag_name_if_name_map, if_name_lag_name_map, oid_lag_name_map + + @staticmethod + def init_namespace_sync_d_queue_tables(dbs): + port_queues_map = {} + queue_stat_map = {} + port_queue_list_map = {} + + """ + all_ns_db - will have db_conn to all namespace DBs and + global db. First db in the list is global db. + Ignore first global db to get queue tables if there + are multiple namespaces. + """ + for db_conn in Namespace.get_non_host_dbs(dbs): + port_queues_map_ns, \ + queue_stat_map_ns, \ + port_queue_list_map_ns = init_sync_d_queue_tables(db_conn) + port_queues_map.update(port_queues_map_ns) + queue_stat_map.update(queue_stat_map_ns) + port_queue_list_map.update(port_queue_list_map_ns) + + return port_queues_map, queue_stat_map, port_queue_list_map diff --git a/src/sonic_ax_impl/mibs/ietf/rfc1213.py b/src/sonic_ax_impl/mibs/ietf/rfc1213.py index 30191656e018..c7dc2848fb6f 100644 --- a/src/sonic_ax_impl/mibs/ietf/rfc1213.py +++ b/src/sonic_ax_impl/mibs/ietf/rfc1213.py @@ -4,6 +4,7 @@ from bisect import bisect_right from sonic_ax_impl import mibs +from sonic_ax_impl.mibs import Namespace from ax_interface.mib import MIBMeta, ValueType, MIBUpdater, MIBEntry, SubtreeMIBEntry, OverlayAdpaterMIBEntry, OidMIBEntry from ax_interface.encodings import ObjectIdentifier from ax_interface.util import mac_decimals, ip2tuple_v4 @@ -93,7 +94,7 @@ def get_next(self, sub_id): class NextHopUpdater(MIBUpdater): def __init__(self): super().__init__() - self.db_conn = mibs.init_db() + self.db_conn = Namespace.init_namespace_dbs() self.nexthop_map = {} self.route_list = [] @@ -105,8 +106,7 @@ def update_data(self): self.nexthop_map = {} self.route_list = [] - self.db_conn.connect(mibs.APPL_DB) - route_entries = self.db_conn.keys(mibs.APPL_DB, "ROUTE_TABLE:*") + route_entries = Namespace.dbs_keys(self.db_conn, mibs.APPL_DB, "ROUTE_TABLE:*") if not route_entries: return @@ -115,7 +115,7 @@ def update_data(self): ipnstr = routestr[len("ROUTE_TABLE:"):] if ipnstr == "0.0.0.0/0": ipn = ipaddress.ip_network(ipnstr) - ent = self.db_conn.get_all(mibs.APPL_DB, routestr, blocking=True) + ent = Namespace.dbs_get_all(self.db_conn, mibs.APPL_DB, routestr, blocking=True) nexthops = ent[b"nexthop"].decode() for nh in nexthops.split(','): # TODO: if ipn contains IP range, create more sub_id here @@ -152,7 +152,7 @@ class InterfacesUpdater(MIBUpdater): def __init__(self): super().__init__() - self.db_conn = mibs.init_db() + self.db_conn = Namespace.init_namespace_dbs() self.lag_name_if_name_map = {} self.if_name_lag_name_map = {} @@ -177,10 +177,14 @@ def reinit_data(self): self.if_alias_map, \ self.if_id_map, \ self.oid_sai_map, \ - self.oid_name_map = mibs.init_sync_d_interface_tables(self.db_conn) - + self.oid_name_map = Namespace.init_namespace_sync_d_interface_tables(self.db_conn) + """ + db_conn - will have db_conn to all namespace DBs and + global db. First db in the list is global db. + Use first global db to get management interface table. + """ self.mgmt_oid_name_map, \ - self.mgmt_alias_map = mibs.init_mgmt_interface_tables(self.db_conn) + self.mgmt_alias_map = mibs.init_mgmt_interface_tables(self.db_conn[0]) def update_data(self): """ @@ -188,12 +192,12 @@ def update_data(self): Pulls the table references for each interface. """ self.if_counters = \ - {sai_id: self.db_conn.get_all(mibs.COUNTERS_DB, mibs.counter_table(sai_id), blocking=True) - for sai_id in self.if_id_map} + {sai_id: Namespace.dbs_get_all(self.db_conn, mibs.COUNTERS_DB, mibs.counter_table(sai_id), blocking=True) + for sai_id in self.if_id_map} self.lag_name_if_name_map, \ self.if_name_lag_name_map, \ - self.oid_lag_name_map = mibs.init_sync_d_lag_tables(self.db_conn) + self.oid_lag_name_map = Namespace.init_namespace_sync_d_lag_tables(self.db_conn) self.if_range = sorted(list(self.oid_sai_map.keys()) + list(self.oid_lag_name_map.keys()) + @@ -318,7 +322,7 @@ def _get_if_entry(self, sub_id): else: return None - return self.db_conn.get_all(db, if_table, blocking=True) + return Namespace.dbs_get_all(self.db_conn, db, if_table, blocking=True) def _get_if_entry_state_db(self, sub_id): """ @@ -337,7 +341,7 @@ def _get_if_entry_state_db(self, sub_id): else: return None - return self.db_conn.get_all(db, if_table, blocking=False) + return Namespace.dbs_get_all(self.db_conn, db, if_table, blocking=False) def _get_status(self, sub_id, key): """ diff --git a/src/sonic_ax_impl/mibs/ietf/rfc2863.py b/src/sonic_ax_impl/mibs/ietf/rfc2863.py index 0da476455dd1..ec575e7d0d80 100644 --- a/src/sonic_ax_impl/mibs/ietf/rfc2863.py +++ b/src/sonic_ax_impl/mibs/ietf/rfc2863.py @@ -3,6 +3,7 @@ from sonic_ax_impl import mibs from ax_interface.mib import MIBMeta, MIBUpdater, ValueType, SubtreeMIBEntry, OverlayAdpaterMIBEntry, OidMIBEntry +from sonic_ax_impl.mibs import Namespace @unique class DbTables32(int, Enum): @@ -47,7 +48,7 @@ class InterfaceMIBUpdater(MIBUpdater): def __init__(self): super().__init__() - self.db_conn = mibs.init_db() + self.db_conn = Namespace.init_namespace_dbs() self.lag_name_if_name_map = {} self.if_name_lag_name_map = {} @@ -74,14 +75,18 @@ def reinit_data(self): self.if_alias_map, \ self.if_id_map, \ self.oid_sai_map, \ - self.oid_name_map = mibs.init_sync_d_interface_tables(self.db_conn) + self.oid_name_map = Namespace.init_namespace_sync_d_interface_tables(self.db_conn) self.lag_name_if_name_map, \ self.if_name_lag_name_map, \ - self.oid_lag_name_map = mibs.init_sync_d_lag_tables(self.db_conn) - + self.oid_lag_name_map = Namespace.init_namespace_sync_d_lag_tables(self.db_conn) + """ + db_conn - will have db_conn to all namespace DBs and + global db. First db in the list is global db. + Use first global db to get management interface table. + """ self.mgmt_oid_name_map, \ - self.mgmt_alias_map = mibs.init_mgmt_interface_tables(self.db_conn) + self.mgmt_alias_map = mibs.init_mgmt_interface_tables(self.db_conn[0]) self.if_range = sorted(list(self.oid_sai_map.keys()) + list(self.oid_lag_name_map.keys()) + @@ -94,7 +99,7 @@ def update_data(self): Pulls the table references for each interface. """ self.if_counters = { - sai_id: self.db_conn.get_all(mibs.COUNTERS_DB, mibs.counter_table(sai_id), blocking=True) + sai_id: Namespace.dbs_get_all(self.db_conn, mibs.COUNTERS_DB, mibs.counter_table(sai_id), blocking=True) for sai_id in self.if_id_map} @@ -217,7 +222,7 @@ def _get_if_entry(self, sub_id): else: return None - return self.db_conn.get_all(db, if_table, blocking=True) + return Namespace.dbs_get_all(self.db_conn, db, if_table, blocking=True) def get_high_speed(self, sub_id): """ diff --git a/src/sonic_ax_impl/mibs/ietf/rfc4292.py b/src/sonic_ax_impl/mibs/ietf/rfc4292.py index 36e3041f3725..c004338bb61f 100644 --- a/src/sonic_ax_impl/mibs/ietf/rfc4292.py +++ b/src/sonic_ax_impl/mibs/ietf/rfc4292.py @@ -1,6 +1,7 @@ import ipaddress from sonic_ax_impl import mibs +from sonic_ax_impl.mibs import Namespace from ax_interface import MIBMeta, ValueType, MIBUpdater, SubtreeMIBEntry from ax_interface.util import ip2tuple_v4 from bisect import bisect_right @@ -9,7 +10,7 @@ class RouteUpdater(MIBUpdater): def __init__(self): super().__init__() self.tos = 0 # ipCidrRouteTos - self.db_conn = mibs.init_db() + self.db_conn = Namespace.init_namespace_dbs() self.route_dest_map = {} self.route_dest_list = [] ## loopback ip string -> ip address object @@ -21,8 +22,7 @@ def reinit_data(self): """ self.loips = {} - self.db_conn.connect(mibs.APPL_DB) - loopbacks = self.db_conn.keys(mibs.APPL_DB, "INTF_TABLE:lo:*") + loopbacks = Namespace.dbs_keys(self.db_conn, mibs.APPL_DB, "INTF_TABLE:lo:*") if not loopbacks: return @@ -49,8 +49,7 @@ def update_data(self): self.route_dest_list.append(sub_id) self.route_dest_map[sub_id] = self.loips[loip].packed - self.db_conn.connect(mibs.APPL_DB) - route_entries = self.db_conn.keys(mibs.APPL_DB, "ROUTE_TABLE:*") + route_entries = Namespace.dbs_keys(self.db_conn, mibs.APPL_DB, "ROUTE_TABLE:*") if not route_entries: return @@ -59,7 +58,7 @@ def update_data(self): ipnstr = routestr[len("ROUTE_TABLE:"):] if ipnstr == "0.0.0.0/0": ipn = ipaddress.ip_network(ipnstr) - ent = self.db_conn.get_all(mibs.APPL_DB, routestr, blocking=True) + ent = Namespace.dbs_get_all(self.db_conn, mibs.APPL_DB, routestr, blocking=True) nexthops = ent[b"nexthop"].decode() ifnames = ent[b"ifname"].decode() for nh, ifn in zip(nexthops.split(','), ifnames.split(',')): diff --git a/src/sonic_ax_impl/mibs/vendor/cisco/ciscoPfcExtMIB.py b/src/sonic_ax_impl/mibs/vendor/cisco/ciscoPfcExtMIB.py index d42f60225a07..7661016c4013 100644 --- a/src/sonic_ax_impl/mibs/vendor/cisco/ciscoPfcExtMIB.py +++ b/src/sonic_ax_impl/mibs/vendor/cisco/ciscoPfcExtMIB.py @@ -2,6 +2,7 @@ from bisect import bisect_right from sonic_ax_impl import mibs +from sonic_ax_impl.mibs import Namespace from ax_interface import MIBMeta, ValueType, MIBUpdater, MIBEntry, SubtreeMIBEntry from ax_interface.encodings import ObjectIdentifier @@ -11,7 +12,7 @@ class PfcUpdater(MIBUpdater): """ def __init__(self): super().__init__() - self.db_conn = mibs.init_db() + self.db_conn = Namespace.init_namespace_dbs() self.if_name_map = {} self.if_alias_map = {} @@ -35,7 +36,7 @@ def reinit_data(self): self.if_alias_map, \ self.if_id_map, \ self.oid_sai_map, \ - self.oid_name_map = mibs.init_sync_d_interface_tables(self.db_conn) + self.oid_name_map = Namespace.init_namespace_sync_d_interface_tables(self.db_conn) self.update_data() @@ -45,12 +46,12 @@ def update_data(self): Pulls the table references for each interface. """ self.if_counters = \ - {sai_id: self.db_conn.get_all(mibs.COUNTERS_DB, mibs.counter_table(sai_id), blocking=True) + {sai_id: Namespace.dbs_get_all(self.db_conn, mibs.COUNTERS_DB, mibs.counter_table(sai_id), blocking=True) for sai_id in self.if_id_map} self.lag_name_if_name_map, \ self.if_name_lag_name_map, \ - self.oid_lag_name_map = mibs.init_sync_d_lag_tables(self.db_conn) + self.oid_lag_name_map = Namespace.init_namespace_sync_d_lag_tables(self.db_conn) self.if_range = sorted(list(self.oid_sai_map.keys()) + list(self.oid_lag_name_map.keys())) self.if_range = [(i,) for i in self.if_range] diff --git a/src/sonic_ax_impl/mibs/vendor/cisco/ciscoSwitchQosMIB.py b/src/sonic_ax_impl/mibs/vendor/cisco/ciscoSwitchQosMIB.py index d3a4393d59f0..274b7169514c 100644 --- a/src/sonic_ax_impl/mibs/vendor/cisco/ciscoSwitchQosMIB.py +++ b/src/sonic_ax_impl/mibs/vendor/cisco/ciscoSwitchQosMIB.py @@ -3,6 +3,7 @@ from bisect import bisect_right from sonic_ax_impl import mibs +from sonic_ax_impl.mibs import Namespace from ax_interface import MIBMeta, ValueType, MIBUpdater, MIBEntry, SubtreeMIBEntry from ax_interface.encodings import ObjectIdentifier @@ -44,7 +45,7 @@ def __init__(self): init the updater """ super().__init__() - self.db_conn = mibs.init_db() + self.db_conn = Namespace.init_namespace_dbs() self.lag_name_if_name_map = {} self.if_name_lag_name_map = {} self.oid_lag_name_map = {} @@ -73,12 +74,12 @@ def reinit_data(self): self.if_alias_map, \ self.if_id_map, \ self.oid_sai_map, \ - self.oid_name_map = mibs.init_sync_d_interface_tables(self.db_conn) + self.oid_name_map = Namespace.init_namespace_sync_d_interface_tables(self.db_conn) self.port_queues_map, self.queue_stat_map, self.port_queue_list_map = \ - mibs.init_sync_d_queue_tables(self.db_conn) + Namespace.init_namespace_sync_d_queue_tables(self.db_conn) - self.queue_type_map = self.db_conn.get_all(mibs.COUNTERS_DB, "COUNTERS_QUEUE_TYPE_MAP", blocking=False) + self.queue_type_map = Namespace.dbs_get_all(self.db_conn, mibs.COUNTERS_DB, "COUNTERS_QUEUE_TYPE_MAP", blocking=False) self.update_data() @@ -89,7 +90,7 @@ def update_data(self): """ for queue_key, sai_id in self.port_queues_map.items(): queue_stat_name = mibs.queue_table(sai_id) - queue_stat = self.db_conn.get_all(mibs.COUNTERS_DB, queue_stat_name, blocking=False) + queue_stat = Namespace.dbs_get_all(self.db_conn, mibs.COUNTERS_DB, queue_stat_name, blocking=False) if queue_stat is not None: self.queue_stat_map[queue_stat_name] = queue_stat diff --git a/tests/mock_tables/asic0/appl_db.json b/tests/mock_tables/asic0/appl_db.json new file mode 100644 index 000000000000..b396879aec3f --- /dev/null +++ b/tests/mock_tables/asic0/appl_db.json @@ -0,0 +1,90 @@ +{ + "LLDP_ENTRY_TABLE:Ethernet0": { + "lldp_rem_port_id_subtype": "5", + "lldp_rem_sys_cap_supported": "28 00", + "lldp_rem_index": "1", + "lldp_rem_chassis_id": "00:11:22:33:44:55", + "lldp_rem_sys_desc": "I'm a little teapot.", + "lldp_rem_time_mark": "18545", + "lldp_rem_sys_cap_enabled": "28 00", + "lldp_rem_port_desc": " ", + "lldp_rem_chassis_id_subtype": "4", + "lldp_rem_sys_name": "switch13", + "lldp_rem_port_id": "Ethernet1", + "lldp_rem_man_addr": "10.224.25.100" + }, + "LLDP_ENTRY_TABLE:Ethernet4": { + "lldp_rem_port_id_subtype": "5", + "lldp_rem_sys_cap_supported": "28 00", + "lldp_rem_index": "1", + "lldp_rem_chassis_id": "00:11:22:33:44:55", + "lldp_rem_sys_desc": "I'm a little teapot.", + "lldp_rem_time_mark": "18543", + "lldp_rem_sys_cap_enabled": "28 00", + "lldp_rem_port_desc": " ", + "lldp_rem_chassis_id_subtype": "4", + "lldp_rem_sys_name": "switch13", + "lldp_rem_port_id": "Ethernet2", + "lldp_rem_man_addr": "fe80::268a:7ff:fe3f:834c" + }, + "PORT_TABLE:Ethernet0": { + "description": "snowflake", + "alias": "etp1", + "speed": 100000 + }, + "PORT_TABLE:Ethernet4": { + "description": "snowflake", + "alias": "etp2", + "speed": 100000 + }, + "PORT_TABLE:Ethernet-BP0": { + "description": "snowflake", + "alias": "etp3", + "speed": 100000 + }, + "PORT_TABLE:Ethernet-BP4": { + "description": "snowflake", + "alias": "etp4", + "speed": 100000 + }, + "ROUTE_TABLE:0.0.0.0/0": { + "ifname": "Ethernet0,Ethernet4", + "nexthop": "10.0.0.1,10.0.0.3" + }, + "ROUTE_TABLE:10.1.0.32": { + "nexthop": "", + "ifname": "lo" + }, + "ROUTE_TABLE:fc00:1::32": { + "nexthop": "", + "ifname": "lo" + }, + "LAG_MEMBER_TABLE:PortChannel01:Ethernet-BP0": { + "status": "enabled" + }, + "LAG_MEMBER_TABLE:PortChannel01:Ethernet-BP4": { + "status": "enabled" + }, + "LAG_TABLE:PortChannel01": { + "admin_status": "up", + "oper_status": "up", + "mtu": "9216" + }, + "LAG_TABLE:PortChannel_Temp": { + "admin_status": "up", + "oper_status": "up", + "mtu": "9216" + }, + "INTF_TABLE:lo:10.1.0.32/32": { + "scope": "global", + "family": "IPv4" + }, + "INTF_TABLE:lo:fc00:1::32/128": { + "scope": "global", + "family": "IPv6" + }, + "INTF_TABLE:PortChannel01:10.10.0.1/31": { + "scope": "global", + "family": "IPv4" + } +} diff --git a/tests/mock_tables/asic0/asic_db.json b/tests/mock_tables/asic0/asic_db.json new file mode 100644 index 000000000000..2c63c0851048 --- /dev/null +++ b/tests/mock_tables/asic0/asic_db.json @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/mock_tables/asic0/config_db.json b/tests/mock_tables/asic0/config_db.json new file mode 100644 index 000000000000..2c63c0851048 --- /dev/null +++ b/tests/mock_tables/asic0/config_db.json @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/mock_tables/asic0/counters_db.json b/tests/mock_tables/asic0/counters_db.json new file mode 100644 index 000000000000..282a4b952fc6 --- /dev/null +++ b/tests/mock_tables/asic0/counters_db.json @@ -0,0 +1,844 @@ +{ + "COUNTERS:oid:0x1000000000007": { + "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:0x1000000000006": { + "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:0x1000000000005": { + "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_PORT_NAME_MAP": { + "Ethernet0": "oid:0x1000000000003", + "Ethernet4": "oid:0x1000000000004", + "Ethernet-BP0": "oid:0x1000000000005", + "Ethernet-BP4": "oid:0x1000000000006" + }, + "COUNTERS_LAG_NAME_MAP": { + "PortChannel01": "oid:0x1000000000007" + }, + "COUNTERS:oid:0x1000000000004": { + "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:0x1000000000003": { + "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": "209347219842134092490", + "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_QUEUE_NAME_MAP": { + "Ethernet0:0": "oid:0x15000000000230", + "Ethernet0:1": "oid:0x15000000000231", + "Ethernet0:2": "oid:0x15000000000232", + "Ethernet0:3": "oid:0x15000000000233", + "Ethernet0:4": "oid:0x15000000000234", + "Ethernet0:5": "oid:0x15000000000235", + "Ethernet0:6": "oid:0x15000000000236", + "Ethernet0:7": "oid:0x15000000000237", + "Ethernet0:8": "oid:0x15000000010230", + "Ethernet0:9": "oid:0x15000000010231", + "Ethernet0:10": "oid:0x15000000010232", + "Ethernet0:11": "oid:0x15000000010233", + "Ethernet0:12": "oid:0x15000000010234", + "Ethernet0:13": "oid:0x15000000010235", + "Ethernet0:14": "oid:0x15000000010236", + "Ethernet0:15": "oid:0x15000000010237", + "Ethernet4:0": "oid:0x15000000000240", + "Ethernet4:1": "oid:0x15000000000241", + "Ethernet4:2": "oid:0x15000000000242", + "Ethernet4:3": "oid:0x15000000000243", + "Ethernet4:4": "oid:0x15000000000244", + "Ethernet4:5": "oid:0x15000000000245", + "Ethernet4:6": "oid:0x15000000000246", + "Ethernet4:7": "oid:0x15000000000247", + "Ethernet4:8": "oid:0x15000000010240", + "Ethernet4:9": "oid:0x15000000010241", + "Ethernet4:10": "oid:0x15000000010242", + "Ethernet4:11": "oid:0x15000000010243", + "Ethernet4:12": "oid:0x15000000010244", + "Ethernet4:13": "oid:0x15000000010245", + "Ethernet4:14": "oid:0x15000000010246", + "Ethernet4:15": "oid:0x15000000010247" + }, + "COUNTERS_QUEUE_TYPE_MAP": { + "oid:0x15000000000230": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000231": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000232": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000233": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000234": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000235": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000236": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000237": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000240": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000241": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000242": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000243": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000244": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000245": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000246": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000247": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000010230": "SAI_QUEUE_TYPE_MULTICAST", + "oid:0x15000000010231": "SAI_QUEUE_TYPE_MULTICAST", + "oid:0x15000000010232": "SAI_QUEUE_TYPE_MULTICAST", + "oid:0x15000000010233": "SAI_QUEUE_TYPE_MULTICAST", + "oid:0x15000000010234": "SAI_QUEUE_TYPE_MULTICAST", + "oid:0x15000000010235": "SAI_QUEUE_TYPE_MULTICAST", + "oid:0x15000000010236": "SAI_QUEUE_TYPE_MULTICAST", + "oid:0x15000000010237": "SAI_QUEUE_TYPE_MULTICAST", + "oid:0x15000000010240": "SAI_QUEUE_TYPE_MULTICAST", + "oid:0x15000000010241": "SAI_QUEUE_TYPE_MULTICAST", + "oid:0x15000000010242": "SAI_QUEUE_TYPE_MULTICAST", + "oid:0x15000000010243": "SAI_QUEUE_TYPE_MULTICAST", + "oid:0x15000000010244": "SAI_QUEUE_TYPE_MULTICAST", + "oid:0x15000000010245": "SAI_QUEUE_TYPE_MULTICAST", + "oid:0x15000000010246": "SAI_QUEUE_TYPE_MULTICAST", + "oid:0x15000000010247": "SAI_QUEUE_TYPE_MULTICAST" + }, + "COUNTERS:oid:0x15000000000230": { + "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:0x15000000000231": { + "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:0x15000000000232": { + "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:0x15000000000233": { + "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:0x15000000000234": { + "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:0x15000000000235": { + "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:0x15000000000236": { + "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:0x15000000000237": { + "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:0x15000000000240": { + "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:0x15000000000241": { + "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:0x15000000000242": { + "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:0x15000000000243": { + "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:0x15000000000244": { + "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:0x15000000000245": { + "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:0x15000000000246": { + "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:0x15000000000247": { + "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:0x15000000010230": { + "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:0x15000000010231": { + "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:0x15000000010232": { + "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:0x15000000010233": { + "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:0x15000000010234": { + "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:0x15000000010235": { + "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:0x15000000010236": { + "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:0x15000000010237": { + "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:0x15000000010240": { + "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:0x15000000010241": { + "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:0x15000000010242": { + "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:0x15000000010243": { + "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:0x15000000010244": { + "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:0x15000000010245": { + "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:0x15000000010246": { + "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:0x15000000010247": { + "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" + }} diff --git a/tests/mock_tables/asic0/database_config.json b/tests/mock_tables/asic0/database_config.json new file mode 100644 index 000000000000..bb32e109b7e0 --- /dev/null +++ b/tests/mock_tables/asic0/database_config.json @@ -0,0 +1,57 @@ +{ + "INSTANCES": { + "redis":{ + "hostname" : "127.0.0.1", + "port" : 6379, + "unix_socket_path" : "/var/run/redis/redis.sock" + } + }, + "DATABASES" : { + "APPL_DB" : { + "id" : 0, + "separator": ":", + "instance" : "redis" + }, + "ASIC_DB" : { + "id" : 1, + "separator": ":", + "instance" : "redis" + }, + "COUNTERS_DB" : { + "id" : 2, + "separator": ":", + "instance" : "redis" + }, + "LOGLEVEL_DB" : { + "id" : 3, + "separator": ":", + "instance" : "redis" + }, + "CONFIG_DB" : { + "id" : 4, + "separator": "|", + "instance" : "redis" + }, + "PFC_WD_DB" : { + "id" : 5, + "separator": ":", + "instance" : "redis" + }, + "FLEX_COUNTER_DB" : { + "id" : 5, + "separator": ":", + "instance" : "redis" + }, + "STATE_DB" : { + "id" : 6, + "separator": "|", + "instance" : "redis" + }, + "SNMP_OVERLAY_DB" : { + "id" : 7, + "separator": "|", + "instance" : "redis" + } + }, + "VERSION" : "1.1" +} diff --git a/tests/mock_tables/asic0/snmp_overlay_db.json b/tests/mock_tables/asic0/snmp_overlay_db.json new file mode 100644 index 000000000000..a8f10b870971 --- /dev/null +++ b/tests/mock_tables/asic0/snmp_overlay_db.json @@ -0,0 +1,10 @@ +{ + "1.3.6.1.2.1.2.2.1.10.1": { + "type": "COUNTER_32", + "data": "54321" + }, + "1.3.6.1.2.1.31.1.1.1.6.5": { + "type": "COUNTER_64", + "data": "654321" + } +} diff --git a/tests/mock_tables/asic0/state_db.json b/tests/mock_tables/asic0/state_db.json new file mode 100644 index 000000000000..2c63c0851048 --- /dev/null +++ b/tests/mock_tables/asic0/state_db.json @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/mock_tables/asic1/appl_db.json b/tests/mock_tables/asic1/appl_db.json new file mode 100644 index 000000000000..6ba7d171d119 --- /dev/null +++ b/tests/mock_tables/asic1/appl_db.json @@ -0,0 +1,91 @@ +{ + "LLDP_ENTRY_TABLE:Ethernet8": { + "lldp_rem_port_id_subtype": "5", + "lldp_rem_sys_cap_supported": "28 00", + "lldp_rem_index": "1", + "lldp_rem_chassis_id": "00:11:22:33:44:55", + "lldp_rem_sys_desc": "I'm a little teapot.", + "lldp_rem_time_mark": "18543", + "lldp_rem_sys_cap_enabled": "28 00", + "lldp_rem_port_desc": " ", + "lldp_rem_chassis_id_subtype": "4", + "lldp_rem_sys_name": "switch13", + "lldp_rem_port_id": "Ethernet3", + "lldp_rem_man_addr": "fe80::268a:7ff:fe3f:834c" + }, + "LLDP_ENTRY_TABLE:Ethernet12": { + "lldp_rem_port_id_subtype": "5", + "lldp_rem_sys_cap_supported": "28 00", + "lldp_rem_index": "1", + "lldp_rem_chassis_id": "00:11:22:33:44:55", + "lldp_rem_sys_desc": "I'm a little teapot.", + "lldp_rem_time_mark": "18543", + "lldp_rem_sys_cap_enabled": "28 00", + "lldp_rem_port_desc": " ", + "lldp_rem_chassis_id_subtype": "4", + "lldp_rem_sys_name": "switch13", + "lldp_rem_port_id": "Ethernet4", + "lldp_rem_man_addr": "10.224.25.102" + }, + "LLDP_LOC_CHASSIS": { + "lldp_loc_chassis_id_subtype": "5", + "lldp_loc_chassis_id": "00:11:22:AB:CD:EF", + "lldp_loc_sys_name": "SONiC", + "lldp_loc_sys_desc": "Gotta go Fast!", + "lldp_loc_sys_cap_enabled": "28 00", + "lldp_loc_sys_cap_supported": "28 00", + "lldp_loc_man_addr": "10.224.25.26,fe80::ce37:abff:feec:de9c" + }, + "PORT_TABLE:Ethernet8": { + "description": "snowflake", + "alias": "etp5", + "speed": 100000 + }, + "PORT_TABLE:Ethernet12": { + "speed": 1000, + "alias": "etp6" + }, + "PORT_TABLE:Ethernet-BP8": { + "alias": "etp7" + }, + "PORT_TABLE:Ethernet-BP12": { + "description": "snowflake", + "alias": "etp8", + "speed": 1000 + }, + "ROUTE_TABLE:0.0.0.0/0": { + "ifname": "Ethernet8,Ethernet12", + "nexthop": "10.0.0.7,10.0.0.9" + }, + "ROUTE_TABLE:10.2.0.32": { + "nexthop": "", + "ifname": "lo" + }, + "ROUTE_TABLE:fc00:1::32": { + "nexthop": "", + "ifname": "lo" + }, + "LAG_MEMBER_TABLE:PortChannel02:Ethernet-BP08": { + "status": "enabled" + }, + "LAG_MEMBER_TABLE:PortChannel02:Ethernet-BP12": { + "status": "enabled" + }, + "LAG_TABLE:PortChannel02": { + "admin_status": "up", + "oper_status": "up", + "mtu": "9216" + }, + "INTF_TABLE:lo:10.2.0.32/32": { + "scope": "global", + "family": "IPv4" + }, + "INTF_TABLE:lo:fc00:1::32/128": { + "scope": "global", + "family": "IPv6" + }, + "INTF_TABLE:PortChannel02:10.10.0.5/31": { + "scope": "global", + "family": "IPv4" + } +} diff --git a/tests/mock_tables/asic1/asic_db.json b/tests/mock_tables/asic1/asic_db.json new file mode 100644 index 000000000000..2c63c0851048 --- /dev/null +++ b/tests/mock_tables/asic1/asic_db.json @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/mock_tables/asic1/config_db.json b/tests/mock_tables/asic1/config_db.json new file mode 100644 index 000000000000..2c63c0851048 --- /dev/null +++ b/tests/mock_tables/asic1/config_db.json @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/mock_tables/asic1/counters_db.json b/tests/mock_tables/asic1/counters_db.json new file mode 100644 index 000000000000..cd56a10fe075 --- /dev/null +++ b/tests/mock_tables/asic1/counters_db.json @@ -0,0 +1,685 @@ +{ + "COUNTERS:oid:0x1000000000010": { + "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_PORT_NAME_MAP": { + "Ethernet8": "oid:0x1000000000009", + "Ethernet12": "oid:0x1000000000008", + "Ethernet-BP8": "oid:0x1000000000010", + "Ethernet-BP12": "oid:0x1000000000011" + }, + "COUNTERS_LAG_NAME_MAP": { + "PortChannel02": "oid:0x1000000000012" + }, + "COUNTERS:oid:0x1000000000009": { + "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": "209347219842134092490", + "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:0x1000000000008": { + "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_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:0x1000000000011": { + "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:0x1000000000012": { + "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_QUEUE_NAME_MAP": { + "Ethernet8:0": "oid:0x15000000000250", + "Ethernet8:1": "oid:0x15000000000251", + "Ethernet8:2": "oid:0x15000000000252", + "Ethernet8:3": "oid:0x15000000000253", + "Ethernet8:4": "oid:0x15000000000254", + "Ethernet8:5": "oid:0x15000000000255", + "Ethernet8:6": "oid:0x15000000000256", + "Ethernet8:7": "oid:0x15000000000257", + "Ethernet8:8": "oid:0x15000000010250", + "Ethernet8:9": "oid:0x15000000010251", + "Ethernet8:10": "oid:0x15000000010252", + "Ethernet8:11": "oid:0x15000000010253", + "Ethernet8:12": "oid:0x15000000010254", + "Ethernet8:13": "oid:0x15000000010255", + "Ethernet8:14": "oid:0x15000000010256", + "Ethernet8:15": "oid:0x15000000010257" + }, + "COUNTERS_QUEUE_TYPE_MAP": { + "oid:0x15000000000250": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000251": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000252": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000253": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000254": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000255": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000256": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000257": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000010250": "SAI_QUEUE_TYPE_MULTICAST", + "oid:0x15000000010251": "SAI_QUEUE_TYPE_MULTICAST", + "oid:0x15000000010252": "SAI_QUEUE_TYPE_MULTICAST", + "oid:0x15000000010253": "SAI_QUEUE_TYPE_MULTICAST", + "oid:0x15000000010254": "SAI_QUEUE_TYPE_MULTICAST", + "oid:0x15000000010255": "SAI_QUEUE_TYPE_MULTICAST", + "oid:0x15000000010256": "SAI_QUEUE_TYPE_MULTICAST", + "oid:0x15000000010257": "SAI_QUEUE_TYPE_MULTICAST" + }, + "COUNTERS:oid:0x15000000000250": { + "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:0x15000000000251": { + "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:0x15000000000252": { + "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:0x15000000000253": { + "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:0x15000000000254": { + "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:0x15000000000255": { + "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:0x15000000000256": { + "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:0x15000000000257": { + "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:0x15000000010250": { + "SAI_QUEUE_STAT_PACKETS": "10", + "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:0x15000000010251": { + "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:0x15000000010252": { + "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:0x15000000010253": { + "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:0x15000000010254": { + "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:0x15000000010255": { + "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:0x15000000010256": { + "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:0x15000000010257": { + "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" + }} diff --git a/tests/mock_tables/asic1/database_config.json b/tests/mock_tables/asic1/database_config.json new file mode 100644 index 000000000000..bb32e109b7e0 --- /dev/null +++ b/tests/mock_tables/asic1/database_config.json @@ -0,0 +1,57 @@ +{ + "INSTANCES": { + "redis":{ + "hostname" : "127.0.0.1", + "port" : 6379, + "unix_socket_path" : "/var/run/redis/redis.sock" + } + }, + "DATABASES" : { + "APPL_DB" : { + "id" : 0, + "separator": ":", + "instance" : "redis" + }, + "ASIC_DB" : { + "id" : 1, + "separator": ":", + "instance" : "redis" + }, + "COUNTERS_DB" : { + "id" : 2, + "separator": ":", + "instance" : "redis" + }, + "LOGLEVEL_DB" : { + "id" : 3, + "separator": ":", + "instance" : "redis" + }, + "CONFIG_DB" : { + "id" : 4, + "separator": "|", + "instance" : "redis" + }, + "PFC_WD_DB" : { + "id" : 5, + "separator": ":", + "instance" : "redis" + }, + "FLEX_COUNTER_DB" : { + "id" : 5, + "separator": ":", + "instance" : "redis" + }, + "STATE_DB" : { + "id" : 6, + "separator": "|", + "instance" : "redis" + }, + "SNMP_OVERLAY_DB" : { + "id" : 7, + "separator": "|", + "instance" : "redis" + } + }, + "VERSION" : "1.1" +} diff --git a/tests/mock_tables/asic1/snmp_overlay_db.json b/tests/mock_tables/asic1/snmp_overlay_db.json new file mode 100644 index 000000000000..2c63c0851048 --- /dev/null +++ b/tests/mock_tables/asic1/snmp_overlay_db.json @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/mock_tables/asic1/state_db.json b/tests/mock_tables/asic1/state_db.json new file mode 100644 index 000000000000..2c63c0851048 --- /dev/null +++ b/tests/mock_tables/asic1/state_db.json @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/mock_tables/asic2/appl_db.json b/tests/mock_tables/asic2/appl_db.json new file mode 100644 index 000000000000..a5070c8c2958 --- /dev/null +++ b/tests/mock_tables/asic2/appl_db.json @@ -0,0 +1,82 @@ +{ + "LLDP_LOC_CHASSIS": { + "lldp_loc_chassis_id_subtype": "5", + "lldp_loc_chassis_id": "00:11:22:AB:CD:EF", + "lldp_loc_sys_name": "SONiC", + "lldp_loc_sys_desc": "Gotta go Fast!", + "lldp_loc_sys_cap_enabled": "28 00", + "lldp_loc_sys_cap_supported": "28 00", + "lldp_loc_man_addr": "10.224.25.26,fe80::ce37:abff:feec:de9c" + }, + "PORT_TABLE:Ethernet-BP16": { + "description": "backplane", + "alias": "etp9", + "speed": 100000 + }, + "PORT_TABLE:Ethernet-BP20": { + "description": "backplane", + "alias": "etp10", + "speed": 100000 + }, + "PORT_TABLE:Ethernet-BP24": { + "description": "backplane", + "alias": "etp11", + "speed": 100000 + }, + "PORT_TABLE:Ethernet-BP28": { + "description": "backplane", + "alias": "etp12", + "speed": 100000 + }, + "ROUTE_TABLE:10.1.0.32": { + "nexthop": "", + "ifname": "lo" + }, + "ROUTE_TABLE:fc00:1::32": { + "nexthop": "", + "ifname": "lo" + }, + "LAG_MEMBER_TABLE:PortChannel03:Ethernet-BP16": { + "status": "enabled" + }, + "LAG_MEMBER_TABLE:PortChannel03:Ethernet-BP20": { + "status": "enabled" + }, + "LAG_MEMBER_TABLE:PortChannel04:Ethernet-BP24": { + "status": "enabled" + }, + "LAG_MEMBER_TABLE:PortChannel04:Ethernet-BP28": { + "status": "enabled" + }, + "LAG_TABLE:PortChannel03": { + "admin_status": "up", + "oper_status": "up", + "mtu": "9216" + }, + "LAG_TABLE:PortChannel04": { + "admin_status": "up", + "oper_status": "up", + "mtu": "9216" + }, + "LAG_TABLE:PortChannel_Temp": { + "admin_status": "up", + "oper_status": "up", + "mtu": "9216" + }, + "INTF_TABLE:lo:10.1.0.32/32": { + "scope": "global", + "family": "IPv4" + }, + "INTF_TABLE:lo:fc00:1::32/128": { + "scope": "global", + "family": "IPv6" + }, + "INTF_TABLE:PortChannel03:10.10.0.0/31": { + "scope": "global", + "family": "IPv4" + }, + "INTF_TABLE:PortChannel04:10.10.0.5/31": { + "scope": "global", + "family": "IPv4" + } +} diff --git a/tests/mock_tables/asic2/asic_db.json b/tests/mock_tables/asic2/asic_db.json new file mode 100644 index 000000000000..2c63c0851048 --- /dev/null +++ b/tests/mock_tables/asic2/asic_db.json @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/mock_tables/asic2/config_db.json b/tests/mock_tables/asic2/config_db.json new file mode 100644 index 000000000000..2c63c0851048 --- /dev/null +++ b/tests/mock_tables/asic2/config_db.json @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/mock_tables/asic2/counters_db.json b/tests/mock_tables/asic2/counters_db.json new file mode 100644 index 000000000000..20febebe6a7b --- /dev/null +++ b/tests/mock_tables/asic2/counters_db.json @@ -0,0 +1,779 @@ +{ + "COUNTERS:oid:0x1000000000018": { + "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": "4321", + "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": "209347219842134092490", + "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:0x1000000000013": { + "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:0x1000000000015": { + "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:0x1000000000014": { + "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:0x1000000000017": { + "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:0x1000000000016": { + "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": "40321", + "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_PORT_NAME_MAP": { + "Ethernet-BP16": "oid:0x1000000000013", + "Ethernet-BP20": "oid:0x1000000000014", + "Ethernet-BP24": "oid:0x1000000000015", + "Ethernet-BP28": "oid:0x1000000000016" + }, + "COUNTERS_LAG_NAME_MAP": { + "PortChannel03": "oid:0x1000000000017", + "PortChannel04": "oid:0x1000000000018" + }, + "COUNTERS_QUEUE_NAME_MAP": { + "Ethernet-BP16:0": "oid:0x15000000000330", + "Ethernet-BP16:1": "oid:0x15000000000331", + "Ethernet-BP16:2": "oid:0x15000000000332", + "Ethernet-BP16:3": "oid:0x15000000000333", + "Ethernet-BP16:4": "oid:0x15000000000334", + "Ethernet-BP16:5": "oid:0x15000000000335", + "Ethernet-BP16:6": "oid:0x15000000000336", + "Ethernet-BP16:7": "oid:0x15000000000337", + "Ethernet-BP16:8": "oid:0x15000000010330", + "Ethernet-BP16:9": "oid:0x15000000010331", + "Ethernet-BP16:10": "oid:0x15000000010332", + "Ethernet-BP16:11": "oid:0x15000000010333", + "Ethernet-BP16:12": "oid:0x15000000010334", + "Ethernet-BP16:13": "oid:0x15000000010335", + "Ethernet-BP16:14": "oid:0x15000000010336", + "Ethernet-BP16:15": "oid:0x15000000010337" + }, + "COUNTERS_QUEUE_TYPE_MAP": { + "oid:0x15000000000330": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000331": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000332": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000333": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000334": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000335": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000336": "SAI_QUEUE_TYPE_UNICAST", + "oid:0x15000000000337": "SAI_QUEUE_TYPE_UNICAST" + }, + "COUNTERS:oid:0x15000000000330": { + "SAI_QUEUE_STAT_PACKETS": "1", + "SAI_QUEUE_STAT_BYTES": "24", + "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:0x15000000000331": { + "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:0x15000000000332": { + "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:0x15000000000333": { + "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:0x15000000000334": { + "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:0x15000000000335": { + "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:0x15000000000336": { + "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:0x15000000000337": { + "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:0x15000000010330": { + "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:0x15000000010331": { + "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:0x15000000010332": { + "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:0x15000000010333": { + "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:0x15000000010334": { + "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:0x15000000010335": { + "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:0x15000000010336": { + "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:0x15000000010337": { + "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" + }} diff --git a/tests/mock_tables/asic2/database_config.json b/tests/mock_tables/asic2/database_config.json new file mode 100644 index 000000000000..bb32e109b7e0 --- /dev/null +++ b/tests/mock_tables/asic2/database_config.json @@ -0,0 +1,57 @@ +{ + "INSTANCES": { + "redis":{ + "hostname" : "127.0.0.1", + "port" : 6379, + "unix_socket_path" : "/var/run/redis/redis.sock" + } + }, + "DATABASES" : { + "APPL_DB" : { + "id" : 0, + "separator": ":", + "instance" : "redis" + }, + "ASIC_DB" : { + "id" : 1, + "separator": ":", + "instance" : "redis" + }, + "COUNTERS_DB" : { + "id" : 2, + "separator": ":", + "instance" : "redis" + }, + "LOGLEVEL_DB" : { + "id" : 3, + "separator": ":", + "instance" : "redis" + }, + "CONFIG_DB" : { + "id" : 4, + "separator": "|", + "instance" : "redis" + }, + "PFC_WD_DB" : { + "id" : 5, + "separator": ":", + "instance" : "redis" + }, + "FLEX_COUNTER_DB" : { + "id" : 5, + "separator": ":", + "instance" : "redis" + }, + "STATE_DB" : { + "id" : 6, + "separator": "|", + "instance" : "redis" + }, + "SNMP_OVERLAY_DB" : { + "id" : 7, + "separator": "|", + "instance" : "redis" + } + }, + "VERSION" : "1.1" +} diff --git a/tests/mock_tables/asic2/snmp_overlay_db.json b/tests/mock_tables/asic2/snmp_overlay_db.json new file mode 100644 index 000000000000..2c63c0851048 --- /dev/null +++ b/tests/mock_tables/asic2/snmp_overlay_db.json @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/mock_tables/asic2/state_db.json b/tests/mock_tables/asic2/state_db.json new file mode 100644 index 000000000000..2c63c0851048 --- /dev/null +++ b/tests/mock_tables/asic2/state_db.json @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/mock_tables/database_config.json b/tests/mock_tables/database_config.json new file mode 100644 index 000000000000..33fdeb2d7092 --- /dev/null +++ b/tests/mock_tables/database_config.json @@ -0,0 +1,57 @@ +{ + "INSTANCES": { + "redis": { + "hostname" : "127.0.0.1", + "port" : 6379, + "unix_socket_path" : "/var/run/redis/redis.sock" + } + }, + "DATABASES" : { + "APPL_DB" : { + "id" : 0, + "separator": ":", + "instance" : "redis" + }, + "ASIC_DB" : { + "id" : 1, + "separator": ":", + "instance" : "redis" + }, + "COUNTERS_DB" : { + "id" : 2, + "separator": ":", + "instance" : "redis" + }, + "LOGLEVEL_DB" : { + "id" : 3, + "separator": ":", + "instance" : "redis" + }, + "CONFIG_DB" : { + "id" : 4, + "separator": "|", + "instance" : "redis" + }, + "PFC_WD_DB" : { + "id" : 5, + "separator": ":", + "instance" : "redis" + }, + "FLEX_COUNTER_DB" : { + "id" : 5, + "separator": ":", + "instance" : "redis" + }, + "STATE_DB" : { + "id" : 6, + "separator": "|", + "instance" : "redis" + }, + "SNMP_OVERLAY_DB" : { + "id" : 7, + "separator": "|", + "instance" : "redis" + } + }, + "VERSION" : "1.1" +} diff --git a/tests/mock_tables/database_global.json b/tests/mock_tables/database_global.json new file mode 100644 index 000000000000..9cc8860de8b4 --- /dev/null +++ b/tests/mock_tables/database_global.json @@ -0,0 +1,20 @@ +{ + "INCLUDES" : [ + { + "include" : "database_config.json" + }, + { + "namespace" : "asic0", + "include" : "./asic0/database_config.json" + }, + { + "namespace" : "asic1", + "include" : "./asic1/database_config.json" + }, + { + "namespace" : "asic2", + "include" : "./asic2/database_config.json" + } + ], + "VERSION" : "1.0" +} diff --git a/tests/mock_tables/dbconnector.py b/tests/mock_tables/dbconnector.py index 6662168f0040..186e3193d5d8 100644 --- a/tests/mock_tables/dbconnector.py +++ b/tests/mock_tables/dbconnector.py @@ -6,7 +6,60 @@ import mockredis import swsssdk.interface from swsssdk.interface import redis - +from swsssdk import SonicV2Connector +from swsssdk import SonicDBConfig +import importlib + +def clean_up_config(): + # Set SonicDBConfig variables to initial state + # so that it can be loaded with single or multiple + # namespaces before the test begins. + SonicDBConfig._sonic_db_config = {} + SonicDBConfig._sonic_db_global_config_init = False + SonicDBConfig._sonic_db_config_init = False + +# TODO Convert this to fixture as all Test classes require it. +def load_namespace_config(): + # To support testing single namespace and multiple + # namespace scenario, SonicDBConfig load_sonic_global_db_config + # is invoked to load multiple namespaces to support multiple + # namespace testing. + clean_up_config() + SonicDBConfig.load_sonic_global_db_config( + global_db_file_path=os.path.join( + os.path.dirname(os.path.abspath(__file__)), 'database_global.json')) + +# TODO Convert this to fixture as all Test classes require it. +def load_database_config(): + # Load local database_config.json for single namespace test scenario + clean_up_config() + SonicDBConfig.load_sonic_db_config( + sonic_db_file_path=os.path.join( + os.path.dirname(os.path.abspath(__file__)), 'database_config.json')) + +def connect_SonicV2Connector(self, db_name, retry_on=True): + if self.use_unix_socket_path: + self.dbintf.redis_kwargs["unix_socket_path"] = self.get_db_socket(db_name) + self.dbintf.redis_kwargs["host"] = None + self.dbintf.redis_kwargs["port"] = None + else: + self.dbintf.redis_kwargs["host"] = self.get_db_hostname(db_name) + self.dbintf.redis_kwargs["port"] = self.get_db_port(db_name) + self.dbintf.redis_kwargs["unix_socket_path"] = None + + ns_list = SonicDBConfig.get_ns_list() + # In case of multiple namespaces, namespace string passed to + # SonicV2Connector will specify the namespace or can be empty. + # Empty namespace represents global or host namespace. + if len(ns_list) > 1 and self.namespace == "": + self.dbintf.redis_kwargs['namespace'] = "global_db" + else: + self.dbintf.redis_kwargs['namespace'] = self.namespace + # Mock DB filename for unit-test + self.dbintf.redis_kwargs["filename"] = db_name.lower() + ".json" + + db_id = self.get_dbid(db_name) + self.dbintf.connect(db_id, retry_on) def _subscribe_keyspace_notification(self, db_name, client): pass @@ -34,23 +87,17 @@ class SwssSyncClient(mockredis.MockRedis): def __init__(self, *args, **kwargs): super(SwssSyncClient, self).__init__(strict=True, *args, **kwargs) db = kwargs.pop('db') - if db == 0: - fname = 'appl_db.json' - elif db == 1: - fname = 'asic_db.json' - elif db == 2: - fname = 'counters_db.json' - elif db == 4: - fname = 'config_db.json' - elif db == 6: - fname = 'state_db.json' - elif db == 7: - fname = 'snmp_overlay_db.json' - else: - raise ValueError("Invalid db") + # Namespace is added in kwargs specifically for unit-test + # to identify the file path to load the db json files. + namespace = kwargs.pop('namespace') + fname = kwargs.pop('filename') self.pubsub = MockPubSub() - fname = os.path.join(INPUT_DIR, fname) + if namespace is not None: + fname = os.path.join(INPUT_DIR, namespace, fname) + else: + fname = os.path.join(INPUT_DIR, fname) + with open(fname) as f: js = json.load(f) for h, table in js.items(): @@ -84,3 +131,4 @@ def keys(self, pattern='*'): swsssdk.interface.DBInterface._subscribe_keyspace_notification = _subscribe_keyspace_notification mockredis.MockRedis.config_set = config_set redis.StrictRedis = SwssSyncClient +swsssdk.dbconnector.SonicV2Connector.connect = connect_SonicV2Connector diff --git a/tests/mock_tables/global_db/appl_db.json b/tests/mock_tables/global_db/appl_db.json new file mode 100644 index 000000000000..1b21a7b11a77 --- /dev/null +++ b/tests/mock_tables/global_db/appl_db.json @@ -0,0 +1,25 @@ +{ + "LLDP_ENTRY_TABLE:eth1": { + "lldp_rem_port_id_subtype": "5", + "lldp_rem_sys_cap_supported": "28 00", + "lldp_rem_index": "1", + "lldp_rem_chassis_id": "00:11:22:33:44:55", + "lldp_rem_sys_desc": "I'm a little teapot.", + "lldp_rem_time_mark": "4834", + "lldp_rem_sys_cap_enabled": "28 00", + "lldp_rem_port_desc": " ", + "lldp_rem_chassis_id_subtype": "4", + "lldp_rem_sys_name": "switch14", + "lldp_rem_port_id": "Ethernet0", + "lldp_rem_man_addr": "10.224.1.100" + }, + "LLDP_LOC_CHASSIS": { + "lldp_loc_chassis_id_subtype": "5", + "lldp_loc_chassis_id": "00:11:22:AB:CD:EF", + "lldp_loc_sys_name": "SONiC", + "lldp_loc_sys_desc": "Gotta go Fast!", + "lldp_loc_sys_cap_enabled": "28 00", + "lldp_loc_sys_cap_supported": "28 00", + "lldp_loc_man_addr": "10.224.25.26,fe80::ce37:abff:feec:de9c" + } +} diff --git a/tests/mock_tables/global_db/config_db.json b/tests/mock_tables/global_db/config_db.json new file mode 100644 index 000000000000..a61777fea344 --- /dev/null +++ b/tests/mock_tables/global_db/config_db.json @@ -0,0 +1,18 @@ +{ + "MGMT_PORT|eth0": { + "description": "snowflake", + "speed": 1000 + }, + "MGMT_PORT|eth1": { + "description": "snowflake", + "admin_status": "up", + "alias": "mgmt1", + "speed": 1000 + }, + "MGMT_PORT|eth2": { + "description": "NotExistInStateDB", + "admin_status": "up", + "alias": "mgmt2", + "speed": 1000 + } +} diff --git a/tests/mock_tables/global_db/counters_db.json b/tests/mock_tables/global_db/counters_db.json new file mode 100644 index 000000000000..2c63c0851048 --- /dev/null +++ b/tests/mock_tables/global_db/counters_db.json @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/mock_tables/global_db/database_config.json b/tests/mock_tables/global_db/database_config.json new file mode 100644 index 000000000000..c5fc6d4be14e --- /dev/null +++ b/tests/mock_tables/global_db/database_config.json @@ -0,0 +1,57 @@ +{ + "INSTANCES": { + "redis":{ + "hostname" : "127.0.0.1", + "port" : 6379, + "unix_socket_path" : "global_db" + } + }, + "DATABASES" : { + "APPL_DB" : { + "id" : 0, + "separator": ":", + "instance" : "redis" + }, + "ASIC_DB" : { + "id" : 1, + "separator": ":", + "instance" : "redis" + }, + "COUNTERS_DB" : { + "id" : 2, + "separator": ":", + "instance" : "redis" + }, + "LOGLEVEL_DB" : { + "id" : 3, + "separator": ":", + "instance" : "redis" + }, + "CONFIG_DB" : { + "id" : 4, + "separator": "|", + "instance" : "redis" + }, + "PFC_WD_DB" : { + "id" : 5, + "separator": ":", + "instance" : "redis" + }, + "FLEX_COUNTER_DB" : { + "id" : 5, + "separator": ":", + "instance" : "redis" + }, + "STATE_DB" : { + "id" : 6, + "separator": "|", + "instance" : "redis" + }, + "SNMP_OVERLAY_DB" : { + "id" : 7, + "separator": "|", + "instance" : "redis" + } + }, + "VERSION" : "1.1" +} diff --git a/tests/mock_tables/global_db/snmp_overlay_db.json b/tests/mock_tables/global_db/snmp_overlay_db.json new file mode 100644 index 000000000000..2c63c0851048 --- /dev/null +++ b/tests/mock_tables/global_db/snmp_overlay_db.json @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/mock_tables/global_db/state_db.json b/tests/mock_tables/global_db/state_db.json new file mode 100644 index 000000000000..2c63c0851048 --- /dev/null +++ b/tests/mock_tables/global_db/state_db.json @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/namespace/test_hc_interfaces.py b/tests/namespace/test_hc_interfaces.py new file mode 100644 index 000000000000..e93ecb04fd7d --- /dev/null +++ b/tests/namespace/test_hc_interfaces.py @@ -0,0 +1,282 @@ +import os +import sys +import importlib + +# noinspection PyUnresolvedReferences +import tests.mock_tables.dbconnector + +modules_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +sys.path.insert(0, os.path.join(modules_path, 'src')) + +from unittest import TestCase + +from ax_interface import ValueType +from ax_interface.pdu import PDU +from ax_interface.mib import MIBTable +from ax_interface.pdu_implementations import GetPDU, GetNextPDU +from ax_interface.encodings import ObjectIdentifier +from ax_interface.constants import PduTypes +from ax_interface.pdu import PDU, PDUHeader +from sonic_ax_impl.mibs.ietf import rfc2863 + +class TestGetNextPDU(TestCase): + @classmethod + def setUpClass(cls): + tests.mock_tables.dbconnector.load_namespace_config() + importlib.reload(rfc2863) + cls.lut = MIBTable(rfc2863.InterfaceMIBObjects) + for updater in cls.lut.updater_instances: + updater.update_data() + updater.reinit_data() + updater.update_data() + + def test_getnextpdu_firstifalias(self): + oid = ObjectIdentifier(10, 0, 1, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 18)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.OCTET_STRING) + self.assertEqual(str(value0.name), str(ObjectIdentifier(11, 0, 1, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 18, 1)))) + self.assertEqual(str(value0.data), 'snowflake') + + def test_getnextpdu_lastifalias(self): + oid = ObjectIdentifier(10, 0, 1, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 18, 9028)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.OCTET_STRING) + self.assertEqual(str(value0.name), str(ObjectIdentifier(11, 0, 1, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 18, 9028)))) + self.assertEqual(str(value0.data), 'backplane') + + + def test_get_next_alias(self): + if_alias = b'\x01\x06\x10\x00\x00\x00\x00o\x00\x01\xcc4\x00\x01\xcc5\x00\x00\x000\x07\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x11\x00\x00\x00}\x03\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x02' + pdu = PDU.decode(if_alias) + resp = pdu.make_response(self.lut) + print(resp) + + def test_get_next1(self): + payload = b'\x01\x06\x10\x00\x00\x00\x00\x17\x00\x00\x01R\x00\x00\x01S\x00\x00\x00,\x06\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x03\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x02' + pdu = PDU.decode(payload) + resp = pdu.make_response(self.lut) + print(resp) + + def test_get_next2(self): + payload = b'\x01\x06\x10\x00\x00\x00\x00\x17\x00\x00\x01V\x00\x00\x01W\x00\x00\x00,\x06\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x03\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x02\x01\x06\x10\x00\x00\x00\x00\x17\x00\x00\x01\\\x00\x00\x01]\x00\x00\x00,\x06\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x03\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x02\x01\x06\x10\x00\x00\x00\x00\x17\x00\x00\x01b\x00\x00\x01c\x00\x00\x00,\x06\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x03\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x02\x01\x06\x10\x00\x00\x00\x00\x17\x00\x00\x01h\x00\x00\x01i\x00\x00\x00,\x06\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x03\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x02' + pdu = PDU.decode(payload) + resp = pdu.make_response(self.lut) + print(resp) + + def test_get_next3(self): + payload = b'\x01\x06\x10\x00\x00\x00\x00\x17\x00\x00\x01V\x00\x00\x01W\x00\x00\x00,\x06\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x03\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x02\x01\x06\x10\x00\x00\x00\x00\x17\x00\x00\x01\\\x00\x00\x01]\x00\x00\x00,\x06\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x03\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x02\x01\x06\x10\x00\x00\x00\x00\x17\x00\x00\x01b\x00\x00\x01c\x00\x00\x00,\x06\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x03\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x02\x01\x06\x10\x00\x00\x00\x00\x17\x00\x00\x01h\x00\x00\x01i\x00\x00\x00,\x06\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x03\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x02' + pdu = PDU.decode(payload) + resp = pdu.make_response(self.lut) + print(resp) + + def test_no_description(self): + """ + For a port with no description in the db the result should be ian empty string + """ + oid = ObjectIdentifier(12, 0, 0, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 18, 9)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.OCTET_STRING) + self.assertEqual(str(value0.name), str(ObjectIdentifier(12, 0, 1, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 18, 13)))) + self.assertEqual(str(value0.data), '') + + def test_low_speed(self): + """ + For an interface with a speed inside the 32 bit counter returns the speed of the interface in Mbps + """ + oid = ObjectIdentifier(12, 0, 0, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 15, 9)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.GAUGE_32) + self.assertEqual(str(value0.name), str(ObjectIdentifier(12, 0, 1, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 15, 13)))) + self.assertEqual(value0.data, 1000) + + def test_high_speed(self): + """ + should return the speed of the interface + """ + oid = ObjectIdentifier(12, 0, 0, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 15, 1)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.GAUGE_32) + self.assertEqual(str(value0.name), str(ObjectIdentifier(12, 0, 1, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 15, 5)))) + self.assertEqual(value0.data, 100000) + + def test_no_speed(self): + """ + For a port with no speed in the db the result should be 40000 + """ + oid = ObjectIdentifier(12, 0, 0, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 15, 9004)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.GAUGE_32) + self.assertEqual(str(value0.name), str(ObjectIdentifier(12, 0, 1, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 15, 9008)))) + self.assertEqual(value0.data, 40000) + + def test_no_description(self): + """ + For a port with no speed in the db the result should be 40000 + """ + oid = ObjectIdentifier(12, 0, 0, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 18, 9004)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + n = len(response.values) + # self.assertEqual(n, 7) + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.OCTET_STRING) + self.assertEqual(str(value0.name), str(ObjectIdentifier(12, 0, 1, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 18, 9008)))) + self.assertEqual(str(value0.data), '') + + def test_mgmt_iface_name(self): + """ + Test that mgmt port is present in the MIB + """ + oid = ObjectIdentifier(11, 0, 0, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 1, 10000)) + get_pdu = GetPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.OCTET_STRING) + self.assertEqual(str(value0.name), str(ObjectIdentifier(11, 0, 1, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 1, 10000)))) + self.assertEqual(str(value0.data), 'eth0') + + def test_mgmt_iface_alias(self): + """ + Test that mgmt port alias + """ + oid = ObjectIdentifier(11, 0, 0, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 1, 10001)) + get_pdu = GetPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.OCTET_STRING) + self.assertEqual(str(value0.name), str(ObjectIdentifier(11, 0, 1, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 1, 10001)))) + self.assertEqual(str(value0.data), 'mgmt1') + + def test_mgmt_iface_speed(self): + """ + Test that mgmt port speed is 1000 + """ + oid = ObjectIdentifier(11, 0, 0, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 15, 10000)) + get_pdu = GetPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.GAUGE_32) + self.assertEqual(str(value0.name), str(ObjectIdentifier(11, 0, 1, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 15, 10000)))) + self.assertEqual(value0.data, 1000) + + def test_in_octets(self): + """ + For a port with no speed in the db the result should be 0 + """ + oid = ObjectIdentifier(12, 0, 0, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 6, 9028)) + get_pdu = GetPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.COUNTER_64) + self.assertEqual(str(value0.name), str(ObjectIdentifier(12, 0, 1, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 6, 9028)))) + self.assertEqual(value0.data, 40321) + + def test_in_octets_override(self): + """ + For a port with no speed in the db the result should be 0 + """ + oid = ObjectIdentifier(12, 0, 0, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 6, 5)) + get_pdu = GetPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.COUNTER_64) + self.assertEqual(str(value0.name), str(ObjectIdentifier(12, 0, 1, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 6, 5)))) + self.assertEqual(value0.data, 654321) + + @classmethod + def tearDownClass(cls): + tests.mock_tables.dbconnector.clean_up_config() diff --git a/tests/namespace/test_interfaces.py b/tests/namespace/test_interfaces.py new file mode 100644 index 000000000000..ea51339f8e34 --- /dev/null +++ b/tests/namespace/test_interfaces.py @@ -0,0 +1,372 @@ +import os +import sys +import importlib + +# noinspection PyUnresolvedReferences +import tests.mock_tables.dbconnector + +modules_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +sys.path.insert(0, os.path.join(modules_path, 'src')) + +from unittest import TestCase + +from ax_interface import ValueType +from ax_interface.pdu_implementations import GetPDU, GetNextPDU +from ax_interface.encodings import ObjectIdentifier +from ax_interface.constants import PduTypes +from ax_interface.pdu import PDU, PDUHeader +from ax_interface.mib import MIBTable +from sonic_ax_impl.mibs.ietf import rfc1213 +from sonic_ax_impl import mibs + +class TestGetNextPDU(TestCase): + @classmethod + def setUpClass(cls): + tests.mock_tables.dbconnector.load_namespace_config() + importlib.reload(rfc1213) + cls.lut = MIBTable(rfc1213.InterfacesMIB) + for updater in cls.lut.updater_instances: + updater.update_data() + updater.reinit_data() + updater.update_data() + + def test_getnextpdu_noneifindex(self): + # oid.include = 1 + oid = ObjectIdentifier(10, 0, 1, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 1)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + n = len(response.values) + # self.assertEqual(n, 7) + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.INTEGER) + self.assertEqual(str(value0.name), str(ObjectIdentifier(11, 0, 1, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 1, 1)))) + self.assertEqual(value0.data, 0) + + def test_getnextpdu_firstifindex(self): + # oid.include = 1 + oid = ObjectIdentifier(9, 0, 1, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + n = len(response.values) + # self.assertEqual(n, 7) + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.INTEGER) + self.assertEqual(str(value0.name), str(ObjectIdentifier(11, 0, 1, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 1, 1)))) + self.assertEqual(value0.data, 0) + + def test_getnextpdu_secondifindex(self): + oid = ObjectIdentifier(11, 0, 0, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 1, 1)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + n = len(response.values) + # self.assertEqual(n, 7) + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.INTEGER) + self.assertEqual(str(value0.name), str(ObjectIdentifier(11, 0, 1, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 1, 5)))) + self.assertEqual(value0.data, 4) + + def test_regisiter_response(self): + mib_2_response = b'\x01\x12\x10\x00\x00\x00\x001\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00,\x01d`\xab\x00\x00\x00\x00\x00\x05\x00\x00\x07\x04\x00\x00\x00\x00\x00\x01\x00\x00\x17\x8b\x00\x00\x00\x03\x00\x00\x00\n\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\t\x01\x12\x10\x00\x00\x00\x001\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x01d`\xab\x00\x00\x00\x00\x00\x05\x00\x00\x02\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02' + # TODO: needs recursive response + resp_pdu = PDU.decode(mib_2_response) + print(resp_pdu) + + def test_interfaces_walk(self): + resp = b'\x01\x06\x10\x00\x00\x00\x00C\x00\x01ay\x00\x01az\x00\x00\x00(\x06\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00}\x02\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x03' + resp_pdu = PDU.decode(resp) + resp_pdu.make_response(self.lut) + print(resp_pdu) + + def test_oid_response(self): + get_next = b'\x01\x06\x10\x00\x00\x00\x00I\x00\x01m\xe3\x00\x01m\xe4\x00\x00\x00(\x06\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x15\x00\x00\x00}\x02\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x03' + + pdu = PDU.decode(get_next) + resp = pdu.make_response(self.lut) + print(resp) + + def test_first_index(self): + # walk + walk = b'\x01\x06\x10\x00\x00\x00\x00O\x00\x01\x93\x9b\x00\x01\x93\x9c\x00\x00\x00(\x06\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x02\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x03' + pdu = PDU.decode(walk) + resp = pdu.make_response(self.lut) + print(resp) + + # step + step = b'\x01\x06\x10\x00\x00\x00\x00O\x00\x01\x94\x03\x00\x01\x94\x04\x00\x00\x00(\x06\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x05\x02\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x03' + pdu = PDU.decode(step) + resp = pdu.make_response(self.lut) + print(resp) + + def test_bad_if_names(self): + """ + Triggered by mis-configured interface names. Fine otherwise. + TODO: exemplary bad DB + """ + resp = b'\x01\x06\x10\x00\x00\x00\x00\x15\x00\x00\x01\x0c\x00\x00\x01\r\x00\x00\x00,\x06\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x03\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x02\x01\x06\x10\x00\x00\x00\x00\x15\x00\x00\x01\x12\x00\x00\x01\x13\x00\x00\x00,\x06\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x03\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x02\x01\x06\x10\x00\x00\x00\x00\x15\x00\x00\x01\x18\x00\x00\x01\x19\x00\x00\x00,\x06\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x03\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x02\x01\x06\x10\x00\x00\x00\x00\x15\x00\x00\x01\x1e\x00\x00\x01\x1f\x00\x00\x00,\x06\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x03\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1f\x00\x00\x00\x02' + pdu = PDU.decode(resp) + resp = pdu.make_response(self.lut) + print(resp) + + def test_missing_counter(self): + """ + KeyError: b'OUT_QLEN' + counter_value = self.if_counters[sai_id][_table_name] + snmp-subagent[242]: File "/usr/lib/python3.5/site-packages/ax_interface/mib.py", line 133, in __call__ + KeyError triggered when attribute is absent from interface counters. + TODO: exemplary bad DB + """ + resp = b'\x01\x06\x10\x00\x00\x00\x00[\x00\x00Ek\x00\x00En\x00\x00\x00(\x06\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x14\x00\x00\x00}\x02\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x03\x01\x06\x10\x00\x00\x00\x00[\x00\x00Eo\x00\x00Eq\x00\x00\x00(\x06\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x14\x00\x00\x00y\x02\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\x03' + pdu = PDU.decode(resp) + resp = pdu.make_response(self.lut) + print(resp) + + def test_low_speed(self): + """ + For an interface with a speed inside the 32 bit counter returns the speed of the interface in bps + """ + oid = ObjectIdentifier(11, 0, 0, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 5, 9)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.GAUGE_32) + self.assertEqual(str(value0.name), str(ObjectIdentifier(11, 0, 1, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 5, 13)))) + self.assertEqual(value0.data, 1000000000) + + def test_high_speed(self): + """ + For a speed higher than 4,294,967,295 the retrun should be 4294967295 + """ + oid = ObjectIdentifier(11, 0, 0, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 5, 1)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.GAUGE_32) + self.assertEqual(str(value0.name), str(ObjectIdentifier(11, 0, 1, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 5, 5)))) + self.assertEqual(value0.data, 4294967295) + + def test_no_speed(self): + """ + For a port with no speed in the db the result should be 0 + """ + oid = ObjectIdentifier(11, 0, 0, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 5, 9004)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.GAUGE_32) + self.assertEqual(str(value0.name), str(ObjectIdentifier(11, 0, 1, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 5, 9008)))) + self.assertEqual(value0.data, 0) + + def test_if_type_eth(self): + """ + For ethernet the type shpuld be 6 + """ + oid = ObjectIdentifier(11, 0, 0, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 3, 1)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.INTEGER) + self.assertEqual(str(value0.name), str(ObjectIdentifier(11, 0, 1, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 3, 5)))) + self.assertEqual(value0.data, 6) + + def test_if_type_portchannel(self): + """ + For portchannel the type shpuld be 161 + """ + oid = ObjectIdentifier(11, 0, 0, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 3, 1000)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.INTEGER) + self.assertEqual(str(value0.name), str(ObjectIdentifier(11, 0, 1, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 3, 1001)))) + self.assertEqual(value0.data, 161) + + def test_getnextpdu_first_bp_ifindex(self): + oid = ObjectIdentifier(11, 0, 0, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 1,1004)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response.values) + + n = len(response.values) + # self.assertEqual(n, 7) + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.INTEGER) + self.assertEqual(str(value0.name), str(ObjectIdentifier(11, 0, 1, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 1, 9000)))) + self.assertEqual(value0.data, 8999) + + + def test_getnextpdu_second_bp_ifindex(self): + oid = ObjectIdentifier(11, 0, 0, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 1,9020)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response.values) + + n = len(response.values) + # self.assertEqual(n, 7) + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.INTEGER) + self.assertEqual(str(value0.name), str(ObjectIdentifier(11, 0, 1, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 1, 9024)))) + self.assertEqual(value0.data, 9023) + + + def test_mgmt_iface(self): + """ + Test that mgmt port is present in the MIB + """ + oid = ObjectIdentifier(11, 0, 0, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 1, 10000)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.INTEGER) + self.assertEqual(str(value0.name), str(ObjectIdentifier(11, 0, 1, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 1, 10001)))) + self.assertEqual(value0.data, 10000) + + def test_mgmt_iface_description(self): + """ + Test mgmt port description (which is simply an alias) + """ + oid = ObjectIdentifier(11, 0, 0, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 2, 10001)) + get_pdu = GetPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.OCTET_STRING) + self.assertEqual(str(value0.name), str(ObjectIdentifier(11, 0, 1, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 2, 10001)))) + self.assertEqual(str(value0.data), 'mgmt1') + + def test_mgmt_iface_admin_status(self): + """ + Test mgmt port admin status + """ + oid = ObjectIdentifier(11, 0, 0, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 7, 10001)) + get_pdu = GetPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.INTEGER) + self.assertEqual(str(value0.name), str(ObjectIdentifier(11, 0, 1, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 7, 10001)))) + self.assertEqual(value0.data, 1) + + def test_in_octets(self): + """ + For a port with no speed in the db the result should be 0 + """ + oid = ObjectIdentifier(11, 0, 0, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 10, 9028)) + get_pdu = GetPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.COUNTER_32) + self.assertEqual(str(value0.name), str(ObjectIdentifier(11, 0, 1, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 10, 9028)))) + self.assertEqual(value0.data, 40321) + + def test_in_octets_override(self): + """ + For a port with no speed in the db the result should be 0 + """ + oid = ObjectIdentifier(11, 0, 0, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 10, 1)) + get_pdu = GetPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.COUNTER_32) + self.assertEqual(str(value0.name), str(ObjectIdentifier(11, 0, 1, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 10, 1)))) + self.assertEqual(value0.data, 54321) + + @classmethod + def tearDownClass(cls): + tests.mock_tables.dbconnector.clean_up_config() diff --git a/tests/namespace/test_mibs.py b/tests/namespace/test_mibs.py new file mode 100644 index 000000000000..b461d09ed480 --- /dev/null +++ b/tests/namespace/test_mibs.py @@ -0,0 +1,38 @@ +import os +import sys +from unittest import TestCase + +import tests.mock_tables.dbconnector +from sonic_ax_impl.mibs import Namespace + +modules_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +sys.path.insert(0, os.path.join(modules_path, 'src')) + +from sonic_ax_impl import mibs + +class TestGetNextPDU(TestCase): + @classmethod + def setUpClass(cls): + tests.mock_tables.dbconnector.load_namespace_config() + + def test_init_namespace_sync_d_lag_tables(self): + dbs = Namespace.init_namespace_dbs() + + lag_name_if_name_map, \ + if_name_lag_name_map, \ + oid_lag_name_map = Namespace.init_namespace_sync_d_lag_tables(dbs) + #PortChannel in asic0 Namespace + self.assertTrue(b"PortChannel01" in lag_name_if_name_map) + self.assertTrue(b"Ethernet-BP0" in lag_name_if_name_map[b"PortChannel01"]) + self.assertTrue(b"Ethernet-BP4" in lag_name_if_name_map[b"PortChannel01"]) + #PortChannel in asic2 Namespace + self.assertTrue(b"PortChannel03" in lag_name_if_name_map) + self.assertTrue(b"Ethernet-BP16" in lag_name_if_name_map[b"PortChannel03"]) + self.assertTrue(b"Ethernet-BP20" in lag_name_if_name_map[b"PortChannel03"]) + + self.assertTrue(b"PortChannel_Temp" in lag_name_if_name_map) + self.assertTrue(lag_name_if_name_map[b"PortChannel_Temp"] == []) + + @classmethod + def tearDownClass(cls): + tests.mock_tables.dbconnector.clean_up_config() diff --git a/tests/namespace/test_pfc.py b/tests/namespace/test_pfc.py new file mode 100644 index 000000000000..7dd7eaf9e1e7 --- /dev/null +++ b/tests/namespace/test_pfc.py @@ -0,0 +1,270 @@ +import os +import sys +import importlib + +# noinspection PyUnresolvedReferences +import tests.mock_tables.dbconnector + +modules_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +sys.path.insert(0, os.path.join(modules_path, 'src')) + +from unittest import TestCase + +from ax_interface import ValueType +from ax_interface.pdu_implementations import GetPDU, GetNextPDU +from ax_interface.encodings import ObjectIdentifier +from ax_interface.constants import PduTypes +from ax_interface.pdu import PDU, PDUHeader +from ax_interface.mib import MIBTable +from sonic_ax_impl.mibs.vendor.cisco import ciscoPfcExtMIB + +class TestPfcPortCounters(TestCase): + @classmethod + def setUpClass(cls): + tests.mock_tables.dbconnector.load_namespace_config() + importlib.reload(ciscoPfcExtMIB) + + cls.lut_port = MIBTable(ciscoPfcExtMIB.cpfcIfTable) + cls.lut_prio = MIBTable(ciscoPfcExtMIB.cpfcIfPriorityTable) + + # Update MIBs + for updater in cls.lut_port.updater_instances: + updater.reinit_data() + updater.update_data() + for updater in cls.lut_prio.updater_instances: + updater.reinit_data() + updater.update_data() + + def test_getPduRequestForPort(self): + oid = ObjectIdentifier(32, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 813, 1, 1, 1, 1, 1)) + get_pdu = GetPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut_port) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.COUNTER_64) + self.assertEqual(str(value0.name), str(oid)) + self.assertEqual(value0.data, 4) + + def test_getNextPduRequestForPort(self): + oid = ObjectIdentifier(32, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 813, 1, 1, 1, 1, 1)) + expected_oid = ObjectIdentifier(32, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 813, 1, 1, 1, 1, 5)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET_NEXT, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut_port) + print(response) + + n = len(response.values) + print('values = ' + str(n)) + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.COUNTER_64) + self.assertEqual(str(value0.name), str(expected_oid)) + self.assertEqual(value0.data, 4) + + def test_lastPduRequestForPort(self): + oid = ObjectIdentifier(32, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 813, 1, 1, 1, 1, 9024)) + expected_oid = ObjectIdentifier(32, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 813, 1, 1, 1, 1, 9028)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET_NEXT, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut_port) + print(response) + + n = len(response.values) + print('values = ' + str(n)) + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.COUNTER_64) + self.assertEqual(str(value0.name), str(expected_oid)) + self.assertEqual(value0.data, 4) + + def test_getPduIndicationForPort(self): + oid = ObjectIdentifier(32, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 813, 1, 1, 1, 2, 1)) + get_pdu = GetPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut_port) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.COUNTER_64) + self.assertEqual(str(value0.name), str(oid)) + self.assertEqual(value0.data, 4) + + def test_getNextPduindicationForPort(self): + oid = ObjectIdentifier(32, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 813, 1, 1, 1, 2, 1)) + expected_oid = ObjectIdentifier(32, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 813, 1, 1, 1, 2, 5)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut_port) + print(response) + + n = len(response.values) + print('values = ' + str(n)) + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.COUNTER_64) + self.assertEqual(str(value0.name), str(expected_oid)) + self.assertEqual(value0.data, 4) + + def test_getAsic0FirstPduindicationForPort(self): + oid = ObjectIdentifier(32, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 813, 1, 1, 1, 2, 8999)) + expected_oid = ObjectIdentifier(32, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 813, 1, 1, 1, 2, 9000)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut_port) + print(response) + + n = len(response.values) + print('values = ' + str(n)) + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.COUNTER_64) + self.assertEqual(str(value0.name), str(expected_oid)) + self.assertEqual(value0.data, 4) + + def test_getPduRequestForPriority(self): + oid = ObjectIdentifier(8, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 813, 1, 2, 1, 2, 9, 0)) + get_pdu = GetPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut_prio) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.COUNTER_64) + self.assertEqual(str(value0.name), str(oid)) + self.assertEqual(value0.data, 209347219842134092490 % pow(2, 64)) # Test integer truncation + + def test_getNextPduRequestForPriority(self): + oid = ObjectIdentifier(8, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 813, 1, 2, 1, 2, 1, 1)) + expected_oid = ObjectIdentifier(8, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 813, 1, 2, 1, 2, 1, 2)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut_prio) + print(response) + + n = len(response.values) + print('values = ' + str(n)) + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.COUNTER_64) + self.assertEqual(str(value0.name), str(expected_oid)) + self.assertEqual(value0.data, 3) + + def test_getPduIndicationForPriority(self): + oid = ObjectIdentifier(8, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 813, 1, 2, 1, 3, 5, 0)) + get_pdu = GetPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut_prio) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.COUNTER_64) + self.assertEqual(str(value0.name), str(oid)) + self.assertEqual(value0.data, 1) + + def test_getNextPduindicationForPriority(self): + oid = ObjectIdentifier(8, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 813, 1, 2, 1, 3, 1, 0)) + expected_oid = ObjectIdentifier(8, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 813, 1, 2, 1, 3, 1, 1)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut_prio) + print(response) + + n = len(response.values) + print('values = ' + str(n)) + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.COUNTER_64) + self.assertEqual(str(value0.name), str(expected_oid)) + self.assertEqual(value0.data, 2) + + def test_getNextPduiAsic1indicationForPriority(self): + oid = ObjectIdentifier(8, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 813, 1, 2, 1, 3, 9, 2)) + expected_oid = ObjectIdentifier(8, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 813, 1, 2, 1, 3, 9, 3)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut_prio) + print(response) + + n = len(response.values) + print('values = ' + str(n)) + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.COUNTER_64) + self.assertEqual(str(value0.name), str(expected_oid)) + self.assertEqual(value0.data, 4) + + def test_getPfcSubtree(self): + # Subtree for port + oid = ObjectIdentifier(32, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 813, 1, 1)) + expected_oid = ObjectIdentifier(32, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 813, 1, 1, 1, 1, 1)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET_NEXT, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut_port) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.COUNTER_64) + self.assertEqual(str(value0.name), str(expected_oid)) + self.assertEqual(value0.data, 4) + + # Subtree for Priority + oid = ObjectIdentifier(33, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 813, 1, 2)) + expected_oid = ObjectIdentifier(33, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 813, 1, 2, 1, 2, 1, 0)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET_NEXT, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut_prio) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.COUNTER_64) + self.assertEqual(str(value0.name), str(expected_oid)) + self.assertEqual(value0.data, 209347219842134092490 % pow(2, 64)) # Test integer truncation + + @classmethod + def tearDownClass(cls): + tests.mock_tables.dbconnector.clean_up_config() diff --git a/tests/namespace/test_queues_stat.py b/tests/namespace/test_queues_stat.py new file mode 100644 index 000000000000..d97db2efaf10 --- /dev/null +++ b/tests/namespace/test_queues_stat.py @@ -0,0 +1,180 @@ +import os +import sys +import importlib + +# noinspection PyUnresolvedReferences +import tests.mock_tables.dbconnector + +modules_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +sys.path.insert(0, os.path.join(modules_path, 'src')) + +from unittest import TestCase + +from ax_interface import ValueType +from ax_interface.pdu_implementations import GetPDU, GetNextPDU +from ax_interface.encodings import ObjectIdentifier +from ax_interface.constants import PduTypes +from ax_interface.pdu import PDU, PDUHeader +from ax_interface.mib import MIBTable +from sonic_ax_impl.mibs.vendor.cisco import ciscoSwitchQosMIB +from sonic_ax_impl import mibs + +class TestQueueCounters(TestCase): + @classmethod + def setUpClass(cls): + tests.mock_tables.dbconnector.load_namespace_config() + importlib.reload(ciscoSwitchQosMIB) + cls.lut = MIBTable(ciscoSwitchQosMIB.csqIfQosGroupStatsTable) + + # Update MIBs + for updater in cls.lut.updater_instances: + updater.reinit_data() + updater.update_data() + + def test_getQueueCounters(self): + for counter_id in range(1, 8): + oid = ObjectIdentifier(8, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 580, 1, 5, 5, 1, 4, 1, 2, 1, 1)) + get_pdu = GetPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.COUNTER_64) + self.assertEqual(str(value0.name), str(oid)) + self.assertEqual(value0.data, 1) + + def test_getNextPduForQueueCounter(self): + oid = ObjectIdentifier(8, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 580, 1, 5, 5, 1, 4, 1, 2, 1, 1)) + expected_oid = ObjectIdentifier(8, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 580, 1, 5, 5, 1, 4, 1, 2, 1, 2)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET_NEXT, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.COUNTER_64) + self.assertEqual(str(value0.name), str(expected_oid)) + self.assertEqual(value0.data, 23492723984237432 % pow(2, 64)) # Test integer truncation + + def test_getNextPduForQueueCounter_asic2(self): + oid = ObjectIdentifier(8, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 580, 1, 5, 5, 1, 4, 9016, 2, 1, 1)) + expected_oid = ObjectIdentifier(8, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 580, 1, 5, 5, 1, 4, 9016, 2, 1, 2)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET_NEXT, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.COUNTER_64) + self.assertEqual(str(value0.name), str(expected_oid)) + self.assertEqual(value0.data, 24) # Test integer truncation + + def test_getNextPduForQueueCounter_wrapped(self): + oid = ObjectIdentifier(8, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 580, 1, 5, 5, 1, 4, 1, 2, 1, 2)) + expected_oid = ObjectIdentifier(8, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 580, 1, 5, 5, 1, 4, 1, 2, 1, 3)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET_NEXT, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.COUNTER_64) + self.assertEqual(str(value0.name), str(expected_oid)) + self.assertEqual(value0.data, 123459) # Test integer truncation + + def test_getIngressQueueCounters(self): + oid = ObjectIdentifier(8, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 580, 1, 5, 5, 1, 4, 1, 1, 1, 1)) + get_pdu = GetPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.NO_SUCH_INSTANCE) + self.assertEqual(str(value0.name), str(oid)) + self.assertEqual(value0.data, None) + + def test_getMulticastQueueCountersWrapped(self): + oid = ObjectIdentifier(8, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 580, 1, 5, 5, 1, 4, 1, 2, 1, 3)) + get_pdu = GetPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.COUNTER_64) + self.assertEqual(str(value0.name), str(oid)) + self.assertEqual(value0.data, 123459) + + def test_getMulticastQueueCountersWrapped_asic1(self): + oid = ObjectIdentifier(8, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 580, 1, 5, 5, 1, 4, 9, 2, 1, 3)) + get_pdu = GetPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.COUNTER_64) + self.assertEqual(str(value0.name), str(oid)) + self.assertEqual(value0.data, 10) + + def test_getMulticastQueueCounters(self): + oid = ObjectIdentifier(8, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 580, 1, 5, 5, 1, 4, 5, 2, 1, 9)) + get_pdu = GetPDU( + header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + print(response) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.NO_SUCH_INSTANCE) + self.assertEqual(str(value0.name), str(oid)) + self.assertEqual(value0.data, None) + + def test_getSubtreeForQueueCounters(self): + oid = ObjectIdentifier(8, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 580, 1, 5, 5)) + expected_oid = ObjectIdentifier(8, 0, 0, 0, (1, 3, 6, 1, 4, 1, 9, 9, 580, 1, 5, 5, 1, 4, 1, 2, 1, 1)) + get_pdu = GetNextPDU( + header=PDUHeader(1, PduTypes.GET_NEXT, 16, 0, 42, 0, 0, 0), + oids=[oid] + ) + + encoded = get_pdu.encode() + response = get_pdu.make_response(self.lut) + + value0 = response.values[0] + self.assertEqual(value0.type_, ValueType.COUNTER_64) + self.assertEqual(str(value0.name), str(expected_oid)) + self.assertEqual(value0.data, 1) diff --git a/tests/test_hc_interfaces.py b/tests/test_hc_interfaces.py index 34fed9a03c06..28d59a07d4b1 100644 --- a/tests/test_hc_interfaces.py +++ b/tests/test_hc_interfaces.py @@ -1,5 +1,6 @@ import os import sys +import importlib # noinspection PyUnresolvedReferences import tests.mock_tables.dbconnector @@ -22,6 +23,8 @@ class TestGetNextPDU(TestCase): @classmethod def setUpClass(cls): + tests.mock_tables.dbconnector.load_database_config() + importlib.reload(rfc2863) cls.lut = MIBTable(rfc2863.InterfaceMIBObjects) for updater in cls.lut.updater_instances: updater.update_data() diff --git a/tests/test_interfaces.py b/tests/test_interfaces.py index 5b54dec3d35d..ae4ee53c4a3f 100644 --- a/tests/test_interfaces.py +++ b/tests/test_interfaces.py @@ -1,5 +1,6 @@ import os import sys +import importlib # noinspection PyUnresolvedReferences import tests.mock_tables.dbconnector @@ -20,6 +21,8 @@ class TestGetNextPDU(TestCase): @classmethod def setUpClass(cls): + tests.mock_tables.dbconnector.load_database_config() + importlib.reload(rfc1213) cls.lut = MIBTable(rfc1213.InterfacesMIB) for updater in cls.lut.updater_instances: updater.update_data() diff --git a/tests/test_mibs.py b/tests/test_mibs.py index 9f77032ad658..3c28a89e569a 100644 --- a/tests/test_mibs.py +++ b/tests/test_mibs.py @@ -12,7 +12,8 @@ class TestGetNextPDU(TestCase): @classmethod def setUpClass(cls): - pass + #For single namespace scenario, load database_config.json + tests.mock_tables.dbconnector.load_database_config() def test_init_sync_d_lag_tables(self): db_conn = mibs.init_db() diff --git a/tests/test_pfc.py b/tests/test_pfc.py index bac7c2921fc6..678145cacf35 100644 --- a/tests/test_pfc.py +++ b/tests/test_pfc.py @@ -1,5 +1,6 @@ import os import sys +import importlib # noinspection PyUnresolvedReferences import tests.mock_tables.dbconnector @@ -20,6 +21,8 @@ class TestPfcPortCounters(TestCase): @classmethod def setUpClass(cls): + tests.mock_tables.dbconnector.load_database_config() + importlib.reload(ciscoPfcExtMIB) cls.lut_port = MIBTable(ciscoPfcExtMIB.cpfcIfTable) cls.lut_prio = MIBTable(ciscoPfcExtMIB.cpfcIfPriorityTable)