r872 - trunk/tests/reboot
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-04-14 16:20:44 +0000 (Thu, 14 Apr 2011)
New Revision: 872
Modified:
trunk/tests/reboot/reboot.py
Log:
635973 - reboot test should set vmcore size before testing kdump
Modified: trunk/tests/reboot/reboot.py
===================================================================
--- trunk/tests/reboot/reboot.py 2011-04-14 15:36:28 UTC (rev 871)
+++ trunk/tests/reboot/reboot.py 2011-04-14 16:20:44 UTC (rev 872)
@@ -36,7 +36,7 @@
self.continuation = Continuation(self.environment)
self.rebootTimeLimit = self.environment.getRebootTimelimit()
self.priority = 1001 # run last
- self.coreCollector = "makedumpfile -d31"
+ self.coreCollector = "makedumpfile -d 31"
self.kdumpConfigPath = "/etc/kdump.conf"
def getRequiredRPMs(self):
13 years, 1 month
r871 - in tags: . v7-V1-3R28/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-04-14 15:36:28 +0000 (Thu, 14 Apr 2011)
New Revision: 871
Added:
tags/v7-V1-3R28/
tags/v7-V1-3R28/v7/version.py
Log:
tag version
Copied: tags/v7-V1-3R28/v7/version.py (from rev 335, trunk/v7/version.py)
===================================================================
--- tags/v7-V1-3R28/v7/version.py (rev 0)
+++ tags/v7-V1-3R28/v7/version.py 2011-04-14 15:36:28 UTC (rev 871)
@@ -0,0 +1,5 @@
+
+# v7/version.py is automatically-generated - DO NOT EDIT
+version = '1.3'
+release = '28'
+rhel_version = '6'
13 years, 1 month
r870 - trunk
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-04-14 15:36:02 +0000 (Thu, 14 Apr 2011)
New Revision: 870
Modified:
trunk/v7.spec.in
Log:
changelog
Modified: trunk/v7.spec.in
===================================================================
--- trunk/v7.spec.in 2011-04-14 15:33:02 UTC (rev 869)
+++ trunk/v7.spec.in 2011-04-14 15:36:02 UTC (rev 870)
@@ -67,6 +67,15 @@
/etc/init.d/v7
%changelog
+* Thu Apr 14 2011 Greg Nichols <gnichols(a)redhat.com>
+
+V7 1.3 R28
+
+ 660214 - reboot test run results in unparsable info test logs
+ 635973 - reboot test should set vmcore size before testing kdump
+ 618358 - v7 server - fencing test requires fence-agents rpm
+ 681737 - core test reports PASS even though there is an error.
+
* Wed Apr 06 2011 Greg Nichols <gnichols(a)redhat.com>
V7 1.3 R27
13 years, 1 month
r869 - trunk/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-04-14 15:33:02 +0000 (Thu, 14 Apr 2011)
New Revision: 869
Modified:
trunk/v7/controller.py
Log:
681737 - core test reports PASS even though there is an Error :Could not find log messages since last boot in /var/log/messages
Modified: trunk/v7/controller.py
===================================================================
--- trunk/v7/controller.py 2011-04-14 15:27:50 UTC (rev 868)
+++ trunk/v7/controller.py 2011-04-14 15:33:02 UTC (rev 869)
@@ -114,8 +114,6 @@
# if we can't decode it, skip the whole line
continue
log.close()
- if marker == False:
- print "Error: Could not find log messages since last boot in %s!" % syslog
return contents
def getRedHatRelease(self):
13 years, 1 month
r868 - trunk/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-04-14 15:27:50 +0000 (Thu, 14 Apr 2011)
New Revision: 868
Modified:
trunk/v7/hardwaretest.py
Log:
660214 - reboot test run results in unparsable info test logs
Modified: trunk/v7/hardwaretest.py
===================================================================
--- trunk/v7/hardwaretest.py 2011-04-14 15:26:58 UTC (rev 867)
+++ trunk/v7/hardwaretest.py 2011-04-14 15:27:50 UTC (rev 868)
@@ -613,7 +613,7 @@
if len(tests) is 0:
print "All tests in the last test run are complete"
return False
- tests = self.addMandatoryTests(tests)
+ # tests = self.addMandatoryTests(tests) don't re-do mandatory tests on a continue.
self.planner = Planner(self.options, virtualization=self.getVirtualization())
self.planner.analyse(self.environment.getSourceDirectory())
return self._doRun(tests, continueRun=True)
13 years, 1 month
r867 - trunk/tests/reboot
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-04-14 15:26:58 +0000 (Thu, 14 Apr 2011)
New Revision: 867
Modified:
trunk/tests/reboot/reboot.py
Log:
635973 - reboot test should set vmcore size before testing kdump
Modified: trunk/tests/reboot/reboot.py
===================================================================
--- trunk/tests/reboot/reboot.py 2011-04-14 15:26:43 UTC (rev 866)
+++ trunk/tests/reboot/reboot.py 2011-04-14 15:26:58 UTC (rev 867)
@@ -36,20 +36,28 @@
self.continuation = Continuation(self.environment)
self.rebootTimeLimit = self.environment.getRebootTimelimit()
self.priority = 1001 # run last
+ self.coreCollector = "makedumpfile -d31"
+ self.kdumpConfigPath = "/etc/kdump.conf"
def getRequiredRPMs(self):
- rpms = ["kernel-debug", "kernel-debuginfo"]
+ rpms = ["kernel-debug", "kernel-debuginfo", "kexec-tools"]
return rpms
def tags(self):
return [TestTag.noninteractive, TestTag.certification]
- def verifyKDump(self):
+ def configureKDump(self):
# if kdump is set up, use it
print "Checking kdump configuration"
verified = True
+ # log kexec-tools installation
+ try:
+ kexecRPM = Command("rpm -q kexec-tools").getString()
+ print "kexec-tools installed: " + kexecRPM
+ except:
+ pass
- # these checks aren't required, leaving them for diagnostic purposes
+ # check crashkernel on kernel command line
kernelBootParams = Command("cat /proc/cmdline")
kdump = None
try:
@@ -60,6 +68,7 @@
print "Warning: \"crashkernel\" is not set in boot parameters"
verified = False
+ # check kernel panic timeout, and set to 1sec if necessary
try:
procPanicTimeout = "/proc/sys/kernel/panic"
getPanic = Command("cat " + procPanicTimeout)
@@ -76,7 +85,32 @@
print "Warning: could not set " + procPanicTimeout
print e
verified = False
+
+ # configure kdump to use makedumpfile -d 31
+ try:
+ configFile = ConfigFile(self.kdumpConfigPath)
+ coreCollector = configFile.getParameter("core_collector")
+ except IOError, exception:
+ print "Error: %s" % exception
+ return False
+ if not coreCollector:
+ print "Adding core_collector = %s to /etc/kdump.conf" % self.coreCollector
+ configFile.addParameter("core_collector", self.coreCollector)
+ print "restarting kdump with new configuration..."
+ try:
+ Command("service kdump stop").echo()
+ Command("service kdump start").echo()
+ except V7CommandException, exception:
+ print "Error: kdump restart failed"
+ print exception
+ exception.command.printErrors()
+ verified = False
+ else:
+ print "core_collector currently set to \"" + coreCollector + "\""
+
+
+
print "Checking kdump service"
try:
kdump = Command("service kdump status")
@@ -91,7 +125,8 @@
def reboot(self):
- usePanic = self.verifyKDump()
+ self.markOutput("initialize")
+ usePanic = self.configureKDump()
if usePanic:
print "The test will now cause a kernel panic to exercise kdump"
@@ -108,6 +143,7 @@
self.continuation.setInitConfig(self.Name(), method)
# we need a delay here to give v7 time to finish writing results.xml
+ self.closeOutput()
sys.stdout.flush()
self.waitForLull()
@@ -135,7 +171,7 @@
def verifyKDumpImage(self):
# parse /etc/kdump.conf to find the location of the image file
- configFile = ConfigFile("/etc/kdump.conf")
+ configFile = ConfigFile(self.kdumpConfigPath)
imageDirectory = configFile.getParameter("path")
if not imageDirectory:
imageDirectory = "/var/crash"
@@ -169,7 +205,8 @@
# run crash to see if it's a valid image
try:
# just run crash on it and quit, then look for the return value
- crash = Command("echo \"q\" | crash %s /usr/lib/debug/lib/modules/`uname -r`/vmlinux" % vmcorePath)
+ # using -s to supress startup output, then "sys" command for a summary, then "q" to quit the interpreter
+ crash = Command("echo \"sys\nq\" | crash -s %s /usr/lib/debug/lib/modules/`uname -r`/vmlinux" % vmcorePath)
crash.echo()
# if we get here, it must be OK
print "kdump image %s verified"% vmcorePath
@@ -187,10 +224,12 @@
FAILED = 1
if self.incomplete:
+ self.markOutput("verify")
result = self.continuation.verify(marker=self.Name())
self.continuation.removeInitConfig()
if self.continuation.getMethod() == Constants.panic:
result = self.verifyKDumpImage()
+ self.closeOutput()
else:
result = self.reboot()
13 years, 1 month
r866 - trunk/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-04-14 15:26:43 +0000 (Thu, 14 Apr 2011)
New Revision: 866
Modified:
trunk/v7/configfile.py
trunk/v7/continuation.py
trunk/v7/log.py
Log:
635973 - reboot test should set vmcore size before testing kdump
Modified: trunk/v7/configfile.py
===================================================================
--- trunk/v7/configfile.py 2011-04-14 15:20:55 UTC (rev 865)
+++ trunk/v7/configfile.py 2011-04-14 15:26:43 UTC (rev 866)
@@ -42,7 +42,7 @@
self.__parse()
if self.parameters:
try:
- return self.parameters["name"]
+ return self.parameters[name]
except KeyError:
pass
return None
@@ -53,6 +53,16 @@
if self.parameters:
for key in self.parameters:
print "%s = %s" % (key, self.parameters[key])
+
+ def addParameter(self, name, value):
+ if not self.getParameter(name):
+ file = open(self.filePath, "a")
+ file.write("%s %s\n" % (name, value))
+ file.close()
+ return True
+ # otherwise
+ return False
+
if __name__ == "__main__":
try:
confFile = ConfigFile("/etc/rc.local")
Modified: trunk/v7/continuation.py
===================================================================
--- trunk/v7/continuation.py 2011-04-14 15:20:55 UTC (rev 865)
+++ trunk/v7/continuation.py 2011-04-14 15:26:43 UTC (rev 866)
@@ -21,6 +21,7 @@
from v7.controller import Controller
from v7.environment import Environment
from v7.documentbase import DocumentWrapper
+from v7.redhatrelease import RedHatRelease
class Continuation(Controller):
@@ -32,6 +33,7 @@
self.rebootTimeLimit = 10 # minutes
self.method = None
self.timestamp = None
+ self.kernel = None
def setInitConfig(self, marker, method=None):
@@ -47,6 +49,7 @@
timestamp.write(self.timestamp + "\n")
if self.method:
timestamp.write(self.method + "\n")
+ timestamp.write(RedHatRelease().getKernel() + "\n")
timestamp.close()
# mark the log with this run time
markerName = "%s-%s" % (marker, self.timestamp)
@@ -66,15 +69,26 @@
method = timestamp.readline()
if method:
self.method = method.strip()
+ kernel = timestamp.readline()
+ if kernel:
+ self.kernel = kernel.strip()
+
timestamp.close()
theTime = time.localtime(time.time())
duration = self.documentWrapper.duration(self.timestamp, self.documentWrapper.timeToString(theTime))
print "reboot took " + duration
print "method: " + self.method
+ print "kernel: " + self.kernel
durationData = self.documentWrapper.durationData(self.timestamp, self.documentWrapper.timeToString(theTime))
if durationData.seconds > self.rebootTimeLimit*60:
print "Error: reboot took longer that %u minutes" % self.rebootTimeLimit
return False
+ kernel = RedHatRelease().getKernel()
+ if self.kernel != kernel:
+ print "Error: rebooted a different kernel:"
+ print " before: " + self.kernel
+ print " after: " + kernel
+ return False
log = self.getSystemLog("%s-%s" % (marker, self.timestamp.strip()), pid=False)
rebootCount = 0
for line in log.split('\n'):
Modified: trunk/v7/log.py
===================================================================
--- trunk/v7/log.py 2011-04-14 15:20:55 UTC (rev 865)
+++ trunk/v7/log.py 2011-04-14 15:26:43 UTC (rev 866)
@@ -13,29 +13,38 @@
#
# Author: Greg Nichols
-import sys
+import sys, os
class Log(object):
def __init__(self, filePath):
sys.stdout.flush()
+ try:
+ size = os.path.getsize(filePath)
+ except os.error:
+ size = 0
self.terminal = sys.stdout
- self.log = open(filePath, "w")
- self.log.write("<output>\n")
+ self.log = open(filePath, "a")
+ if size is 0:
+ self.log.write("<output>\n")
def write(self, message):
self.terminal.write(message)
- self.log.write(message)
+ if self.log:
+ self.log.write(message)
def logOnly(self, message):
self.log.write(message)
def flush(self):
self.terminal.flush()
+ if self.log:
+ self.log.flush()
def close(self):
self.log.write("</output>\n")
self.log.close()
+ self.log = None
def unitTest():
print "Creating log qq.txt"
13 years, 1 month
r865 - trunk
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-04-14 15:20:55 +0000 (Thu, 14 Apr 2011)
New Revision: 865
Modified:
trunk/Makefile
Log:
R28
Modified: trunk/Makefile
===================================================================
--- trunk/Makefile 2011-04-06 12:29:44 UTC (rev 864)
+++ trunk/Makefile 2011-04-14 15:20:55 UTC (rev 865)
@@ -14,7 +14,7 @@
# Author: Greg Nichols
V7_VERSION := 1.3
-V7_RELEASE := 27
+V7_RELEASE := 28
V7_VERSION_RELEASE := $(V7_VERSION)-$(V7_RELEASE)
V7_VERSION_PY := v7/version.py
V7_SVN_MODULE := svn+ssh://svn.fedorahosted.org/svn/v7
13 years, 1 month
r864 - trunk
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-04-06 12:29:44 +0000 (Wed, 06 Apr 2011)
New Revision: 864
Modified:
trunk/v7.spec.in
Log:
changelog
Modified: trunk/v7.spec.in
===================================================================
--- trunk/v7.spec.in 2011-04-06 12:27:33 UTC (rev 863)
+++ trunk/v7.spec.in 2011-04-06 12:29:44 UTC (rev 864)
@@ -67,6 +67,12 @@
/etc/init.d/v7
%changelog
+* Wed Apr 06 2011 Greg Nichols <gnichols(a)redhat.com>
+
+V7 1.3 R27
+
+ 593982 - FEAT: v7 should provide multiple results rpms when results.xml gets too large
+
* Thu Mar 31 2011 Greg Nichols <gnichols(a)redhat.com>
V7 1.3 R26
13 years, 1 month
r863 - trunk/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-04-06 12:27:33 +0000 (Wed, 06 Apr 2011)
New Revision: 863
Modified:
trunk/v7/certificationtest.py
trunk/v7/environment.py
trunk/v7/hardwaretest.py
trunk/v7/report.py
Log:
593982 - FEAT: v7 should provide multiple results rpms when results.xml gets too large
Modified: trunk/v7/certificationtest.py
===================================================================
--- trunk/v7/certificationtest.py 2011-04-06 12:14:30 UTC (rev 862)
+++ trunk/v7/certificationtest.py 2011-04-06 12:27:33 UTC (rev 863)
@@ -29,6 +29,7 @@
class CertificationDocument(DocumentBase):
def __init__(self, topElement=None, document=None, debugging=False):
+ DocumentBase.__init__(self)
self.element = topElement
self.document = document
self.currentTestElement = None
@@ -391,14 +392,15 @@
subtestsByName[subtest.getName()].append(subtest)
return subtestsByName
+ def deleteAttachments(self):
+ for attachmentElement in self.document.getElementsByTagName(Tags.attachment):
+ attachmentElement.parentNode.removeChild(attachmentElement)
+
if __name__ == "__main__":
doc = CertificationDocument()
doc.load("/var/v7/results.xml")
- for test in doc.getTests():
- for run in test.getRuns():
- run.merge("/var/v7/results.xml")
- print "merged"
- doc.save("test.xml")
+ doc.deleteAttachments()
+ doc.save("test.xml")
print "done"
Modified: trunk/v7/environment.py
===================================================================
--- trunk/v7/environment.py 2011-04-06 12:14:30 UTC (rev 862)
+++ trunk/v7/environment.py 2011-04-06 12:27:33 UTC (rev 863)
@@ -42,7 +42,7 @@
self.defaultGuestBootDirectory = '/usr/lib/xen/boot/'
self.defaultPartnerServerURL = "ftp://partners.redhat.com/a166eabc5cf5df158922f9b06e5e7b21/hwcert/"
self.defaultMaximumAttachmentFileSize = 64 * 1048576 # bytes
- self.defaultResultsWarningSize = 16 * 1048576 # bytes
+ self.defaultResultsWarningSize = 12 * 1048576 # bytes
self.defaultFVGuestTimelimit = 60 # minutes
self.defaultRebootTimelimit = 10 # minutes
Modified: trunk/v7/hardwaretest.py
===================================================================
--- trunk/v7/hardwaretest.py 2011-04-06 12:14:30 UTC (rev 862)
+++ trunk/v7/hardwaretest.py 2011-04-06 12:27:33 UTC (rev 863)
@@ -585,6 +585,8 @@
tests = self.certification.getFilteredTests(self.options)
if len(tests) > 0:
+ if not self.__checkResultsSize():
+ return False
tests = self.addMandatoryTests(tests)
print "\nRunning the following tests:"
@@ -814,6 +816,8 @@
tests = self.certification.getTaggedTests(tests, self.options.tag)
if len(tests) > 0:
+ if not self.__checkResultsSize():
+ return False
tests = self.addMandatoryTests(tests)
if not self.options.tag:
print "\nThe following tests are recommended to complete the certification:"
@@ -844,16 +848,25 @@
return False
return self.__verify(self.certification.getTests())
+
+ def __checkResultsSize(self):
+ if self.certification.getLoadedFileSize() < self.environment.getResultsWarningSize():
+ return True
+
+ # otherwise
+ print "Warning: the test results may be too large to submit to the hardware catalog."
+ print "File: %s is %u MB" % (self.certification.getLoadedFilePath(), int(self.certification.getLoadedFileSize()/1048576))
+ if self.options.mode != Constants.auto and self.ui.promptConfirm("Would you like to package the current results first?"):
+ self.doSubmit()
+ return False
+
+ # size warning was ignored (or mode auto)
+ return True
+
def __verify(self, testDocuments):
- # check the results file size
result = True
- if self.certification.getLoadedFileSize() > self.environment.getResultsWarningSize():
- result = False
- print "Warning: the test results may be too large to submit to the hardware catalog."
- print "File: %s is %u MB" % (self.certification.getLoadedFilePath(), int(self.certification.getLoadedFileSize()/1048576))
-
# just call verify on each test directly
failures = 0
@@ -887,11 +900,14 @@
def doSubmit(self):
self.load()
+ self.__submit()
+
+ def __submit(self):
if self.certification and self.certification.getNumberOfTestRuns() > 0:
report = Report(self.options, self.certification)
if report.WriteResultsRPM(self.environment.getLogDirectory()):
- print "Warning: not removing old logs"
- # self.removeLogFiles()
+ self.__save()
+ self.removeLogFiles()
print "done."
return True
# otherwise
@@ -903,6 +919,10 @@
def doSave(self):
self.load()
+ self.__save()
+
+
+ def __save(self):
if self.certification:
path = self.environment.getStoreDirectory()
self.makeDirectoryPath(path)
Modified: trunk/v7/report.py
===================================================================
--- trunk/v7/report.py 2011-04-06 12:14:30 UTC (rev 862)
+++ trunk/v7/report.py 2011-04-06 12:27:33 UTC (rev 863)
@@ -23,6 +23,8 @@
from v7.controller import Controller
from v7.command import Command, V7CommandException
from v7.hash import hashModule
+from v7.certificationtest import CertificationDocument
+from v7.environment import Environment
class Report(Controller):
@@ -32,6 +34,7 @@
self.Debugging = options.debug
self.specFileName = "v7-results-rpm.spec"
self.tarFileName = "v7-results.tar.bz2"
+ self.environment = Environment()
def Write(self):
if not self.certification:
@@ -198,8 +201,13 @@
# write the test plan and results xml to etc/v7
etcDirectory = submissionDirectory + "/etc/v7"
self.makeDirectoryPath(etcDirectory)
- shutil.copy(self.options.data + "/" + self.options.results, etcDirectory + "/.")
+ resultsXML = CertificationDocument()
+ resultsXML.load(os.path.join(self.options.data, self.environment.getResultsFileName()))
+ resultsXML.save(os.path.join(etcDirectory, self.environment.getResultsFileName()))
+ shutil.copy("/etc/v7.xml", os.path.join(etcDirectory, "v7.xml")) # save v7 environment settings
+
+
#write a system.conf for backwards compatability
self.generateRHR2systemConf(etcDirectory)
@@ -232,8 +240,9 @@
Command("echo \"\n%s\n----------------------------\" >> /var/v7/package.log" % rpmBuild.command).run()
rpmBuild.run()
- print "Moving the results rpm to data directory %s" % self.options.data
+
rpm = Command("cat /var/v7/package.log").getString(regex="Wrote: (?P<rpm>[^\ ]+)$", regexGroup="rpm", singleLine=False)
+ print "Moving the results rpm to %s" % os.path.join(self.options.data, os.path.basename(rpm.strip()))
Command("mv %s %s" % (rpm.strip(), self.options.data)).echo()
except V7CommandException, exception:
print exception
13 years, 1 month