r412 - trunk/tests/info
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-03-04 19:06:54 +0000 (Thu, 04 Mar 2010)
New Revision: 412
Modified:
trunk/tests/info/info.py
Log:
555895 - FEAT: results.xml could divide out the various sub tests.
Modified: trunk/tests/info/info.py
===================================================================
--- trunk/tests/info/info.py 2010-03-04 19:06:34 UTC (rev 411)
+++ trunk/tests/info/info.py 2010-03-04 19:06:54 UTC (rev 412)
@@ -149,6 +149,8 @@
rpmVerify = Command("rpm -V --nomtime --nomode --nocontexts v7")
try:
rpmVerify.echo()
+ if len(rpmVerify.output) > 0 and "not installed" in rpmVerify.output[0]:
+ return False
return True
except V7CommandException, e:
print "Verification of v7 rpm failed"
@@ -406,28 +408,17 @@
def run(self):
success = True
-
- if self.checkKernel():
- print "Kernel check passed."
- else:
+ if not self.runSubTest(self.checkKernel, name="Kernel", description="Check OS kernel build, version"):
success = False
- print "Error: Kernel check failed."
- if self.checkV7():
- print "v7 Verify passed"
- else:
+ if not self.runSubTest(self.checkV7, name="Verify v7", description="Verify the v7 installation"):
success = False
- print "Error: v7 verification failed."
- if self.checkModules():
- print "Module check passed"
- else:
+ if not self.runSubTest(self.checkModules, name="Modules", description="Check kernel modules"):
success = False
- print "Error: Module check failed"
- if not self.generateSystemReport():
+ if not self.runSubTest(self.generateSystemReport, name="System Report", description="generate system report"):
success = False
- print "Error: sysreport failed"
if success:
return 0
14 years, 2 months
r411 - trunk/tests/network
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-03-04 19:06:34 +0000 (Thu, 04 Mar 2010)
New Revision: 411
Modified:
trunk/tests/network/network.py
Log:
555895 - FEAT: results.xml could divide out the various sub tests.
Modified: trunk/tests/network/network.py
===================================================================
--- trunk/tests/network/network.py 2010-03-04 19:05:53 UTC (rev 410)
+++ trunk/tests/network/network.py 2010-03-04 19:06:34 UTC (rev 411)
@@ -82,6 +82,10 @@
return testList
def prepareForRun(self):
+ if self.getTestServer() == None or self.getTestServer() == "unknown":
+ print "Error: No test server was set, test abort"
+ return False
+ print "using test server %s" % self.getTestServer()
hal = Hal()
self.interface = self.getLogicalDeviceName()
print "Testing interface %s" % self.interface
@@ -577,64 +581,65 @@
print "+----------%s info end----------+" % self.interface
print ""
sys.stdout.flush()
-
-
- def run(self):
- if self.getTestServer() == None or self.getTestServer() == "unknown":
- print "Error: No test server was set, test abort"
- return FAILED
- print "using test server %s" % self.getTestServer()
-
- self.prepareForRun()
+ return True
+ def configureInterfaces(self):
sys.stdout.flush()
- returnValue = None
if not self.bounceInterface():
print "Error: could not bounce interface %s" % self.interface
- return FAILED
+ return False
if self.isNFSRootSystem:
if not self.addRoute():
print "Error: could not add route for testing"
- return FAILED
+ return False
self.setSignalHandler(self.removeRoute)
else:
if not self.downAllOtherInterfaces():
print "Error: could not shutdown all other interfaces"
- return FAILED
+ return False
self.setSignalHandler(self.restoreAllOtherInterfaces)
if not self.createTestFile():
print ("Error: Unable to create test file")
+ return False
+
+ return True
+
+
+ def run(self):
+
+ if not self.runSubTest(self.prepareForRun, "Setup", "prepare for network testing"):
return FAILED
-
- self.printInfo()
+
+ if not self.runSubTest(self.configureInterfaces, "Interface Configuration"):
+ return FAILED
+
+ if not self.runSubTest(self.printInfo, "Info"):
+ return FAILED
# start testing
- returnValue = self.tcpTest()
- if returnValue == PASSED:
- returnValue = self.udpTest()
- if returnValue == PASSED:
- returnValue = self.nfsTest()
- if returnValue== PASSED:
- returnValue = self.icmpTest()
-
+ success = True
+ if not self.runSubTest(self.tcpTest, "TCP", "tcp latency and bandwidth test via lmbench"):
+ success = False
+ if not self.runSubTest(self.nfsTest, "NFS", "NFS file transfer test"):
+ success = False
+ if not self.runSubTest(self.icmpTest, "ICMP"):
+ success = False
+
self.setSignalHandler(None)
if self.isNFSRootSystem:
self.removeRoute()
else:
self.restoreAllOtherInterfaces()
- if returnValue == PASSED:
- result = "passed"
- else:
- returnValue = FAILED
- result = "failed"
+ if success:
+ return PASSED
- print "Network test on device %s %s" % (self.interface, result)
-
- return returnValue
+ # otherwise
+ return FAILED
+
if __name__ == "__main__":
14 years, 2 months
r410 - trunk/tests/fv_network
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-03-04 19:05:53 +0000 (Thu, 04 Mar 2010)
New Revision: 410
Modified:
trunk/tests/fv_network/fv_network.py
Log:
555895 - FEAT: results.xml could divide out the various sub tests.
Modified: trunk/tests/fv_network/fv_network.py
===================================================================
--- trunk/tests/fv_network/fv_network.py 2010-03-04 19:05:19 UTC (rev 409)
+++ trunk/tests/fv_network/fv_network.py 2010-03-04 19:05:53 UTC (rev 410)
@@ -32,7 +32,7 @@
def run(self):
if self.getTestServer() == None or self.getTestServer() == "unknown":
print "Error: No test server was set, test abort"
- return FAILED
+ return 1
# otherwise
print "Using test server %s" % self.getTestServer()
14 years, 2 months
r409 - trunk/tests/profiler
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-03-04 19:05:19 +0000 (Thu, 04 Mar 2010)
New Revision: 409
Modified:
trunk/tests/profiler/profiler.py
Log:
555895 - FEAT: results.xml could divide out the various sub tests.
Modified: trunk/tests/profiler/profiler.py
===================================================================
--- trunk/tests/profiler/profiler.py 2010-03-04 19:04:51 UTC (rev 408)
+++ trunk/tests/profiler/profiler.py 2010-03-04 19:05:19 UTC (rev 409)
@@ -203,11 +203,11 @@
PASSED = 0
try:
self.getLinuxImage()
- if not self.resetOProfile():
+ if not self.runSubTest(self.resetOProfile, "Reset"):
return FAILED
- if not self.startDaemon():
+ if not self.runSubTest(self.startDaemon, "Start Daemon"):
return FAILED
- if not self.startOProfile():
+ if not self.runSubTest(self.startOProfile, "Start OProfile"):
return FAILED
self.getOProfileVersion()
if not self.report() and not self.forceTimerConf():
@@ -219,6 +219,7 @@
except Exception, e:
print "Error: "
print e
+ self.closeOutput()
return FAILED
# reset - ignore if it fails
14 years, 2 months
r408 - trunk/tests/suspend
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-03-04 19:04:51 +0000 (Thu, 04 Mar 2010)
New Revision: 408
Modified:
trunk/tests/suspend/suspend.py
Log:
555895 - FEAT: results.xml could divide out the various sub tests.
Modified: trunk/tests/suspend/suspend.py
===================================================================
--- trunk/tests/suspend/suspend.py 2010-03-04 18:58:36 UTC (rev 407)
+++ trunk/tests/suspend/suspend.py 2010-03-04 19:04:51 UTC (rev 408)
@@ -217,14 +217,18 @@
result = PASSED
for source in [Constants.OSCommand, Constants.FunctionKey]:
for method in methods:
+ self.markOutput(name=source + "-" + method)
if not self.runSuspendResume(source, method):
result = FAILED
- continue
+ self.markSummary(Constants.FAIL)
elif self.verifiedResumeMethod != method:
result = FAILED
+ self.markSummary(Constants.FAIL)
+ else:
+ self.markSummary(Constants.PASS)
-
- return result
+ self.closeOutput()
+ return result
if __name__ == "__main__":
14 years, 2 months
r407 - trunk/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-03-04 18:58:36 +0000 (Thu, 04 Mar 2010)
New Revision: 407
Modified:
trunk/v7/documentbase.py
trunk/v7/hardwaretest.py
trunk/v7/rundocument.py
trunk/v7/tags.py
trunk/v7/test.py
Log:
555895 - FEAT: results.xml could divide out the various sub tests.
Modified: trunk/v7/documentbase.py
===================================================================
--- trunk/v7/documentbase.py 2010-03-04 18:56:19 UTC (rev 406)
+++ trunk/v7/documentbase.py 2010-03-04 18:58:36 UTC (rev 407)
@@ -83,6 +83,15 @@
textNode = self.document.createTextNode(value)
element.appendChild(textNode)
+ def addTextNode(self, element, value):
+ if value:
+ if type(value) == unicode:
+ value = value.encode('ascii')
+ value = self.removeBadCharacters(value)
+
+ textNode = self.document.createTextNode(value)
+ element.appendChild(textNode)
+
def getTextNode(self, element):
for node in element.childNodes:
if node.nodeType == node.TEXT_NODE:
@@ -188,11 +197,11 @@
print "Error: unknown device source %s" % source
raise Exception("Error: unknown device source %s"% source)
- def merge(self, documentFilePath):
+ def merge(self, documentFilePath, nodeIndex=1):
subdocument = DocumentBase()
subdocument.load(documentFilePath)
try:
- root = self.document.importNode(subdocument.document.childNodes[1], True) # True = deep copy
+ root = self.document.importNode(subdocument.document.childNodes[nodeIndex], True) # True = deep copy
self.element.appendChild(root)
except Exception, e:
print "Error: could not import document in " + documentFilePath
Modified: trunk/v7/hardwaretest.py
===================================================================
--- trunk/v7/hardwaretest.py 2010-03-04 18:56:19 UTC (rev 406)
+++ trunk/v7/hardwaretest.py 2010-03-04 18:58:36 UTC (rev 407)
@@ -947,13 +947,8 @@
def saveOutput(self, run, retval, outputFilePath):
print "saveOutput: %s" % outputFilePath
- outputFile = open(outputFilePath)
- contents = ""
- for line in outputFile:
- contents += line
- contents += "\n" #make sure there's a line break at the end.
run.setReturnValue(retval)
- run.setTestOutput(contents)
+ run.setTestOutput(outputFilePath)
def _getTestsFromOptions(self):
if self.options.device:
Modified: trunk/v7/rundocument.py
===================================================================
--- trunk/v7/rundocument.py 2010-03-04 18:56:19 UTC (rev 406)
+++ trunk/v7/rundocument.py 2010-03-04 18:58:36 UTC (rev 407)
@@ -14,7 +14,7 @@
#
# Author: Greg Nichols
#
-import string, os
+import string, os, re
import time
from xml.dom.minidom import getDOMImplementation, parse
import xml.dom.ext
@@ -122,22 +122,71 @@
systemElement = self.findOrCreateElement(self.element, Tags.system)
self.setTextNode(systemElement, log)
+ def getTestOutput(self):
+ return self.__getTestOutput(self.getChildElement(Tags.output))
- def getTestOutput(self):
- try:
- outputElement = self.getChildElement(Tags.output)
- if outputElement:
- return outputElement.childNodes[0].data
- #otherwise
- return None
- except IndexError:
- return None
+ def __getTestOutput(self, outputElement):
+ output = ""
+ for node in outputElement.childNodes:
+ if node.nodeType == node.ELEMENT_NODE and node.tagName == Tags.output:
+ output += "\nSection %s " % node.getAttribute(Attributes.name)
+ if node.getAttribute(Attributes.description):
+ output += " - " + node.getAttribute(Attributes.description)
+ output += "\n"
+ output += self.__getTestOutput(node)
+ output += "End Section\n"
+ elif node.nodeType == node.TEXT_NODE:
+ output += node.data
+ return output
- def setTestOutput(self, output):
+ def setTestOutputXXX(self, output):
+ print "NEW setTestOutput"
if output:
outputElement = self.findOrCreateElement(self.element, Tags.output)
- textNode = self.setTextNode(outputElement, output)
+ section = ""
+ outputElements = list()
+ pattern = re.compile("<output( name=\"(?P<name>[^\"]*)\")?( description=\"(?P<description>[^\"]*)\")?>")
+ for line in output:
+ print "LINE: " + line
+ match = pattern.match(line)
+ if match:
+ print "MATCHED: " + line
+ textNode = self.setTextNode(outputElement, section)
+ section = ""
+ outputElements.append(outputElement)
+ child = self.document.createElement(Tags.output)
+ outputElement.appendChild(child)
+ outputElement = child
+ outputElement.setAttribute(Attributes.name, match.group(Attributes.name))
+ outputElement.setAttribute(Attributes.description, match.group(Attributes.description))
+ elif "</output>" in line:
+ self.setTextNode(outputElement, section)
+ section = ""
+ outputElement = outputElements.pop()
+ else:
+ section += line
+
+ textNode = self.addTextNode(outputElement, section)
+
+ def setTestOutput(self, outputFile):
+ try:
+ self.merge(outputFile, nodeIndex=0)
+ return True
+ except Exception, e:
+ print "Warning: could not merge output XML, reading as text file."
+ print e
+
+ # parser failed, just read the file
+ file = open(outputFile)
+ output = file.readlines()
+ if output and len(output) < 0:
+ outputElement = self.findOrCreateElement(self.element, Tags.output)
+ textNode = self.setTextNode(outputElement, output.join())
+ return True
+
+
+
def getResults(self, environment, resultsFile):
try:
file = open(resultsFile, "r")
@@ -210,6 +259,10 @@
except Exception, e:
print "Error: "
print e
+
+ def deleteAttachments(self):
+ for attachment in self.getAttachments():
+ self.runElement.removeChild(attachment)
Modified: trunk/v7/tags.py
===================================================================
--- trunk/v7/tags.py 2010-03-04 18:56:19 UTC (rev 406)
+++ trunk/v7/tags.py 2010-03-04 18:58:36 UTC (rev 407)
@@ -86,6 +86,7 @@
function="function"
task_file="task_file"
maximum_attachment_size="maximum-attachment-size"
+ description="description"
Modified: trunk/v7/test.py
===================================================================
--- trunk/v7/test.py 2010-03-04 18:56:19 UTC (rev 406)
+++ trunk/v7/test.py 2010-03-04 18:58:36 UTC (rev 407)
@@ -49,6 +49,7 @@
self.logicalDeviceName = ""
self.mandatory = None # either pre or post for mandatory tests (for each run)
self.source = None # either hal, kudzu, or manual
+ self.marking = False # is <output> sub-section currently active?
try:
self.outputFile = os.environ[Constants.OUTPUTFILE]
@@ -400,3 +401,31 @@
"""Test should implement this method if they have package
requirements dependant on hardware or RHEL release"""
return list()
+
+ def markOutput(self, name, description=None):
+ self.closeOutput()
+ print "<output name=\"%s\" description=\"%s\">" % (name, description)
+ self.marking = True
+
+ def closeOutput(self):
+ if self.marking:
+ print "</output>"
+ self.marking = False
+
+ def markSummary(self, summary):
+ if type(summary) is str:
+ summaryString = summary
+ elif summary:
+ summaryString = Constants.PASS
+ else:
+ summaryString = Constants.FAIL
+ print "<summary>%s</summary>" % summaryString
+
+ def runSubTest(self, subtestFunction, name, description=None):
+ self.markOutput(name, description)
+ result = subtestFunction()
+ self.markSummary(result)
+ self.closeOutput()
+ return result
+
+
14 years, 2 months
r406 - trunk/tests/cpuscaling
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-03-04 18:56:19 +0000 (Thu, 04 Mar 2010)
New Revision: 406
Modified:
trunk/tests/cpuscaling/cpuscaling.py
Log:
489578 - Individual cpu core will fail cpuscaling depending upon what type of drive is used and whether INFO runs before or after test
Modified: trunk/tests/cpuscaling/cpuscaling.py
===================================================================
--- trunk/tests/cpuscaling/cpuscaling.py 2010-03-04 18:46:08 UTC (rev 405)
+++ trunk/tests/cpuscaling/cpuscaling.py 2010-03-04 18:56:19 UTC (rev 406)
@@ -321,6 +321,37 @@
except V7CommandException, exception:
print "Warning: could not read CPU flags"
print exception
+
+ def getLoadAvg(self):
+ loadAvgFile = "/proc/loadavg"
+ if os.path.exists(loadAvgFile):
+ file = open(loadAvgFile)
+ line = file.readline()
+ if len(line.strip()) > 0:
+ params = line.strip().split()
+ loadAvg = float(params[0])
+ print "Current load average: %s" % loadAvg
+ sys.stdout.flush
+ return loadAvg
+ else:
+ return 0
+
+
+ def syncDisks(self):
+ command = Command("/bin/sync")
+ command.echo()
+
+
+ def waitForLull(self):
+ waitTime = 5
+ retryLimit = 20
+
+ self.syncDisks()
+
+ retryCount = 0
+ while self.getLoadAvg() > 1 and retryCount < retryLimit:
+ time.sleep(waitTime)
+ retryCount = retryCount + 1
def runUserSpaceTests(self):
@@ -515,19 +546,20 @@
PASSED = 0
FAILED = 1
-
- if not self.getSystemCapabilities():
+ if not self.runSubTest(self.getSystemCapabilities, "Capabilities"):
return FAILED
+
+ self.waitForLull()
result = PASSED
- if not self.runUserSpaceTests():
+ if not self.runSubTest(self.runUserSpaceTests, "User Space"):
result = FAILED
- if not self.runOnDemandTests():
+ if not self.runSubTest(self.runOnDemandTests, "On Demand"):
result = FAILED
- if not self.runPerformanceTests():
+ if not self.runSubTest(self.runPerformanceTests, "Performance"):
result = FAILED
self.printSummary()
14 years, 2 months
r405 - trunk/tests/expresscard
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-03-04 18:46:08 +0000 (Thu, 04 Mar 2010)
New Revision: 405
Modified:
trunk/tests/expresscard/expresscard.py
Log:
526057 - ExpressCard test shows errors on successful test
Modified: trunk/tests/expresscard/expresscard.py
===================================================================
--- trunk/tests/expresscard/expresscard.py 2010-03-04 18:38:25 UTC (rev 404)
+++ trunk/tests/expresscard/expresscard.py 2010-03-04 18:46:08 UTC (rev 405)
@@ -215,7 +215,6 @@
foundPCIE = None
if self.count > 0 or not testedPCIE:
foundPCIE = self.addNewPCIPlugged(verifiedDevices)
- found = False
if not foundUSB and not foundPCIE:
print "Error: Device not found !"
@@ -242,7 +241,7 @@
self.pluggedInPCIDevices.append(deviceID)
confirmed = True
testedPCIE = True
- if not found:
+ if not foundPCIE and not foundUSB:
print "Error: Did not confirm the device !"
print "Please re-try"
14 years, 2 months
r404 - trunk/tests/core
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-03-04 18:38:25 +0000 (Thu, 04 Mar 2010)
New Revision: 404
Modified:
trunk/tests/core/CORE2
Log:
484512 - Clock jitter test - calculation technique
Modified: trunk/tests/core/CORE2
===================================================================
--- trunk/tests/core/CORE2 2010-03-04 16:07:42 UTC (rev 403)
+++ trunk/tests/core/CORE2 2010-03-04 18:38:25 UTC (rev 404)
@@ -43,7 +43,7 @@
# Run clock test, to catch machines with weird clocks.
echo "Checking clock jitter ..."
-./clocktest || exit 1
+nice -n -20 ./clocktest || exit 1
# run stress for 10m.
stress --cpu 12 --io 12 --vm 12 --vm-bytes 128M --timeout 10m
14 years, 2 months
r403 - trunk/tests/rteval
by David Sommerseth
Author: dsommers
Date: 2010-03-04 16:07:42 +0000 (Thu, 04 Mar 2010)
New Revision: 403
Modified:
trunk/tests/rteval/v7_rteval.py
Log:
Revert "Only require RT related packages if a RT kernel is found"
This change was not needed and changes behaviour on a not expected way.
This reverts commit 2c468d02a8b7acc818fc143ec11e8caea657ff71.
Modified: trunk/tests/rteval/v7_rteval.py
===================================================================
--- trunk/tests/rteval/v7_rteval.py 2010-03-04 16:07:33 UTC (rev 402)
+++ trunk/tests/rteval/v7_rteval.py 2010-03-04 16:07:42 UTC (rev 403)
@@ -40,10 +40,9 @@
self.path = "v7/tests/rteval"
self.version = "0.1"
self.description = "Realtime hardware evaluation tool"
- if self.realtime:
- self.requires = ["rt-setup", "rteval", "rteval-loads", "rt-tests"]
- if self.__read_sys_dmi("sys_vendor") == "IBM":
- self.requires.append("ibm-prtm")
+ self.requires = ["rt-setup", "rteval", "rteval-loads", "rt-tests"]
+ if self.realtime and self.__read_sys_dmi("sys_vendor") == "IBM":
+ self.requires.append("ibm-prtm")
def getRequiredRPMs(self):
return self.requires
14 years, 2 months