Skip to content

Commit

Permalink
Added python fixture for resetting config changes to fix nightly back…
Browse files Browse the repository at this point in the history
…end snmp test failures (#6607)

In the nightly tests, there were snmp failures on the backend T0 and T1, the cause of which was related to config issues with the DUT, specifically the queue counterpoll being disabled by another test beforehand. To solve this issue, before any of the snmp tests are executed, the queue counterpoll is enabled in a python fixture in the associated conftest.py file.

What is the motivation for this PR?
Fix snmp test failures occuring in nightly tests on backend T0 and T1

How did you do it?
Adding a python fixture that enables the queue counterpoll before the snmp tests are run

How did you verify/test it?
Ran the snmp test suite on a DUT in the lab, with the config disabled initially to see that the tests pass
  • Loading branch information
developfast authored and wangxin committed Oct 31, 2022
1 parent c79569b commit 7ab1982
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/snmp/conftest.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import pytest
from tests.common.utilities import wait_until


@pytest.fixture(scope="module", autouse=True)
def setup_check_snmp_ready(duthosts):
for duthost in duthosts:
assert wait_until(300, 20, 0, duthost.is_service_fully_started, "snmp"), "SNMP service is not running"


@pytest.fixture(scope="module", autouse=True)
def enable_queue_counterpoll_type(duthosts):
for duthost in duthosts:
duthost.command('counterpoll queue enable')


def pytest_addoption(parser):
"""
Adds options to pytest that are used by the snmp tests.
Expand Down

0 comments on commit 7ab1982

Please sign in to comment.