Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions tests/generic_config_updater/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,35 @@

from tests.common.utilities import skip_release

@pytest.fixture(autouse=True)
def ignore_expected_loganalyzer_exceptions(duthost, loganalyzer):
"""
Ignore expected yang validation failure during test execution

GCU will try several sortings of JsonPatch until the sorting passes yang validation

Args:
loganalyzer: Loganalyzer utility fixture
"""
# When loganalyzer is disabled, the object could be None
if loganalyzer:
ignoreRegex = [
".*ERR sonic_yang.*",
".*ERR bgp#bgpcfgd.*Can't update the peer. Only 'admin_status' attribute is supported.*", # test_bgpl
".*ERR bgp#bgpcfgd: BGPAllowListMgr::Received BGP ALLOWED 'SET' message with no prefixes specified: {'NULL': 'NULL'}.*", # test_bgp_prefix
".*ERR.*Failed to start dhcp_relay container.*", # test_dhcp_relay
".*ERR GenericConfigUpdater: Service Validator: Service has been reset.*", # test_dhcp_relay test_syslog
".*Same listen range is attached to peer-group.*", # test_bgp_speaker -> real issue
".*ERR swss[0-9]*#orchagent.*removeLag.*", # autorestart/test_container_autorestart.py test_portchannel_interface
".*ERR swss[0-9]*#intfmgrd: :- setIntfVrf:.*", # test_portchannel_interface
".*ERR teamd.*get_dump: Can't get dump for LAG.*", # test_portchannel_interface
".*ERR kernel.*Reset adapter.*", # test_portchannel_interface replace mtu
".*ERR swss[0-9]*#orchagent: :- getPortOperSpeed.*", # test_portchannel_interface replace mtu
".*ERR.*Failed to apply Json change.*", # validator need updater submodule
".*ERR GenericConfigUpdater: Change Applier: service invoked.*", # validator need updater submodule
Copy link
Collaborator

@wangxin wangxin Mar 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are all these errors only be triggered during GCU testing? If these errors can be observed in other tests, they need to be added to the common ignore list. Otherwise, this change only "fix" the GCU testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These error are only for GCU test.

]
loganalyzer[duthost.hostname].ignore_regex.extend(ignoreRegex)

@pytest.fixture(scope="module", autouse=True)
def check_image_version(duthost):
"""Skips this test if the SONiC image installed on DUT is older than 202112
Expand Down
2 changes: 1 addition & 1 deletion tests/generic_config_updater/test_syslog.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def syslog_config_add_default(duthost):
add_syslog_server = duthost.shell("config syslog add {}".format(syslog_server),
module_ignore_errors=True)
pytest_assert(not add_syslog_server['rc'],
"syslog server '{}' is not deleted successfully".format(syslog_server))
"syslog server '{}' is not added successfully".format(syslog_server))

@pytest.fixture(scope="module")
def original_syslog_servers(duthost, tbinfo):
Expand Down