Author: gnichols
Date: 2010-08-06 01:32:17 +0000 (Fri, 06 Aug 2010)
New Revision: 622
Modified:
trunk/tests/reboot/reboot.py
Log:
621056 - v7 failed after reboot test
Modified: trunk/tests/reboot/reboot.py
===================================================================
--- trunk/tests/reboot/reboot.py 2010-08-06 01:31:40 UTC (rev 621)
+++ trunk/tests/reboot/reboot.py 2010-08-06 01:32:17 UTC (rev 622)
@@ -39,6 +39,7 @@
def verifyKDump(self):
# if kdump is set up, use it
print "Checking kdump configuration"
+ verified = True
# these checks aren't required, leaving them for diagnostic purposes
kernelBootParams = Command("cat /proc/cmdline")
@@ -49,16 +50,24 @@
print "Found crashkernel=%s boot parameter" % kdump
except:
print "Warning: \"crashkernel\" is not set in boot
parameters"
+ verified = False
try:
- panicRebootTimeout = Command("cat /proc/sys/kernel/panic")
- timeout = panicRebootTimeout.getInteger()
- if timeout > 0:
- print "Kernel panic reboot timeout is %u" % timeout
- else:
- print "Warning: Panic reboot is disabled (/proc/sys/kernel/panic is
set to 0)"
+ procPanicTimeout = "/proc/sys/kernel/panic"
+ getPanic = Command("cat " + procPanicTimeout)
+ timeout = getPanic.getInteger()
+ print "Kernel panic reboot timeout is %u" % timeout
+ if timeout is 0:
+ print "Setting to 1 sec."
+ setPanic = Command("echo 1 > " + procPanicTimeout)
+ setPanic.echo()
+ if getPanic.getInteger() is not 1:
+ print "Error: could not set panic timeout"
+ verifited = False
except V7CommandException, e:
- print "Warning: could not read /proc/sys/kernel/panic"
+ print "Warning: could not set " + procPanicTimeout
+ print e
+ verified = False
print "Checking kdump service"
try:
@@ -66,11 +75,11 @@
kdump.getString("is operational")
print "kdump is running"
except V7CommandException, e:
- print "kdump is not running - can not test it"
+ print "Warning: kdump is not running - can not test it"
print e
- return False
+ verified = False
- return True
+ return verified
def reboot(self):
@@ -78,6 +87,11 @@
if self.getMode() != Constants.auto:
if not self.promptConfirm("Ready to restart?"):
return False
+
+ # we need a delay here to give v7 time to finish writing results.xml
+ sys.stdout.flush()
+ self.waitForLull()
+
rebootCommand = Command("shutdown -r 0")
try:
rebootCommand.echo()
@@ -98,6 +112,10 @@
if self.getMode() != Constants.auto:
if not self.promptConfirm("Ready to restart?"):
return False
+ # we need a delay here to give v7 time to finish writing results.xml
+ sys.stdout.flush()
+ self.waitForLull()
+
try:
Command("echo 1 > /proc/sys/kernel/sysrq").echo()
Command("echo \"c\" > /proc/sysrq-trigger").echo()
Show replies by date