4
from optparse import OptionParser
5
from subprocess import Popen, PIPE
38
usage = 'usage %prog [OPTIONS]'
39
parser = OptionParser(usage)
40
parser.add_option('-c','--cpufreq',
42
help='Chose this option to run the CPU Frequency Scaling test only')
43
parser.add_option('-w','--wakealarm',
45
help='Run the fwts wakealarm test only')
46
parser.add_option('-a','--all',
48
help='Run ALL FWTS automated tests (assumes -w and -c)')
49
parser.add_option('-l','--log',
50
default='/tmp/fwts_results.log',
51
help='Specify the location and name of the log file. Default log path is %default')
52
(options, args) = parser.parse_args()
54
if options.cpufreq and options.wakealarm:
55
parser.error('cpufreq and wakealarm can not be chosen togehter. Choose -a instead')
62
elif options.wakealarm:
63
tests += ['wakealarm']
65
tests += ['wakealarm','cpufreq'] + TESTS
69
# run the tests we want
71
command = 'fwts -q --stdout-summary -r %s %s' % (options.log,test)
72
results[test] = Popen(command, stdout=PIPE, shell=True).communicate()[0].strip()
78
if results[test] == 'FAILED_CRITICAL' or \
79
results[test] == 'FAILED_HIGH':
81
elif results[test] == 'PASSED':
91
if __name__ == '__main__':