Skip to content

Commit d23d9ae

Browse files
kanchanavelusamyKanchana-HCLTech
authored andcommitted
Skip GNMI check during teardown and disable LogAnalyzer for reboot tests
1 parent 9fcacf4 commit d23d9ae

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

tests/gnmi/conftest.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,13 @@ def setup_gnmi_server(duthosts, rand_one_dut_hostname, localhost, ptfhost):
210210

211211
# Rollback configuration
212212
rollback(duthost, SETUP_ENV_CP)
213-
recover_cert_config(duthost)
213+
# Get the skip_gnmi_check flag from duthost options
214+
skip_gnmi_check = duthost.host.options.get('skip_gnmi_check', False)
215+
# Skip GNMI restart if the reboot flag is set
216+
if not skip_gnmi_check:
217+
recover_cert_config(duthost)
218+
else:
219+
logging.info("Skipping GNMI restart due to skip_gnmi_check flag")
214220

215221

216222
@pytest.fixture(scope="module", autouse=True)

tests/gnmi/test_gnoi_system.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ def test_gnoi_system_reboot(duthosts, rand_one_dut_hostname, localhost):
4242
"""
4343
duthost = duthosts[rand_one_dut_hostname]
4444

45+
# Set flag to indicate that this test involves reboot
46+
duthost.host.options['skip_gnmi_check'] = True
47+
4548
# Trigger reboot
4649
ret, msg = gnoi_request(duthost, localhost, "Reboot", '{"method": 1}')
4750
pytest_assert(ret == 0, "System.Reboot API reported failure (rc = {}) with message: {}".format(ret, msg))

0 commit comments

Comments
 (0)