Author: gnichols Date: 2010-08-03 16:01:23 +0000 (Tue, 03 Aug 2010) New Revision: 620
Modified: trunk/tests/storage/storage.py Log: 606963 - Storage test fail on RH6 certification
Modified: trunk/tests/storage/storage.py =================================================================== --- trunk/tests/storage/storage.py 2010-08-03 16:00:37 UTC (rev 619) +++ trunk/tests/storage/storage.py 2010-08-03 16:01:23 UTC (rev 620) @@ -104,13 +104,8 @@ bs = bs * 2 return True
- def dtTest(self, minBs, maxBs, file, devSize, otherOptions): + def dtTest(self, minBs, maxBs, file, size, otherOptions): """Do a few passes of read/write testing on the given device.""" - # Restrict size to self.maxSize - maxSizeTmp = self.maxSize - size = string._int(devSize) - if size > maxSizeTmp: - size = maxSizeTmp # Find out how many maxBs-sized blocks we can fit on the test file/dev blocks = ((size/(maxBs/1024))) seqWriOpt = "of=%s records=%s iotype=sequential dispose=keep disable=verify %s" % (file, blocks, otherOptions) @@ -120,8 +115,8 @@ seed = random.randint(0,32767) if "direct" in otherOptions: otherOptions = otherOptions + " rlimit=%s" % (size * 1024) - ranWriOpt = "of=%s records=%s iotype=random dispose=keep disable=verify ralign=%s rseed=%s dlimit=%s %s" % (file, blocks, minBs, seed, maxSizeTmp, otherOptions) - ranReaOpt = "if=%s records=%s iotype=random ralign=%s rseed=%s dlimit=%s %s" % (file, blocks, minBs, seed, maxSizeTmp, otherOptions) + ranWriOpt = "of=%s records=%s iotype=random dispose=keep disable=verify ralign=%s rseed=%s dlimit=%s %s" % (file, blocks, minBs, seed, size, otherOptions) + ranReaOpt = "if=%s records=%s iotype=random ralign=%s rseed=%s dlimit=%s %s" % (file, blocks, minBs, seed, size, otherOptions) # start print "--- sequential write" sys.stdout.flush() @@ -142,20 +137,13 @@ return returnValue
def devSize(self,testdevice): - """Find the size of the given device. - We use 'file' to find the major/minor numbers for the device, then sed - to change "/dev/hda1: block special (3/1)" into '3 1' - where '3' is the major number and '1' is the minor number""" - # set the default size to 1024 - size = 1024 - deviceFile = "/dev/" + testdevice - (status,output) = commands.getstatusoutput("file -L %s |sed -r 's|.*special .([0-9]+)/([0-9]+).|\1 \2|' " % deviceFile) - majorMinor = output.split() - if status == 0: - majorNum = majorMinor[0] - minorNum = majorMinor[1] - (status,output) = commands.getstatusoutput("grep '^ *%s *%s ' /proc/partitions | awk '{print $3}'" % (majorNum,minorNum)) - size = output + # Use 1GB or the device size whichever is smaller. + size = self.maxSize + (status,output) = commands.getstatusoutput("cat /sys/block/%s/size" % testdevice) + # Why is the /sys size value 2x what /proc shows? + output = int(output) / 2 + if status == 0 and output < self.maxSize: + size = output else: print "Warning ! can not get device number. " sys.stdout.flush() @@ -342,7 +330,10 @@ return False (success,junkSize) = commands.getstatusoutput("df -Pk %s | awk '{print $4}' | tail -n1" % mountdir) if success == 0: - size = junkSize + size = self.maxSize + junkSize = int(junkSize) + if junkSize < self.maxSize: + size = junkSize otherOptions = " " if self.dtTest(minBs,maxBs,dtTestFile,size,otherOptions): if self.unmount(testdev):
v7-commits@lists.stg.fedorahosted.org