From 689eac3c0893ca2ab23ae827864058ea13d50f7c Mon Sep 17 00:00:00 2001 From: roman_savchuk Date: Fri, 19 Aug 2022 20:14:15 +0300 Subject: [PATCH] Move ignore logs from TC to conftest for sub ports suite (#6175) PR #5951 introduced 2 error log ignore while running sub_port_interfaces test suite. Sub port folder has 2 more cases that need those skip to be performed What is the motivation for this PR? Enable ignore for all sub port test suite How did you do it? Move ignore fixture from test to conftest scope How did you verify/test it? Run TC, all passed --- tests/sub_port_interfaces/conftest.py | 9 +++++++++ tests/sub_port_interfaces/test_sub_port_interfaces.py | 9 --------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/sub_port_interfaces/conftest.py b/tests/sub_port_interfaces/conftest.py index ca9902a2e0..3919c0a3a4 100644 --- a/tests/sub_port_interfaces/conftest.py +++ b/tests/sub_port_interfaces/conftest.py @@ -591,3 +591,12 @@ def teardown_test_class(duthost): """ yield config_reload(duthost) + +@pytest.fixture(autouse=True) +def ignore_expected_loganalyzer_exception(duthost, loganalyzer): + if loganalyzer and loganalyzer[duthost.hostname]: + ignore_regex_list = [ + ".*ERR teamd[0-9]*#tlm_teamd.*process_add_queue: Can't connect to teamd after.*attempts. LAG 'PortChannel.*'", + ".*ERR swss[0-9]*#orchagent.*update: Failed to get port by bridge port ID.*" + ] + loganalyzer[duthost.hostname].ignore_regex.extend(ignore_regex_list) diff --git a/tests/sub_port_interfaces/test_sub_port_interfaces.py b/tests/sub_port_interfaces/test_sub_port_interfaces.py index d7e12f6b1d..5b53e9164c 100644 --- a/tests/sub_port_interfaces/test_sub_port_interfaces.py +++ b/tests/sub_port_interfaces/test_sub_port_interfaces.py @@ -477,12 +477,3 @@ def test_balancing_sub_ports(self, duthost, ptfhost, ptfadapter, apply_balancing type_of_traffic='balancing', ttl=63) - -@pytest.fixture(autouse=True) -def ignore_expected_loganalyzer_exception(duthost, loganalyzer): - if loganalyzer and loganalyzer[duthost.hostname]: - ignore_regex_list = [ - ".*ERR teamd[0-9]*#tlm_teamd.*process_add_queue: Can't connect to teamd after.*attempts. LAG 'PortChannel.*'", - ".*ERR swss[0-9]*#orchagent.*update: Failed to get port by bridge port ID.*" - ] - loganalyzer[duthost.hostname].ignore_regex.extend(ignore_regex_list)