Add support for CHASSIS_COUNTERS_DB and schema for aggregate VOQ stats #908
Azure Pipelines / Azure.sonic-swss-common
failed
Aug 30, 2024 in 4h 36m 39s
Build #20240830.1 had test failures
Details
- Failed: 24 (4.33%)
- Passed: 526 (94.95%)
- Other: 4 (0.72%)
- Total: 554
- 4070 of 6879 branches covered (59.17%)
- 4712 of 5785 lines covered (81.45%)
Annotations
Check failure on line 4089 in Build log
azure-pipelines / Azure.sonic-swss-common
Build log #L4089
Bash exited with code '123'.
Check failure on line 1 in test_NH
azure-pipelines / Azure.sonic-swss-common
test_NH
AssertionError: Unexpected number of keys: expected=5, received=8 (('oid:0x40000000008e4', 'oid:0x40000000008e2', 'oid:0x40000000008ec', 'oid:0x4000000000627', 'oid:0x40000000008e5', 'oid:0x40000000008e3', 'oid:0x40000000008ed', 'oid:0x40000000008eb')), table="ASIC_STATE:SAI_OBJECT_TYPE_NEXT_HOP"
Raw output
self = <test_mux.TestMuxTunnel object at 0x7f5a39f98460>
dvs = <conftest.DockerVirtualSwitch object at 0x7f5a39df9d30>
dvs_route = <dvslib.dvs_route.DVSRoute object at 0x7f5a39f9aeb0>
intf_fdb_map = {'Ethernet0': 'b2:ab:12:24:a7:af', 'Ethernet4': '3a:57:e4:59:11:75', 'Ethernet8': '8a:80:a2:44:da:df'}
setup = ('oid:0x14000000000614', 'oid:0x14000000000615', 'oid:0x14000000000616', 'oid:0x14000000000617')
setup_mux_cable = None, setup_peer_switch = None, setup_tunnel = None
testlog = None
def test_NH(self, dvs, dvs_route, intf_fdb_map, setup, setup_mux_cable,
setup_peer_switch, setup_tunnel, testlog):
""" test NH routes and mux state change """
appdb = swsscommon.DBConnector(swsscommon.APPL_DB, dvs.redis_sock, 0)
asicdb = dvs.get_asic_db()
mac = intf_fdb_map["Ethernet0"]
# get tunnel nexthop
> self.check_tnl_nexthop_in_asic_db(asicdb, 5)
test_mux.py:1525:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_mux.py:230: in check_tnl_nexthop_in_asic_db
nh = asicdb.wait_for_n_keys(self.ASIC_NEXTHOP_TABLE, expected)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <dvslib.dvs_database.DVSDatabase object at 0x7f5a39f983d0>
table_name = 'ASIC_STATE:SAI_OBJECT_TYPE_NEXT_HOP', num_keys = 5
wait_at_least_n_keys = False
polling_config = PollingConfig(polling_interval=0.01, timeout=20.0, strict=True)
failure_message = None
def wait_for_n_keys(
self,
table_name: str,
num_keys: int,
wait_at_least_n_keys: bool = False,
polling_config: PollingConfig = PollingConfig(),
failure_message: str = None,
) -> List[str]:
"""Wait for the specified number of keys to exist in the table.
Args:
table_name: The name of the table from which to fetch the keys.
num_keys: The expected number of keys to retrieve from the table.
polling_config: The parameters to use to poll the db.
failure_message: The message to print if the call times out. This will only take effect
if the PollingConfig is set to strict.
Returns:
The keys stored in the table. If no keys are found, then an empty List is returned.
"""
def access_function():
keys = self.get_keys(table_name)
if wait_at_least_n_keys:
return (len(keys) >= num_keys, keys)
else:
return (len(keys) == num_keys, keys)
status, result = wait_for_result(
access_function, self._disable_strict_polling(polling_config)
)
if not status:
message = failure_message or (
f"Unexpected number of keys: expected={num_keys}, received={len(result)} "
f'({result}), table="{table_name}"'
)
> assert not polling_config.strict, message
E AssertionError: Unexpected number of keys: expected=5, received=8 (('oid:0x40000000008e4', 'oid:0x40000000008e2', 'oid:0x40000000008ec', 'oid:0x4000000000627', 'oid:0x40000000008e5', 'oid:0x40000000008e3', 'oid:0x40000000008ed', 'oid:0x40000000008eb')), table="ASIC_STATE:SAI_OBJECT_TYPE_NEXT_HOP"
dvslib/dvs_database.py:414: AssertionError
Check failure on line 1 in test_multi_nexthop
azure-pipelines / Azure.sonic-swss-common
test_multi_nexthop
AssertionError: Operation timed out after 20.0 seconds with result None
Raw output
self = <test_mux.TestMuxTunnel object at 0x7f5a39fc2820>
dvs = <conftest.DockerVirtualSwitch object at 0x7f5a39df9d30>
dvs_route = <dvslib.dvs_route.DVSRoute object at 0x7f5a39f9aeb0>
intf_fdb_map = {'Ethernet0': 'b2:ab:12:24:a7:af', 'Ethernet4': '3a:57:e4:59:11:75', 'Ethernet8': '8a:80:a2:44:da:df'}
neighbor_cleanup = None, testlog = None
setup = ('oid:0x14000000000614', 'oid:0x14000000000615', 'oid:0x14000000000616', 'oid:0x14000000000617')
def test_multi_nexthop(self, dvs, dvs_route, intf_fdb_map, neighbor_cleanup, testlog, setup):
appdb = swsscommon.DBConnector(swsscommon.APPL_DB, dvs.redis_sock, 0)
asicdb = dvs.get_asic_db()
macs = [intf_fdb_map["Ethernet0"], intf_fdb_map["Ethernet4"]]
new_mac = intf_fdb_map["Ethernet8"]
> self.create_and_test_multi_nexthop_routes(dvs, dvs_route, appdb, macs, new_mac, asicdb)
test_mux.py:1535:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_mux.py:820: in create_and_test_multi_nexthop_routes
self.multi_nexthop_test_create(appdb, asicdb, dvs, dvs_route, route_ipv4, mux_ports, ipv4_nexthops)
test_mux.py:619: in multi_nexthop_test_create
self.multi_nexthop_check(asicdb, dvs_route, route, nexthops, states, non_mux_nexthop)
test_mux.py:595: in multi_nexthop_check
self.check_route_nexthop(dvs_route, asicdb, r, nexthops[i])
test_mux.py:275: in check_route_nexthop
route_key = dvs_route.check_asicdb_route_entries([route])
dvslib/dvs_route.py:16: in check_asicdb_route_entries
wait_for_result(_access_function)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
polling_function = <function DVSRoute.check_asicdb_route_entries.<locals>._access_function at 0x7f5a399e85e0>
polling_config = PollingConfig(polling_interval=0.01, timeout=20.0, strict=True)
failure_message = None
def wait_for_result(
polling_function: Callable[[], Tuple[bool, Any]],
polling_config: PollingConfig = PollingConfig(),
failure_message: str = None,
) -> Tuple[bool, Any]:
"""Run `polling_function` periodically using the specified `polling_config`.
Args:
polling_function: The function being polled. The function cannot take any arguments and
must return a status which indicates if the function was succesful or not, as well as
some return value.
polling_config: The parameters to use to poll the polling function.
failure_message: The message to print if the call times out. This will only take effect
if the PollingConfig is set to strict.
Returns:
If the polling function succeeds, then this method will return True and the output of the
polling function.
If it does not succeed within the provided timeout, it will return False and whatever the
output of the polling function was on the final attempt.
"""
for _ in range(polling_config.iterations()):
status, result = polling_function()
if status:
return (True, result)
time.sleep(polling_config.polling_interval)
if polling_config.strict:
message = failure_message or f"Operation timed out after {polling_config.timeout} seconds with result {result}"
> assert False, message
E AssertionError: Operation timed out after 20.0 seconds with result None
dvslib/dvs_common.py:60: AssertionError
Check failure on line 1 in test_acl
azure-pipelines / Azure.sonic-swss-common
test_acl
AssertionError: Unexpected number of keys: expected=0, received=1 (('oid:0x8000000000669',)), table="ASIC_STATE:SAI_OBJECT_TYPE_ACL_ENTRY"
Raw output
self = <test_mux.TestMuxTunnel object at 0x7f5a39ac22e0>
dvs = <conftest.DockerVirtualSwitch object at 0x7f5a39df9d30>
dvs_acl = <dvslib.dvs_acl.DVSAcl object at 0x7f5a39f9d520>, testlog = None
def test_acl(self, dvs, dvs_acl, testlog):
""" test acl and mux state change """
appdb = swsscommon.DBConnector(swsscommon.APPL_DB, dvs.redis_sock, 0)
try:
> self.create_and_test_acl(appdb, dvs_acl)
test_mux.py:1543:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <test_mux.TestMuxTunnel object at 0x7f5a39ac22e0>
appdb = <swsscommon.swsscommon.DBConnector; proxy of <Swig Object of type 'swss::DBConnector *' at 0x7f5a39ac2540> >
dvs_acl = <dvslib.dvs_acl.DVSAcl object at 0x7f5a39f9d520>
def create_and_test_acl(self, appdb, dvs_acl):
# Start with active, verify NO ACL rules exists
self.set_mux_state(appdb, "Ethernet0", "active")
self.set_mux_state(appdb, "Ethernet4", "active")
self.set_mux_state(appdb, "Ethernet8", "active")
> dvs_acl.verify_no_acl_rules()
test_mux.py:957:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <dvslib.dvs_acl.DVSAcl object at 0x7f5a39f9d520>
def verify_no_acl_rules(self) -> None:
"""Verify that there are no ACL rules in the ASIC DB."""
num_keys = len(self.asic_db.default_acl_entries)
> keys = self.asic_db.wait_for_n_keys("ASIC_STATE:SAI_OBJECT_TYPE_ACL_ENTRY", num_keys)
dvslib/dvs_acl.py:474:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <dvslib.dvs_database.DVSDatabase object at 0x7f5a39f983d0>
table_name = 'ASIC_STATE:SAI_OBJECT_TYPE_ACL_ENTRY', num_keys = 0
wait_at_least_n_keys = False
polling_config = PollingConfig(polling_interval=0.01, timeout=20.0, strict=True)
failure_message = None
def wait_for_n_keys(
self,
table_name: str,
num_keys: int,
wait_at_least_n_keys: bool = False,
polling_config: PollingConfig = PollingConfig(),
failure_message: str = None,
) -> List[str]:
"""Wait for the specified number of keys to exist in the table.
Args:
table_name: The name of the table from which to fetch the keys.
num_keys: The expected number of keys to retrieve from the table.
polling_config: The parameters to use to poll the db.
failure_message: The message to print if the call times out. This will only take effect
if the PollingConfig is set to strict.
Returns:
The keys stored in the table. If no keys are found, then an empty List is returned.
"""
def access_function():
keys = self.get_keys(table_name)
if wait_at_least_n_keys:
return (len(keys) >= num_keys, keys)
else:
return (len(keys) == num_keys, keys)
status, result = wait_for_result(
access_function, self._disable_strict_polling(polling_config)
)
if not status:
message = failure_message or (
f"Unexpected number of keys: expected={num_keys}, received={len(result)} "
f'({result}), table="{table_name}"'
)
> assert not polling_config.strict, message
E AssertionError: Unexpected number of keys: expected=0, received=1 (('oid:0x8000000000669',)), table="ASIC_STATE:SAI_OBJECT_TYPE_ACL_ENTRY"
dvslib/dvs_database.py:414: AssertionError
During handling of the above exception, another exception occurred:
self = <test_mux.TestMuxTunnel object at 0x7f5a39ac22e0>
dvs = <conftest.DockerVirtualSwitch object at 0x7f5a39df9d30>
dvs_acl = <dvslib.dvs_acl.DVSAcl object at 0x7f5a39f9d520>, testlog = None
def test_acl(self, dvs, dvs_acl, testlog):
""" test acl and mux state change """
appdb = swsscommon.DBConnector(swsscommon.AP
azure-pipelines / Azure.sonic-swss-common
test_neighbor_miss[active->ping_serv->standby->resolve_entry->delete_entry-IPv4]
AssertionError: Unexpected keys found: expected=['{"ip":"fc02:1000::10","rif":"oid:0x600000000066a","switch_id":"oid:0x21000000000000"}', '{"ip":"fc02:1000::11","rif":"oid:0x600000000066a","switch_id":"oid:0x21000000000000"}', '{"ip":"192.168.0.101","rif":"oid:0x600000000066a","switch_id":"oid:0x21000000000000"}', '{"ip":"fc02:1000::100","rif":"oid:0x600000000066a","switch_id":"oid:0x21000000000000"}', '{"ip":"192.168.0.255","rif":"oid:0x600000000066a","switch_id":"oid:0x21000000000000"}', '{"ip":"fc02:1000::101","rif":"oid:0x600000000066a","switch_id":"oid:0x21000000000000"}'], received=('{"ip":"fc02:1000::10","rif":"oid:0x600000000066a","switch_id":"oid:0x21000000000000"}', '{"ip":"fc02:1000::11","rif":"oid:0x600000000066a","switch_id":"oid:0x21000000000000"}', '{"ip":"192.168.0.101","rif":"oid:0x600000000066a","switch_id":"oid:0x21000000000000"}', '{"ip":"fc02:1000::100","rif":"oid:0x600000000066a","switch_id":"oid:0x21000000000000"}', '{"ip":"192.168.0.100","rif":"oid:0x600000000066a","switch_id":"oid:0x21000000000000"}', '{"ip":"192.168.0.255","rif":"oid:0x600000000066a","switch_id":"oid:0x21000000000000"}', '{"ip":"fc02:1000::101","rif":"oid:0x600000000066a","switch_id":"oid:0x21000000000000"}'), table="ASIC_STATE:SAI_OBJECT_TYPE_NEIGHBOR_ENTRY"
Raw output
self = <test_mux.TestMuxTunnel object at 0x7f5a39a8a4c0>
dvs = <conftest.DockerVirtualSwitch object at 0x7f5a39df9d30>
dvs_route = <dvslib.dvs_route.DVSRoute object at 0x7f5a39f9aeb0>
ips_for_test = ['192.168.0.100', '192.168.0.101', '192.168.0.102']
neigh_miss_test_sequence = [{'action': 'active', 'result': {'expect_neigh': False, 'expect_route': False, 'real_mac': False}}, {'action': 'ping_s...l_mac': True}}, {'action': 'delete_entry', 'result': {'expect_neigh': False, 'expect_route': False, 'real_mac': True}}]
ip_to_intf_map = {'192.168.0.100': 'Ethernet0', '192.168.0.101': 'Ethernet4', '192.168.0.102': 'Ethernet8', '192.168.0.200': 'Ethernet0', ...}
intf_fdb_map = {'Ethernet0': 'b2:ab:12:24:a7:af', 'Ethernet4': '3a:57:e4:59:11:75', 'Ethernet8': '8a:80:a2:44:da:df'}
neighbor_cleanup = None, setup_vlan = None, setup_mux_cable = None
setup_tunnel = None, setup_peer_switch = None, testlog = None
def test_neighbor_miss(
self, dvs, dvs_route, ips_for_test, neigh_miss_test_sequence,
ip_to_intf_map, intf_fdb_map, neighbor_cleanup, setup_vlan,
setup_mux_cable, setup_tunnel, setup_peer_switch, testlog
):
ip = ips_for_test[0]
intf = ip_to_intf_map[ip]
mac = intf_fdb_map[intf]
test_info = {
IP: ip,
INTF: intf,
MAC: mac
}
for step in neigh_miss_test_sequence:
self.execute_action(step[TEST_ACTION], dvs, test_info)
exp_result = step[EXPECTED_RESULT]
> self.check_neighbor_state(
dvs, dvs_route, ip,
expect_route=exp_result[EXPECT_ROUTE],
expect_neigh=exp_result[EXPECT_NEIGH],
expected_mac=mac if exp_result[REAL_MAC] else '00:00:00:00:00:00'
)
test_mux.py:1575:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_mux.py:1301: in check_neighbor_state
self.check_neigh_in_asic_db(asic_db, neigh_ip, expected=expect_neigh)
test_mux.py:222: in check_neigh_in_asic_db
asicdb.wait_for_deleted_keys(self.ASIC_NEIGH_TABLE, [expected_key])
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <dvslib.dvs_database.DVSDatabase object at 0x7f5a39f983d0>
table_name = 'ASIC_STATE:SAI_OBJECT_TYPE_NEIGHBOR_ENTRY'
deleted_keys = ['{"ip":"192.168.0.100","rif":"oid:0x600000000066a","switch_id":"oid:0x21000000000000"}']
polling_config = PollingConfig(polling_interval=0.01, timeout=20.0, strict=True)
failure_message = None
def wait_for_deleted_keys(
self,
table_name: str,
deleted_keys: List[str],
polling_config: PollingConfig = PollingConfig(),
failure_message: str = None,
) -> List[str]:
"""Wait for the specfied keys to no longer exist in the table.
Args:
table_name: The name of the table from which to fetch the keys.
deleted_keys: The keys we expect to be removed from the table.
polling_config: The parameters to use to poll the db.
failure_message: The message to print if the call times out. This will only take effect
if the PollingConfig is set to strict.
Returns:
The keys stored in the table. If no keys are found, then an empty List is returned.
"""
def access_function():
keys = self.get_keys(table_name)
return (all(key not in keys for key in deleted_keys), keys)
status, result = wait_for_result(
access_function, self._disable_strict_polling(polling_config)
)
if not status:
expected = [key for key in result if key not in deleted_keys]
message = failure_message or (
f"Unexpected keys found: expected={expected}, received={result}, "
f'table="{table_name}"'
)
> assert not polling_config.strict, message
E AssertionErr
Loading