Skip to content

Commit a2b47d2

Browse files
yejianquanwangxin
authored andcommitted
[test_configurable_drop_counters]Ignore loganalyzer exceptions (#5804)
What is the motivation for this PR? Fix loganalyzer exception of test_configurable_drop_counters. How did you do it? For the error log 1-3: I checked the trigger of the logs, likely it's because of the double delete([sonic-clear fdb all and arp], swssconfig ) of the cleanup commands. The second delete command(swssconfig) is used to remove the static mac record in fdb, I can see a certain record is deleted even though it's saying can't delete a non-exist record. It may be related to the async executing of swssconfig and sonic-clear(https://github.com/sonic-net/SONiC/wiki/SONiC-Clear-FDB-CLI-Design), if I execute 'show arp' and 'show mac' between the two cleanups, the exception will not be raised. Since a double delete has no bad effect on DUT, we can safely ignore it. For the error log 4-5: It should be related to debug things, we can safely ignore it too. So we can ignore the 5 error logs. How did you verify/test it? Run on physical testbeds drop_packets/test_configurable_drop_counters.py::test_neighbor_link_down[PORT_INGRESS_DROPS-L3_EGRESS_LINK_DOWN] PASSED [ 16%] drop_packets/test_configurable_drop_counters.py::test_neighbor_link_down[SWITCH_INGRESS_DROPS-L3_EGRESS_LINK_DOWN] SKIPPED [ 33%] drop_packets/test_configurable_drop_counters.py::test_dip_link_local[PORT_INGRESS_DROPS-DIP_LINK_LOCAL] PASSED [ 50%] drop_packets/test_configurable_drop_counters.py::test_dip_link_local[SWITCH_INGRESS_DROPS-DIP_LINK_LOCAL] SKIPPED [ 66%] drop_packets/test_configurable_drop_counters.py::test_sip_link_local[PORT_INGRESS_DROPS-SIP_LINK_LOCAL] PASSED [ 83%] drop_packets/test_configurable_drop_counters.py::test_sip_link_local[SWITCH_INGRESS_DROPS-SIP_LINK_LOCAL] SKIPPED [100%]
1 parent 02830fe commit a2b47d2

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

tests/drop_packets/test_configurable_drop_counters.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,21 @@ def vlan_mac(duthost):
5959
dut_vlan_mac = duthost.facts['router_mac']
6060
return dut_vlan_mac
6161

62+
63+
@pytest.fixture(autouse=True)
64+
def ignore_expected_loganalyzer_exception(duthosts, rand_one_dut_hostname, loganalyzer):
65+
if loganalyzer:
66+
ignore_regex_list = [
67+
".*ERR swss[0-9]*#orchagent.*meta_sai_validate_fdb_entry.*object key SAI_OBJECT_TYPE_FDB_ENTRY.*doesn't exist.*",
68+
".*ERR swss[0-9]*#orchagent.*removeFdbEntry: FdbOrch RemoveFDBEntry: Failed to remove FDB entry. mac=.*, bv_id=.*",
69+
".*ERR swss[0-9]*#orchagent.*handleSaiRemoveStatus: Encountered failure in remove operation, exiting orchagent, SAI API: SAI_API_FDB, status: SAI_STATUS_INVALID_PARAMETER.*",
70+
".*ERR syncd[0-9]*#syncd.*SAI_API_DEBUG_COUNTER:_brcm_sai_debug_counter_value_get.*No debug_counter at index.*found.*",
71+
".*ERR syncd[0-9]*#syncd.*collectPortDebugCounters: Failed to get stats of port.*"
72+
]
73+
duthost = duthosts[rand_one_dut_hostname]
74+
loganalyzer[duthost.hostname].ignore_regex.extend(ignore_regex_list)
75+
76+
6277
def apply_fdb_config(duthost, vlan_id, iface, mac_address, op, type):
6378
""" Generate FDB config file to apply it using 'swssconfig' tool.
6479
Generated config file template:
@@ -83,7 +98,7 @@ def apply_fdb_config(duthost, vlan_id, iface, mac_address, op, type):
8398
fdb_config_json.append(fdb_entry_json)
8499

85100
with tempfile.NamedTemporaryFile(suffix=".json", prefix="fdb_config") as fp:
86-
logging.info("Generating FDB config")
101+
logging.info("Generating FDB config: {}".format(fdb_config_json))
87102
json.dump(fdb_config_json, fp)
88103
fp.flush()
89104

@@ -167,7 +182,7 @@ def test_neighbor_link_down(testbed_params, setup_counters, duthosts, rand_one_d
167182
# FIXME: Add config reload on t0-backend as a workaround to keep DUT healthy because the following
168183
# drop packet testcases will suffer from the brcm_sai_get_port_stats errors flooded in syslog
169184
if "backend" in tbinfo["topo"]["name"]:
170-
config_reload(duthost)
185+
config_reload(duthost, safe_reload=True)
171186

172187

173188
@pytest.mark.parametrize("drop_reason", ["DIP_LINK_LOCAL"])

0 commit comments

Comments
 (0)