Skip to content

Commit

Permalink
Added a test case for fast reboot from other vendor NOS to SONiC.
Browse files Browse the repository at this point in the history
Details:
A new test case was added to fast reboot script.
This test case mimics a fast reboot from other vendor nos to SONiC, by flushing all DBs that
are part of the boot process, so the boot will be initiated with clean DBs as if it was booting from other nos.
  • Loading branch information
AharonMalkin committed Nov 3, 2022
1 parent 36e72ff commit 78bac90
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/common/fixtures/advanced_reboot.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def __extractTestParam(self):
if self.rebootLimit is None:
if self.kvmTest:
self.rebootLimit = 200 # Default reboot limit for kvm
elif 'warm-reboot' in self.rebootType:
elif 'warm-reboot' in self.rebootType:
self.rebootLimit = 0
else:
self.rebootLimit = 30 # Default reboot limit for physical devices
Expand Down
8 changes: 5 additions & 3 deletions tests/platform_tests/test_advanced_reboot.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ def test_fast_reboot_from_other_vendor(duthosts, rand_one_dut_hostname, request
duthost = duthosts[rand_one_dut_hostname]
advancedReboot = get_advanced_reboot(rebootType='fast-reboot', other_vendor_nos = True,\
advanceboot_loganalyzer=advanceboot_loganalyzer)
preboot_oper = flush_dbs(duthost)
advancedReboot.runRebootTestcase(preboot_setup = preboot_oper)
# Before rebooting, we will flush all unnecessary databases, to mimic reboot from other vendor.
flush_dbs(duthost)
advancedReboot.runRebootTestcase()

@pytest.mark.device_type('vs')
def test_warm_reboot(request, get_advanced_reboot, verify_dut_health,
Expand Down Expand Up @@ -158,4 +159,5 @@ def flush_dbs(duthost):
6: 'State DB'
}
for db in db_dic.keys():
duthost.shell('redis-cli -n {} flushdb'.format(db))
duthost.shell('redis-cli -n {} flushdb'.format(db))

0 comments on commit 78bac90

Please sign in to comment.