From 61d9980b6dcfe9079adac8cef25af35adf8aa364 Mon Sep 17 00:00:00 2001 From: Andrii-Yosafat Lozovyi Date: Fri, 5 Nov 2021 03:15:05 -0700 Subject: [PATCH] [Vrf] Disable swss warm_boot flag after test_vrf_swss_warm_reboot Signed-off-by: Andrii-Yosafat Lozovyi --- tests/vrf/test_vrf.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/vrf/test_vrf.py b/tests/vrf/test_vrf.py index ad183a68d97..7ef8f105800 100644 --- a/tests/vrf/test_vrf.py +++ b/tests/vrf/test_vrf.py @@ -519,6 +519,15 @@ def ptf_test_port_map(tbinfo, duthosts, mg_facts, ptfhost, rand_one_dut_hostname } ptfhost.copy(content=json.dumps(ptf_test_port_map), dest=PTF_TEST_PORT_MAP) +@pytest.fixture() +def disable_swss_warm_boot_flag(duthosts, rand_one_dut_hostname): + yield + + duthost = duthosts[rand_one_dut_hostname] + swss_flag = duthost.shell("sonic-db-cli STATE_DB HGET 'WARM_RESTART_ENABLE_TABLE|swss' 'enable'")['stdout'] + if swss_flag == 'true': + duthost.shell("config warm_restart disable swss") + # tests class TestVrfCreateAndBind(): def test_vrf_in_kernel(self, duthosts, rand_one_dut_hostname, cfg_facts): @@ -1007,6 +1016,7 @@ def setup_vrf_warm_reboot(self, ptfhost, tbinfo): #FIXME Might need cold reboot if test failed? pass + @pytest.mark.usefixtures('disable_swss_warm_boot_flag') def test_vrf_swss_warm_reboot(self, duthosts, rand_one_dut_hostname, cfg_facts, partial_ptf_runner): duthost = duthosts[rand_one_dut_hostname] # enable swss warm-reboot