Author: gnichols
Date: 2012-09-06 15:40:10 +0000 (Thu, 06 Sep 2012)
New Revision: 1374
Removed:
trunk/tests/storage/runtest.sh
Modified:
trunk/tests/storage/Makefile
trunk/tests/storage/storage.py
Log:
843600 - storage test should not use HAL
Modified: trunk/tests/storage/Makefile
===================================================================
--- trunk/tests/storage/Makefile 2012-09-06 15:26:19 UTC (rev 1373)
+++ trunk/tests/storage/Makefile 2012-09-06 15:40:10 UTC (rev 1374)
@@ -15,17 +15,15 @@
.PHONY: all install download clean
-FILES=runtest.sh storage.py
+FILES=storage.py
run: $(FILES) build
- ./runtest.sh
build: $(BUILT_FILES)
- chmod a+x ./runtest.sh ./storage.py
+ chmod a+x ./storage.py
clean:
rm -f $(BUILT_FILES)
# Include Common Makefile
include $(DESTDIR)/usr/share/v7/lib/v7-make.include
-
Deleted: trunk/tests/storage/runtest.sh
===================================================================
--- trunk/tests/storage/runtest.sh 2012-09-06 15:26:19 UTC (rev 1373)
+++ trunk/tests/storage/runtest.sh 2012-09-06 15:40:10 UTC (rev 1374)
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-v7-run-simple-test ${TEST:-$(basename $PWD)} ./storage.py
Modified: trunk/tests/storage/storage.py
===================================================================
--- trunk/tests/storage/storage.py 2012-09-06 15:26:19 UTC (rev 1373)
+++ trunk/tests/storage/storage.py 2012-09-06 15:40:10 UTC (rev 1374)
@@ -1,9 +1,9 @@
#!/usr/bin/python
-# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material
-# is made available to anyone wishing to use, modify, copy, or
-# redistribute it subject to the terms and conditions of the GNU General
+# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material
+# is made available to anyone wishing to use, modify, copy, or
+# redistribute it subject to the terms and conditions of the GNU General
# Public License v.2.
-#
+#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
@@ -27,7 +27,7 @@
from v7.tags import DeviceClass
from v7.dbusDevice import UDisksDrive
-class StorageTest(Test):
+class StorageTest(Test):
def __init__(self):
Test.__init__(self, name="storage")
@@ -39,7 +39,7 @@
# Maximum size of the test area, in KB. (defaults to 1GB)
self.maxSize = 1048576
self.deviceClass = DeviceClass.hard_disk
-
+
def tags(self):
return [TestTag.noninteractive, TestTag.certification]
@@ -47,13 +47,9 @@
tests = dict()
self.controllers = ''
self.planUDisks(planner, tests)
- self.planHAL(planner, tests)
-
-
return tests.values()
def planUDisks(self, planner, tests):
-
devices = planner.getUDisksDeviceDetector().getDevices()
for device in devices:
disk = None
@@ -68,49 +64,7 @@
test.setDevice(device)
test.setLogicalDeviceName(disk)
tests[disk] = test
-
-
- def planHAL(self, planner, tests):
- disk = None
- devices = planner.getHalDeviceDetector().getDevices()
- for device in devices:
- disk = None
- if 'storage' in device.getProperty("info.capabilities") and
device.getProperty("storage.drive_type") in ["disk",
"sd_mmc"]:
- disk = device.getProperty("block.device")
- # bug#437866 , plan by each controller, block device's parent is the
HD, HD's parent is the controller, so need to track back twice
- # what's the HD's ID ?
- blockDeviceParent = device.getProperty("info.parent")
- # and what's the HD's parent's ID ?
- controllerId = 'none'
- for deviceItem in devices:
- if blockDeviceParent in
deviceItem.getProperty("info.udi"):
- # then the contoller's ID is found
- controllerId = deviceItem.getProperty("info.parent")
- continue
- if controllerId in self.controllers:
- print "the controller %s is already in testplan, will skip the
block device %s" % (controllerId, disk)
- disk = ''
- else:
- # add the controller to the plan and record it
- self.controllers = self.controllers + ', ' + controllerId
- # chop off /dev/ (5 characters)
- if disk and len(disk) > 5:
- disk = disk[5:]
- # handle cciss devices
- elif device.getProperty("info.linux.driver") == "cciss":
- sysfsPath = device.getProperty("pci.linux.sysfs_path")
- # grep for the block device name, if one cciss controller has
- # multiple "drives" attached, we pick only one(the first one)
to test
- storageDevice = commands.getoutput("ls %s | grep block | head -n 1 |
colrm 1 12" % sysfsPath)
- disk = 'cciss/' + storageDevice
-
- if disk and not disk in tests:
- test = self.makeCopy()
- test.setDevice(device)
- test.setLogicalDeviceName(disk)
-
-
def doDt(self, minBs, maxBs, size, options):
"""Helper function: run dt with various block sizes and reasonable
defaults."""
records = size * 1024 / maxBs
@@ -136,7 +90,7 @@
if "direct" in otherOptions:
otherOptions = otherOptions + " rlimit=%s" % (size * 1024)
ran_opt = "of=%s iotype=random dispose=keep enable=verify ralign=%s rseed=%s
dlimit=%s %s" % (file, minBs, seed, size, otherOptions)
- # start
+ # start
print "--- sequential write/read"
sys.stdout.flush()
returnValue1 = self.doDt(minBs, maxBs, size, seq_opt)
@@ -151,7 +105,7 @@
def devSize(self,testdevice):
# Use 1GB or the device size whichever is smaller.
- size = self.maxSize
+ size = self.maxSize
(status,output) = commands.getstatusoutput("cat /sys/block/%s/size" %
testdevice)
# Why is the /sys size value 2x what /proc shows?
if status == 0:
@@ -243,7 +197,7 @@
exception.command.printErrors()
try:
Command("swapon %s" % swaponDevice).run()
- print "done."
+ print "done."
except V7CommandException, exception:
print "Error: could not restore swap"
print exception
@@ -509,7 +463,7 @@
if returnValue == 0:
result = "passed"
else:
- returnValue = 1
+ returnValue = 1
result = "failed"
print "\nStorage test on device %s %s" % (storageDevice, result)
return (returnValue == 0)