| OLD | NEW |
| 1 import os, logging | 1 import os, logging |
| 2 from autotest_lib.client.bin import test, utils | 2 from autotest_lib.client.bin import test, utils |
| 3 | 3 |
| 4 | 4 |
| 5 class tiobench(test.test): | 5 class tiobench(test.test): |
| 6 version = 1 | 6 version = 1 |
| 7 | 7 |
| 8 # http://prdownloads.sourceforge.net/tiobench/tiobench-0.3.3.tar.gz | 8 # http://prdownloads.sourceforge.net/tiobench/tiobench-0.3.3.tar.gz |
| 9 def setup(self, tarball = 'tiobench-0.3.3.tar.bz2'): | 9 def setup(self, tarball = 'tiobench-0.3.3.tar.bz2'): |
| 10 tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) | 10 tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) |
| 11 utils.extract_tarball_to_dir(tarball, self.srcdir) | 11 utils.extract_tarball_to_dir(tarball, self.srcdir) |
| 12 os.chdir(self.srcdir) | 12 os.chdir(self.srcdir) |
| 13 | 13 utils.system('patch -p1 < ../makefile.patch') |
| 14 utils.system('make') | 14 utils.system('make') |
| 15 | 15 |
| 16 | 16 |
| 17 def initialize(self): | 17 def initialize(self): |
| 18 self.job.require_gcc() | 18 self.job.require_gcc() |
| 19 | 19 |
| 20 | 20 |
| 21 def run_once(self, dir = None, args = None): | 21 def run_once(self, dir = None, args = None): |
| 22 if not dir: | 22 if not dir: |
| 23 self.dir = self.tmpdir | 23 self.dir = self.tmpdir |
| 24 else: | 24 else: |
| 25 self.dir = dir | 25 self.dir = dir |
| 26 if not args: | 26 if not args: |
| 27 self.args = '--block=4096 --block=8192 --threads=10 --size=1024 --nu
mruns=2' | 27 self.args = '--block=4096 --block=8192 --threads=10 --size=1024 --nu
mruns=2' |
| 28 else: | 28 else: |
| 29 self.args = args | 29 self.args = args |
| 30 | 30 |
| 31 os.chdir(self.srcdir) | 31 os.chdir(self.srcdir) |
| 32 results = utils.system_output('./tiobench.pl --dir %s %s' % | 32 results = utils.system_output('./tiobench.pl --dir %s %s' % |
| 33 (self.dir, self.args)) | 33 (self.dir, self.args)) |
| 34 | 34 |
| 35 logging.info(results) | 35 logging.info(results) |
| 36 results_path = os.path.join(self.resultsdir, | 36 results_path = os.path.join(self.resultsdir, |
| 37 'raw_output_%s' % self.iteration) | 37 'raw_output_%s' % self.iteration) |
| 38 | 38 |
| 39 utils.open_write_close(results_path, results) | 39 utils.open_write_close(results_path, results) |
| OLD | NEW |