Author: gnichols
Date: 2009-12-17 15:58:29 +0000 (Thu, 17 Dec 2009)
New Revision: 263
Modified:
trunk/v7/hardwaretest.py
Log:
525736 - Feat: CLI to manually provide/override vendor/make/model values in results.xml
Modified: trunk/v7/hardwaretest.py
===================================================================
--- trunk/v7/hardwaretest.py 2009-12-17 15:57:36 UTC (rev 262)
+++ trunk/v7/hardwaretest.py 2009-12-17 15:58:29 UTC (rev 263)
@@ -19,7 +19,6 @@
import syslog
import errno
import tempfile
-import md5
import time
import copy
import socket
@@ -92,6 +91,9 @@
parser.add_option("-e", "--enable",
action="store_true", dest="enable", default=False,
help="Re-enable a test")
+ parser.add_option("-d", "--model",
+ action="store_true", dest="model", default=False,
+ help="Edit model and vendor information")
parser.add_option("-s", "--rhts",
action="store_true", dest="rhts", default=False,
help="report test results to RHTS")
@@ -286,6 +288,9 @@
if self.options.server:
self.checkTestServer(self.options.server)
self.setServerOnTests()
+
+ if self.options.model:
+ self.editModel()
self.certification.save(self.environment.getResultsPath())
print "saved test plan to %s" % self.environment.getResultsPath()
@@ -607,7 +612,7 @@
# get HAL info
try:
hal=Hal()
- run.appendDevices(deviceClass.getDevices(hal))
+ run.appendDevices(deviceClass.getDevicesFromDetector(hal))
except dbus_bindings.DBusException, e:
print "Test error: %s" % e
syslog.syslog("Test error: %s" % e)
@@ -620,7 +625,7 @@
if not kudzu.isValid():
success = False
else:
- run.appendDevices(deviceClass.getDevices(kudzu))
+ run.appendDevices(deviceClass.getDevicesFromDetector(kudzu))
return success
@@ -1056,6 +1061,16 @@
except V7CommandException, e:
print "Error: HAL daemons \"%s\" is not running - please start it." % daemon
print e
+
+ def editModel(self):
+ editable = [Tags.vendor, Tags.make, Tags.model]
+ for tag in editable:
+ value = self.certification.getHardware(tag)
+ answers = list()
+ answers.append(value)
+ value = self.ui.prompt("Please enter the %s:" % tag, answers)
+ if len(value) > 0:
+ self.certification.setHardware(tag, value)