Author: gnichols Date: 2010-08-06 01:31:40 +0000 (Fri, 06 Aug 2010) New Revision: 621
Modified: trunk/tests/cpuscaling/cpuscaling.py Log: 621614 - systems with no cpuscaling show errors about cpufreq directories 621056 - v7 failed after reboot test
Modified: trunk/tests/cpuscaling/cpuscaling.py =================================================================== --- trunk/tests/cpuscaling/cpuscaling.py 2010-08-03 16:01:23 UTC (rev 620) +++ trunk/tests/cpuscaling/cpuscaling.py 2010-08-06 01:31:40 UTC (rev 621) @@ -90,15 +90,16 @@ return None # look for cpu subdirectories pattern = re.compile("cpu(?P<cpuNumber>[0-9]+)") - self.cpufreqDirectories = list() + self.cpufreqDirectories = None for subdirectory in os.listdir(self.sysCPUDirectory): match = pattern.search(subdirectory) if match and match.group("cpuNumber"): cpufreqDirectory = "%s/%s/cpufreq" % (self.sysCPUDirectory, subdirectory) if not os.path.exists(cpufreqDirectory): - print "Error: cpu %s has no cpufreq directory %s" % (match.group("cpuNumber"), cpufreqDirectory) - return None + continue # otherwise + if not self.cpufreqDirectories: + self.cpufreqDirectories = list() self.cpufreqDirectories.append(cpufreqDirectory) if len(self.cpufreqDirectories) is 0: return None @@ -334,37 +335,6 @@ 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):
v7-commits@lists.stg.fedorahosted.org