Author: gnichols
Date: 2010-03-04 18:56:19 +0000 (Thu, 04 Mar 2010)
New Revision: 406
Modified:
trunk/tests/cpuscaling/cpuscaling.py
Log:
489578 - Individual cpu core will fail cpuscaling depending upon what type of drive is
used and whether INFO runs before or after test
Modified: trunk/tests/cpuscaling/cpuscaling.py
===================================================================
--- trunk/tests/cpuscaling/cpuscaling.py 2010-03-04 18:46:08 UTC (rev 405)
+++ trunk/tests/cpuscaling/cpuscaling.py 2010-03-04 18:56:19 UTC (rev 406)
@@ -321,6 +321,37 @@
except V7CommandException, exception:
print "Warning: could not read CPU flags"
print exception
+
+ def getLoadAvg(self):
+ loadAvgFile = "/proc/loadavg"
+ if os.path.exists(loadAvgFile):
+ file = open(loadAvgFile)
+ line = file.readline()
+ if len(line.strip()) > 0:
+ params = line.strip().split()
+ loadAvg = float(params[0])
+ print "Current load average: %s" % loadAvg
+ sys.stdout.flush
+ return loadAvg
+ else:
+ return 0
+
+
+ def syncDisks(self):
+ command = Command("/bin/sync")
+ command.echo()
+
+
+ def waitForLull(self):
+ waitTime = 5
+ retryLimit = 20
+
+ self.syncDisks()
+
+ retryCount = 0
+ while self.getLoadAvg() > 1 and retryCount < retryLimit:
+ time.sleep(waitTime)
+ retryCount = retryCount + 1
def runUserSpaceTests(self):
@@ -515,19 +546,20 @@
PASSED = 0
FAILED = 1
-
- if not self.getSystemCapabilities():
+ if not self.runSubTest(self.getSystemCapabilities, "Capabilities"):
return FAILED
+
+ self.waitForLull()
result = PASSED
- if not self.runUserSpaceTests():
+ if not self.runSubTest(self.runUserSpaceTests, "User Space"):
result = FAILED
- if not self.runOnDemandTests():
+ if not self.runSubTest(self.runOnDemandTests, "On Demand"):
result = FAILED
- if not self.runPerformanceTests():
+ if not self.runSubTest(self.runPerformanceTests, "Performance"):
result = FAILED
self.printSummary()
Show replies by date