Skip to content

Commit 6e9d2ee

Browse files
committed
OpTestFastReboot: fix-up disabling fast reset for run_command api changes
also fix the counting for a single fast-reset Fixes: 7468689 Fixes: 2f9e23d Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
1 parent b2716b6 commit 6e9d2ee

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

testcases/OpTestFastReboot.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def runTest(self):
101101
initialResetCount = self.get_fast_reset_count(c)
102102
print ""
103103
print "INITIAL reset count: %d" % initialResetCount
104-
for i in range(1, self.number_reboots_to_do()):
104+
for i in range(0, self.number_reboots_to_do()):
105105
loopResetCount = self.get_fast_reset_count(c)
106106
# We do some funny things with the raw console here, as
107107
# 'reboot' isn't meant to return, so we want the raw
@@ -128,8 +128,12 @@ def runTest(self):
128128
print "Completed Fast reboot cycle %d" % i
129129

130130
c.run_command(BMC_CONST.NVRAM_DISABLE_FAST_RESET_MODE)
131-
res = c.run_command(BMC_CONST.NVRAM_PRINT_FAST_RESET_VALUE)
132-
self.assertNotIn("feeling-lucky", res, "Failed to set the fast-reset mode")
131+
try:
132+
res = c.run_command(BMC_CONST.NVRAM_PRINT_FAST_RESET_VALUE)
133+
except CommandFailed as cf:
134+
self.assertEqual(cf.exitcode, 255, "getting unset fast-reboot is meant to fail!")
135+
else:
136+
self.assertTrue(False, "We expected to fail at getting cleared fast-reset nvram variable")
133137

134138
class FastRebootHost(OpTestFastReboot):
135139
def boot_to_os(self):

0 commit comments

Comments
 (0)