From 7ab19821b4235d170afbff7e943e92aac2b55a64 Mon Sep 17 00:00:00 2001 From: Dev Ojha <47282568+developfast@users.noreply.github.com> Date: Thu, 27 Oct 2022 18:14:55 -0700 Subject: [PATCH] Added python fixture for resetting config changes to fix nightly backend 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 --- tests/snmp/conftest.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/snmp/conftest.py b/tests/snmp/conftest.py index ec6909c81fa..be9b9fd7197 100644 --- a/tests/snmp/conftest.py +++ b/tests/snmp/conftest.py @@ -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.