Skip to content

Commit

Permalink
[Vrf] Disable swss warm_boot flag after test_vrf_swss_warm_reboot (so…
Browse files Browse the repository at this point in the history
…nic-net#4636)

What is the motivation for this PR?
After PR - sonic-net/sonic-utilities#1460 additional check was added to ensure, that before issuing an warm_reboot there are no warm_reboot flags set. test_vrf_swss_warm_reboot enables warm_boot flag for swss by using cmd - config warm_restart enable swss, but after restart of swss, next test case fails to make warm_reboot of system due to this flag is still set. Error message:
Warm restart flag for swss is set. Please check if a warm restart for swss is in progress.

How did you do it?
Disable swss warm_boot flag after test_vrf_swss_warm_reboot.

How did you verify/test it?
Run vrf/test_vrf.py::TestVrfWarmReboot, test_vrf_system_warm_reboot gets executed.

Signed-off-by: Andrii-Yosafat Lozovyi <andrii-yosafatx.lozovyi@intel.com>
  • Loading branch information
AndriiLozovyi authored and AntonHryshchuk committed Jan 4, 2022
1 parent 9681474 commit 7e4d89d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/vrf/test_vrf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7e4d89d

Please sign in to comment.