Author: gnichols
Date: 2012-03-02 18:39:28 +0000 (Fri, 02 Mar 2012)
New Revision: 1201
Modified:
trunk/tests/info/info.py
Log:
532557 - test suite should alarm operator and fail test runs on non GA kernel
Modified: trunk/tests/info/info.py
===================================================================
--- trunk/tests/info/info.py 2012-03-02 18:28:47 UTC (rev 1200)
+++ trunk/tests/info/info.py 2012-03-02 18:39:28 UTC (rev 1201)
@@ -137,8 +137,7 @@
opener = urllib2.build_opener()
response = opener.open(request).read()
if response:
- # save it locally - renamed with a tmp prefix
- kernelInfoFile = "tmp-" + kernelInfoFile
+ # save it locally
file = open(kernelInfoFile, "w")
file.write(response)
file.close()
@@ -151,6 +150,10 @@
if self.debug != Constants.off:
print "Warning: could not download kernel information file:"
print e
+
+ # if it couldn't be downloaded, use the one in /var/share/v7/lib
+ if not os.path.exists(kernelInfoFile):
+ kernelInfoFile = os.path.join(self.environment.getLibraryDirectory(), kernelInfoFile)
try:
@@ -162,7 +165,7 @@
print "Kernel is RHEL %s.%s GA: %s" % (self.redHatRelease.getVersion(), self.redHatRelease.getUpdate(), RHELGAKernel)
return True
else:
- print "Kernel is %s and not RHEL %s.%s GA (%s)" % (self.redHatRelease.getKernelVersionRelease(), self.redHatRelease.getVersion(), self.redHatRelease.getUpdate(), RHELGAKernel)
+ print "Error: Kernel is %s and not RHEL %s.%s GA (%s)" % (self.redHatRelease.getKernelVersionRelease(), self.redHatRelease.getVersion(), self.redHatRelease.getUpdate(), RHELGAKernel)
return False
except IOError:
print "Error: could not open kernel info file " + kernelInfoFile