Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Side by Side Diff: client/tests/monotonic_time/monotonic_time.py

Issue 3554003: Merge remote branch 'cros/upstream' into tempbranch3 (Closed) Base URL: http://git.chromium.org/git/autotest.git
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « client/tests/ltp/ltp.py ('k') | client/tests/netperf2/netperf2.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import os, re, logging 1 import os, re, logging
2 from autotest_lib.client.bin import test, utils 2 from autotest_lib.client.bin import test, utils
3 from autotest_lib.client.common_lib import error 3 from autotest_lib.client.common_lib import error
4 4
5 class monotonic_time(test.test): 5 class monotonic_time(test.test):
6 version = 1 6 version = 1
7 7
8 preserve_srcdir = True 8 preserve_srcdir = True
9 9
10 def setup(self): 10 def setup(self):
11 os.chdir(self.srcdir) 11 os.chdir(self.srcdir)
12 utils.system('make') 12 utils.make()
13 13
14 14
15 def initialize(self): 15 def initialize(self):
16 self.job.require_gcc() 16 self.job.require_gcc()
17 17
18 18
19 def run_once(self, test_type = None, duration = 300, threshold = None): 19 def run_once(self, test_type = None, duration = 300, threshold = None):
20 if not test_type: 20 if not test_type:
21 raise error.TestError('missing test type') 21 raise error.TestError('missing test type')
22 22
23 cmd = self.srcdir + '/time_test' 23 cmd = self.srcdir + '/time_test'
24 cmd += ' --duration ' + str(duration) 24 cmd += ' --duration ' + str(duration)
25 if threshold: 25 if threshold:
26 cmd += ' --threshold ' + str(threshold) 26 cmd += ' --threshold ' + str(threshold)
27 cmd += ' ' + test_type 27 cmd += ' ' + test_type
28 28
29 self.results = utils.run(cmd, ignore_status=True) 29 self.results = utils.run(cmd, ignore_status=True)
30 logging.info('Time test command exit status: %s', 30 logging.info('Time test command exit status: %s',
31 self.results.exit_status) 31 self.results.exit_status)
32 if self.results.exit_status != 0: 32 if self.results.exit_status != 0:
33 for line in self.results.stdout.splitlines(): 33 for line in self.results.stdout.splitlines():
34 if line.startswith('ERROR:'): 34 if line.startswith('ERROR:'):
35 raise error.TestError(line) 35 raise error.TestError(line)
36 if line.startswith('FAIL:'): 36 if line.startswith('FAIL:'):
37 raise error.TestFail(line) 37 raise error.TestFail(line)
38 raise error.TestError('unknown test failure') 38 raise error.TestError('unknown test failure')
OLDNEW
« no previous file with comments | « client/tests/ltp/ltp.py ('k') | client/tests/netperf2/netperf2.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698