Author: gnichols
Date: 2011-04-19 13:57:09 +0000 (Tue, 19 Apr 2011)
New Revision: 901
Modified:
trunk/v7/continuation.py
trunk/v7/hardwaretest.py
Log:
697863 - multiple reboot tests are not run correctly
Modified: trunk/v7/continuation.py
===================================================================
--- trunk/v7/continuation.py 2011-04-19 13:47:06 UTC (rev 900)
+++ trunk/v7/continuation.py 2011-04-19 13:57:09 UTC (rev 901)
@@ -34,6 +34,7 @@
self.method = None
self.timestamp = None
self.kernel = None
+ self.bootPrintPath = os.path.join(self.environment.getDataDirectory(), "bootprint")
def setInitConfig(self, marker, method=None):
@@ -45,7 +46,7 @@
theTime = time.localtime(time.time())
self.timestamp = self.documentWrapper.timeToString(theTime)
# save it off to the side
- timestamp = open(os.path.join(self.environment.getDataDirectory(), "bootprint"), "w")
+ timestamp = open(self.bootPrintPath, "w")
timestamp.write(self.timestamp + "\n")
if self.method:
timestamp.write(self.method + "\n")
@@ -59,12 +60,14 @@
chkconfig = Command("chkconfig --del v7")
chkconfig.echo()
+ def isInitialized(self):
+ return os.path.exists(self.bootPrintPath)
def verify(self, marker, maxReboots=1):
# get the log, verify rboot happened
runTimeStamp = None
try:
- timestamp = open(os.path.join(self.environment.getDataDirectory(), "bootprint"))
+ timestamp = open(self.bootPrintPath)
self.timestamp = timestamp.readline().strip()
method = timestamp.readline()
if method:
@@ -72,8 +75,9 @@
kernel = timestamp.readline()
if kernel:
self.kernel = kernel.strip()
+ timestamp.close()
+ os.remove(self.bootPrintPath)
- timestamp.close()
theTime = time.localtime(time.time())
duration = self.documentWrapper.duration(self.timestamp, self.documentWrapper.timeToString(theTime))
print "reboot took " + duration
Modified: trunk/v7/hardwaretest.py
===================================================================
--- trunk/v7/hardwaretest.py 2011-04-19 13:47:06 UTC (rev 900)
+++ trunk/v7/hardwaretest.py 2011-04-19 13:57:09 UTC (rev 901)
@@ -793,14 +793,18 @@
requestedTests.append(mandatoryTest)
# reboot test is a special case - really needs to run last
- try:
- reboot = requestedTestDict["reboot"]
- requestedTests.remove(reboot)
- requestedTests.append(reboot)
- except:
- pass
-
-
+ tests = list()
+ rebootTests = list()
+ for test in requestedTests:
+ if test.getName() != "reboot":
+ tests.append(test)
+ else:
+ rebootTests.append(test)
+ if rebootTests:
+ tests.extend(rebootTests)
+ return tests
+
+ # otherwise - debugging - don't add any tests
return requestedTests
def doCertify(self):