Author: gnichols
Date: 2011-01-31 21:16:04 +0000 (Mon, 31 Jan 2011)
New Revision: 762
Modified:
trunk/v7/hardwaretest.py
Log:
589739 - CPUSCALING test includes unprocessed tags around displayed text
Modified: trunk/v7/hardwaretest.py
===================================================================
--- trunk/v7/hardwaretest.py 2011-01-31 21:15:11 UTC (rev 761)
+++ trunk/v7/hardwaretest.py 2011-01-31 21:16:04 UTC (rev 762)
@@ -190,6 +190,7 @@
result = self.commands[self.command]()
except KeyError, e:
print "unknown command: " + self.command
+ print e
self.releaseLock()
return result
@@ -675,7 +676,7 @@
# create temp dir
tmpDirectory=tempfile.mkdtemp('',"v7-"+test.getName()+"-")
# put test files in temp dir
- if not self.installTest(self.environment.getSourceDirectory()+"/"+test.getName(), tmpDirectory):
+ if not self.installTest(os.path.join(self.environment.getSourceDirectory(), test.getName()), tmpDirectory):
return False
# Here goes! Actually run the test.
@@ -683,30 +684,29 @@
testError = False
# Walk the tmpdir and find any directory that contains a runtest.sh
returnValue = 1
- for directory in [i[0] for i in os.walk(tmpDirectory) if 'runtest.sh' in i[2]]:
+ try:
+ summary = Constants.FAIL
try:
- summary = Constants.FAIL
- try:
- returnValue = self.runTest(directory, test, run, outputFilePath)
- if returnValue is 0:
- summary = Constants.PASS
- except Exception, exception:
- print "Error: test raised exception:"
- print exception
- summary = Constants.ABORT
+ returnValue = self.runTest(tmpDirectory, test, run, outputFilePath)
+ if returnValue is 0:
+ summary = Constants.PASS
+ except Exception, exception:
+ print "Error: test raised exception:"
+ print exception
+ summary = Constants.ABORT
+
+ run.setSummary(summary)
+ run.getResultsAttachments(self.environment, outputFilePath)
+ self.certification.save(self.environment.getResultsPath())
+ print "saved to " + self.environment.getResultsPath()
+
+ if self.options.rhts:
+ self.reportToRHTS(test, run.getSummary(), outputFilePath)
- run.setSummary(summary)
- run.getResultsAttachments(self.environment, outputFilePath)
- self.certification.save(self.environment.getResultsPath())
- print "saved to " + self.environment.getResultsPath()
-
- if self.options.rhts:
- self.reportToRHTS(test, run.getSummary(), outputFilePath)
-
- except OSError, e:
- print "Test error: %s" % e
- syslog.syslog("Test error: %s" % e)
- testerror = True
+ except OSError, e:
+ print "Test error: %s" % e
+ syslog.syslog("Test error: %s" % e)
+ testerror = True
# Log the end of the test.
run.setEndTime(self.getCurrentUTCTime())
@@ -832,10 +832,12 @@
for testDocument in testDocuments:
test = self.planner.getTest(testDocument.getName())
- testParameters = self.getTestParameters()
- testParameters.set(Constants.DEVICE, testDocument.getLogicalDeviceName())
+ testParameters = TestParameters(testDocument, self)
test.setParameters(testParameters)
- if not test.verify():
+ if test.verify():
+ # allow test verify code to update test document
+ testDocument.setParameters(testParameters)
+ else:
failures += 1
if failures == 0:
@@ -995,6 +997,8 @@
def installTest(self, testDirectory,tmpDirectory):
"Install a test's files to the named tmpdir for running"
+ if self.Debugging != Constants.off:
+ print "installing test from %s into %s" % (testDirectory, tmpDirectory)
try:
cwd=os.getcwd()
os.chdir(testDirectory)
@@ -1033,10 +1037,11 @@
# find the test driver python and call it directly
test = self.planner.getTest(testDocument.getName())
- testParameters = self.getTestParameters()
- testParameters.set(Constants.DEVICE, testDocument.getLogicalDeviceName())
+ testParameters = TestParameters(testDocument, self)
testParameters.set(Constants.OUTPUTFILE, outputFilePath)
test.setParameters(testParameters)
+ if self.Debugging != Constants.off:
+ print "Test Parameters: %s" % testParameters
rv = test.run()
# restore stdout and stdin, and cwd
@@ -1248,24 +1253,5 @@
value = self.ui.prompt("Please enter the %s:" % tag, answers)
if len(value) > 0:
self.certification.setHardware(tag, value)
-
- def getTestParameters(self):
- parameters = TestParameters()
- # determine test server
- if self.testServer:
- self.certification.setTestServer(self.testServer)
- else:
- if self.certification.getTestServer():
- self.testServer = self.certification.getTestServer()
- parameters.set(Constants.TESTSERVER, self.testServer)
-
- parameters.set(Constants.DEBUG, self.options.debug)
-
- parameters.set(Constants.RUNMODE, self.options.mode)
-
- if self.command == "continue":
- runCommand = runCommand + "%s=%s " % (Constants.INCOMPLETE, "1")
-
- return parameters