| OLD | NEW |
| 1 import os, re | 1 import os, re |
| 2 from autotest_lib.client.bin import test, os_dep, utils | 2 from autotest_lib.client.bin import test, os_dep, utils |
| 3 | 3 |
| 4 | 4 |
| 5 def convert_size(values): | 5 def convert_size(values): |
| 6 values = values.split(':') | 6 values = values.split(':') |
| 7 size = values[0] | 7 size = values[0] |
| 8 if len(values) > 1: | 8 if len(values) > 1: |
| 9 chunk = values[1] | 9 chunk = values[1] |
| 10 else: | 10 else: |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 self.results = [] | 31 self.results = [] |
| 32 | 32 |
| 33 # http://www.coker.com.au/bonnie++/bonnie++-1.03a.tgz | 33 # http://www.coker.com.au/bonnie++/bonnie++-1.03a.tgz |
| 34 def setup(self, tarball = 'bonnie++-1.03a.tgz'): | 34 def setup(self, tarball = 'bonnie++-1.03a.tgz'): |
| 35 tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) | 35 tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) |
| 36 utils.extract_tarball_to_dir(tarball, self.srcdir) | 36 utils.extract_tarball_to_dir(tarball, self.srcdir) |
| 37 os.chdir(self.srcdir) | 37 os.chdir(self.srcdir) |
| 38 | 38 |
| 39 os_dep.command('g++') | 39 os_dep.command('g++') |
| 40 utils.system('patch -p1 < ../bonnie++-1.03a-gcc43.patch') | 40 utils.system('patch -p1 < ../bonnie++-1.03a-gcc43.patch') |
| 41 utils.system('./configure') | 41 utils.configure() |
| 42 utils.system('make') | 42 utils.make() |
| 43 | 43 |
| 44 | 44 |
| 45 def run_once(self, dir=None, extra_args='', user='root'): | 45 def run_once(self, dir=None, extra_args='', user='root'): |
| 46 if not dir: | 46 if not dir: |
| 47 dir = self.tmpdir | 47 dir = self.tmpdir |
| 48 | 48 |
| 49 # if the user specified a -n we will use that | 49 # if the user specified a -n we will use that |
| 50 if '-n' not in extra_args: | 50 if '-n' not in extra_args: |
| 51 extra_args += ' -n 2048' | 51 extra_args += ' -n 2048' |
| 52 args = '-d ' + dir + ' -u ' + user + ' ' + extra_args | 52 args = '-d ' + dir + ' -u ' + user + ' ' + extra_args |
| (...skipping 19 matching lines...) Expand all Loading... |
| 72 'randcreate_delete_ksec', 'randcreate_delete_pctcp') | 72 'randcreate_delete_ksec', 'randcreate_delete_pctcp') |
| 73 | 73 |
| 74 for line in self.results: | 74 for line in self.results: |
| 75 if line.count(',') != 26: | 75 if line.count(',') != 26: |
| 76 continue | 76 continue |
| 77 fields = line.split(',') | 77 fields = line.split(',') |
| 78 fields = [strip_plus(f) for f in fields] | 78 fields = [strip_plus(f) for f in fields] |
| 79 fields = convert_size(fields[1]) + fields[2:] | 79 fields = convert_size(fields[1]) + fields[2:] |
| 80 | 80 |
| 81 self.write_perf_keyval(dict(zip(keys,fields))) | 81 self.write_perf_keyval(dict(zip(keys,fields))) |
| OLD | NEW |