Author: gnichols
Date: 2011-07-21 13:33:06 +0000 (Thu, 21 Jul 2011)
New Revision: 1023
Modified:
trunk/v7/hardwaretest.py
Log:
573598 - Test Suite should give a caution when user disable INFO test.
Modified: trunk/v7/hardwaretest.py
===================================================================
--- trunk/v7/hardwaretest.py 2011-07-21 13:31:15 UTC (rev 1022)
+++ trunk/v7/hardwaretest.py 2011-07-21 13:33:06 UTC (rev 1023)
@@ -594,7 +594,8 @@
if not self.__checkResultsSize():
return False
tests = self.addMandatoryTests(tests)
-
+ if not tests:
+ return False
print "\nRunning the following tests:"
for test in tests:
udi = test.getShortUDI()
@@ -811,6 +812,11 @@
return tests
# otherwise - debugging - don't add any tests
+ print "Warning: Test runs in debug mode are invalid for
certification."
+ if self.certification.getMandatoryTests():
+ print "The following tests will be skipped: %s" % ",
".join(map(TestDocument.getName, self.certification.getMandatoryTests()))
+ if not self.ui.promptConfirm("Do you wish to continue?"):
+ return None
return requestedTests
def doCertify(self):
@@ -830,6 +836,8 @@
if not self.__checkResultsSize():
return False
tests = self.addMandatoryTests(tests)
+ if not tests:
+ return False
if not self.options.tag:
print "\nThe following tests are recommended to complete the
certification:"
else:
@@ -1144,30 +1152,20 @@
print "HardwareTest.setTestsEnabled:"
disabled = True
output = "Disabled"
+ count = 0
if self.options.enable:
disabled = False
output = "Enabled"
for test in tests:
+ 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 self.Debugging:
print (output + " test: %s udi: %s") % (test.getName(),
test.getUDI())
- print (output + " %u tests") % len(tests)
+ print (output + " %u tests") % count
- def setTestsEnabled(self):
- tests = self._getTestsFromOptions()
- if self.Debugging:
- print "HardwareTest.setTestsEnabled:"
- disabled = True
- output = "Disabled"
- if self.options.enable:
- disabled = False
- output = "Enabled"
- for test in tests:
- test.setDisabled(disabled)
- if self.Debugging:
- print (output + " test: %s udi: %s") % (test.getName(),
test.getUDI())
- print (output + " %u tests") % len(tests)
-
def setServerOnTests(self):
tests = self._getTestsFromOptions()
if self.Debugging:
Show replies by date