Author: gnichols
Date: 2011-08-18 19:01:13 +0000 (Thu, 18 Aug 2011)
New Revision: 1042
Modified:
trunk/v7/certificationtest.py
trunk/v7/daemon.py
trunk/v7/deviceclassdocument.py
trunk/v7/environment.py
trunk/v7/hardwaretest.py
trunk/v7/opticalDiskTest.py
trunk/v7/report.py
trunk/v7/tags.py
Log:
731322 - network test gives 404 when trying fetching files from servers
Modified: trunk/v7/certificationtest.py
===================================================================
--- trunk/v7/certificationtest.py 2011-08-18 18:55:04 UTC (rev 1041)
+++ trunk/v7/certificationtest.py 2011-08-18 19:01:13 UTC (rev 1042)
@@ -187,7 +187,7 @@
tests.append(test)
else:
for name, deviceClass in self.deviceClasses.items():
- tests.extend(deviceClass.getTests(names))
+ tests.extend(deviceClass.getTests(names, onlyFailures, False))
tests.sort()
return tests
Modified: trunk/v7/daemon.py
===================================================================
--- trunk/v7/daemon.py 2011-08-18 18:55:04 UTC (rev 1041)
+++ trunk/v7/daemon.py 2011-08-18 19:01:13 UTC (rev 1042)
@@ -34,6 +34,7 @@
self.planner = planner
def __clearPipes(self):
+ self.makeDirectoryPath(os.path.dirname(self.environment.getTaskFilePath()))
try:
os.remove(self.environment.getTaskFilePath()+ ".in")
except OSError, e:
Modified: trunk/v7/deviceclassdocument.py
===================================================================
--- trunk/v7/deviceclassdocument.py 2011-08-18 18:55:04 UTC (rev 1041)
+++ trunk/v7/deviceclassdocument.py 2011-08-18 19:01:13 UTC (rev 1042)
@@ -93,7 +93,8 @@
if element.nodeName == Tags.test:
test = TestDocument(element, self.document)
if names == "" or test.getName() in names:
- tests.append(test)
+ if not onlyFailures or (onlyFailures and test.hasFailures()):
+ tests.append(test)
return tests
def getTestsGroupedByName(self):
Modified: trunk/v7/environment.py
===================================================================
--- trunk/v7/environment.py 2011-08-18 18:55:04 UTC (rev 1041)
+++ trunk/v7/environment.py 2011-08-18 19:01:13 UTC (rev 1042)
@@ -34,6 +34,7 @@
self.defaultTaskFile = "tasks"
self.defaultLockFile = "/var/lock/subsys/v7"
self.defaultStoreDirectory = "/var/v7/store"
+ self.defaultTransfer = "transfer"
self.defaultSourceDirectory = "/usr/share/v7/tests"
self.defaultLibraryDirectory = "/usr/share/v7/lib"
self.defaultLogDirectory = "/var/log/v7"
@@ -75,6 +76,7 @@
element = self.findOrCreateElement(filesystemElement, Tags.server_directory)
self.setTextNode(element, self.defaultServerDirectory)
element.setAttribute(Attributes.export, self.defaultExport)
+ element.setAttribute(Attributes.transfer, self.defaultTransfer)
element = self.findOrCreateElement(filesystemElement, Tags.store_directory)
@@ -122,6 +124,7 @@
if not self.getTextNode(serverDirectoryElement):
self.setTextNode(serverDirectoryElement, self.defaultServerDirectory)
serverDirectoryElement.setAttribute(Attributes.export, self.defaultExport)
+ serverDirectoryElement.setAttribute(Attributes.transfer, self.defaultTransfer)
self.save(self.environmentFile)
return self.getTextNode(serverDirectoryElement).data
@@ -130,6 +133,11 @@
serverDirectoryElement = self.findOrCreateElement(self._getFilesystemElement(), Tags.server_directory)
return serverDirectoryElement.getAttribute(Attributes.export)
+ def getServerTransfer(self):
+ self.getServerDirectory() # so it gets created if not found
+ serverDirectoryElement = self.findOrCreateElement(self._getFilesystemElement(), Tags.server_directory)
+ return serverDirectoryElement.getAttribute(Attributes.transfer)
+
def getStoreDirectory(self):
storeDirectoryElement = self.findOrCreateElement(self._getFilesystemElement(), Tags.store_directory)
return self.getTextNode(storeDirectoryElement).data
Modified: trunk/v7/hardwaretest.py
===================================================================
--- trunk/v7/hardwaretest.py 2011-08-18 18:55:04 UTC (rev 1041)
+++ trunk/v7/hardwaretest.py 2011-08-18 19:01:13 UTC (rev 1042)
@@ -710,13 +710,16 @@
returnValue = 1
try:
summary = Constants.FAIL
- try:
+ if True:
+ # try:
returnValue = self.runTest(tmpDirectory, test, run, outputFilePath)
if returnValue is 0:
summary = Constants.PASS
- except Exception, exception:
+ if False:
+ # except Exception, exception:
print "Error: test raised exception:"
print exception
+ sys.stdout.flush()
summary = Constants.ABORT
# if debugging, re-raise the exception to show tracebacks, etc.
if self.Debugging:
@@ -976,8 +979,8 @@
# otherwise, check the certification's test server
if not self.testServer:
self.testServer = self.certification.getTestServer()
-
- if self.testServer and self.ui.promptConfirm("Copy results to test server %s?" % self.testServer):
+
+ if self.testServer and (self.options.mode == Constants.auto or self.ui.promptConfirm("Copy results to test server %s?" % self.testServer)):
request = V7Http(self.testServer, "/v7/cgi/saveFile.py")
request.addField("server-path", serverPath)
return request.httpUpload(savedFilePath+".gz")
@@ -1176,8 +1179,12 @@
if disabled and test.getMandatory():
print "The %s test must be included in every test run and can not be disabled." % test.getName()
continue
- test.setDisabled(disabled)
- count = count + 1
+ if test.isDisabled() != disabled:
+ test.setDisabled(disabled)
+ count = count + 1
+ else:
+ print "test %s is already %s" % (test.getName(), output)
+
if self.Debugging:
print (output + " test: %s udi: %s") % (test.getName(), test.getUDI())
print (output + " %u tests") % count
Modified: trunk/v7/opticalDiskTest.py
===================================================================
--- trunk/v7/opticalDiskTest.py 2011-08-18 18:55:04 UTC (rev 1041)
+++ trunk/v7/opticalDiskTest.py 2011-08-18 19:01:13 UTC (rev 1042)
@@ -96,7 +96,13 @@
rpms.append("cdrecord")
return rpms
-
+ def getMediaChoice(self):
+ # default to the most-capable media
+ self.mediaChoice = self.supportedMedia[0]
+ if not self.promptConfirm("Would you like to test %s media?" % self.printMediaName(self.mediaChoice)):
+ choice = self.prompt("Please choose the media to be tested: ", map(self.printMediaName, self.supportedMedia))
+ self.mediaChoice = self.convertMediaName(choice)
+
def handleEject(self,cdromDevice):
"""testing the eject and reload functions. also some devices (e.g. Philips) need to eject the medium before creating a new disk."""
deviceFile = "/dev/" + cdromDevice
@@ -231,6 +237,8 @@
mediaName = mediaName.replace("CD", "CD-")
elif mediaName == "CD":
mediaName = "CDROM"
+ elif "BD" in mediaName and mediaName != "BD":
+ mediaName = mediaName.replace("BD", "BD-")
return mediaName.lower()
def convertMediaName(self, name):
@@ -479,17 +487,14 @@
return True
def testDisk(self, message, readWriteMode, type):
-
- # BD test has it's own media check and user prompt
- if type != 'bd':
- # ask user to insert a disk
- try:
- Command("eject /dev/%s" % self.getLogicalDeviceName()).run()
- self.prompt("Please insert a %s disk into %s and then press ENTER to continue !" % (message, self.getLogicalDeviceName()))
- Command("eject -t /dev/%s" % self.getLogicalDeviceName())
- except V7CommandException, exception:
- print exception
- # should failures in the eject command be test failures?
+ # ask user to insert a disk
+ try:
+ Command("eject /dev/%s" % self.getLogicalDeviceName()).run()
+ self.prompt("Please insert a %s disk into %s and then press ENTER to continue !" % (message, self.getLogicalDeviceName()))
+ Command("eject -t /dev/%s" % self.getLogicalDeviceName())
+ except V7CommandException, exception:
+ print exception
+ # should failures in the eject command be test failures?
time.sleep(10)
print "\n +++ Start testing ... \n"
Modified: trunk/v7/report.py
===================================================================
--- trunk/v7/report.py 2011-08-18 18:55:04 UTC (rev 1041)
+++ trunk/v7/report.py 2011-08-18 19:01:13 UTC (rev 1042)
@@ -90,8 +90,11 @@
def WriteTests(self, tests):
+ if not tests:
+ print "No tests match"
+ return
if self.certification.getNumberOfTestRuns() is 0:
- print "No test results found"
+ print "No test runs found"
return
if self.options.latest:
runNumber = self.certification.getNumberOfTestRuns()
Modified: trunk/v7/tags.py
===================================================================
--- trunk/v7/tags.py 2011-08-18 18:55:04 UTC (rev 1041)
+++ trunk/v7/tags.py 2011-08-18 19:01:13 UTC (rev 1042)
@@ -107,8 +107,8 @@
reboot_timelimit="reboot-timelimit"
results_warning_size="results-warning-size"
export="export"
+ transfer="transfer"
-
class Constants:
PASS="PASS"
FAIL="FAIL"