| OLD | NEW |
| 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 tsc(test.test): | 5 class tsc(test.test): |
| 6 version = 3 | 6 version = 3 |
| 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, args = '-t 650'): | 19 def run_once(self, args = '-t 650'): |
| 20 result = utils.run(self.srcdir + '/checktsc ' + args, | 20 result = utils.run(self.srcdir + '/checktsc ' + args, |
| 21 stdout_tee=open(os.path.join(self.resultsdir, | 21 stdout_tee=open(os.path.join(self.resultsdir, |
| 22 'checktsc.log'), 'w'), | 22 'checktsc.log'), 'w'), |
| (...skipping 29 matching lines...) Expand all Loading... |
| 52 max_delta = abs(cur_delta) | 52 max_delta = abs(cur_delta) |
| 53 reason = ln | 53 reason = ln |
| 54 if max_delta > threshold: | 54 if max_delta > threshold: |
| 55 reason = "Latency %s exceeds threshold %d" % (reason, | 55 reason = "Latency %s exceeds threshold %d" % (reason, |
| 56 threshold) | 56 threshold) |
| 57 raise error.TestFail(reason) | 57 raise error.TestFail(reason) |
| 58 | 58 |
| 59 ## If we are here, we failed to qualify the reason of test failre | 59 ## If we are here, we failed to qualify the reason of test failre |
| 60 ## Consider it as a test error | 60 ## Consider it as a test error |
| 61 raise error.TestError(default_reason) | 61 raise error.TestError(default_reason) |
| OLD | NEW |