Author: gnichols
Date: 2011-07-07 19:00:39 +0000 (Thu, 07 Jul 2011)
New Revision: 988
Modified:
trunk/tests/storage/storage.py
Log:
704031 - Include additional LVM debugging info in storage test
Modified: trunk/tests/storage/storage.py
===================================================================
--- trunk/tests/storage/storage.py 2011-07-07 18:59:18 UTC (rev 987)
+++ trunk/tests/storage/storage.py 2011-07-07 19:00:39 UTC (rev 988)
@@ -380,24 +380,37 @@
else:
print "Error: raw I/O test failed !"
return False
+
+ def logLVM(self):
+ try:
+ # these commands write to standard error for no reason
+ Command("pvdisplay").echoIgnoreErrors()
+ Command("vgdisplay").echoIgnoreErrors()
+ Command("lvdisplay").echoIgnoreErrors()
+ except Exception, exception:
+ print "Warning: could not log LVM info"
+ print exception
+
+ return True
- def run(self):
+ def runStorage(self):
"""Overall test strategy: Instruct the tester to install RHEL
*only* on
a single disk. We can use the swap partition for testing that disk, and
every other (unused) disk we can test directly."""
+
# check for dt first
if os.path.exists("/usr/sbin/dt"):
print "Found dt package."
else:
print "Error: No dt package found !"
- return 1
+ return False
# complains error if can not find any testable block device
storageDevice = self.getLogicalDeviceName()
if storageDevice:
print "Start testing on /dev/%s ..." % storageDevice
else:
print "Error: Can not find any block device to test ! "
- return 1
+ return False
# initialize
size = 0
isLvm = "false"
@@ -409,7 +422,7 @@
print "Found %s in /proc/partitions." % storageDevice
else:
print "Error: Can not find %s in /proc/partitions !" %
storageDevice
- return 1
+ return False
# grab hw info
self.grabHardwareInfo()
# If there's a swap device, use that for testing
@@ -441,7 +454,7 @@
# check the test device
testdev = self.getTestDevice(storageDevice,swapdev,isLvm)
if not testdev:
- return 1
+ return False
# Set device-appropriate blocksizes and other special stuff.
if storageDevice[0:4] == "dasd":
minBs = 4096
@@ -458,16 +471,16 @@
print "\n*** Raw I/O testing passed.\n"
returnValue=0
else:
- return 1
+ return False
else:
- return 1
+ return False
# Clean up, try to restore swap if needed.
if testdev == swapdev:
if self.restoreSwap(swapdev,swapLabel):
print "restored the swap device."
else:
print "Error: restore swap error !"
- return 1
+ return False
# try to remove temp directories
os.system("rmdir %s.* 2>/dev/null" % storageDevice)
if returnValue == 0:
@@ -476,7 +489,19 @@
returnValue = 1
result = "failed"
print "\nStorage test on device %s %s" % (storageDevice, result)
- return returnValue
+ return (returnValue == 0)
+
+ def run(self):
+ FAILED = 1
+ PASSED = 0
+
+ if not self.runSubTest(self.logLVM, "LVM", "Log LVM info"):
+ return FAILED
+
+ if not self.runSubTest(self.runStorage, "Test storage I/O"):
+ return FAILED
+
+ return PASSED
if __name__ == "__main__":
test = StorageTest()
Show replies by date