OLD | NEW |
1 # This will need more work on the configuration stuff before it will function | 1 # This will need more work on the configuration stuff before it will function |
2 import os | 2 import os |
3 from autotest_lib.client.bin import test, utils | 3 from autotest_lib.client.bin import test, utils |
4 from autotest_lib.client.common_lib import error | 4 from autotest_lib.client.common_lib import error |
5 | 5 |
6 | 6 |
7 class lmbench(test.test): | 7 class lmbench(test.test): |
8 version = 4 | 8 version = 4 |
9 | 9 |
10 def initialize(self): | 10 def initialize(self): |
(...skipping 16 matching lines...) Expand all Loading... |
27 """ | 27 """ |
28 tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) | 28 tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) |
29 utils.extract_tarball_to_dir(tarball, self.srcdir) | 29 utils.extract_tarball_to_dir(tarball, self.srcdir) |
30 os.chdir(self.srcdir) | 30 os.chdir(self.srcdir) |
31 p1 = 'patch -p1 < ../0001-Fix-build-issues-with-lmbench.patch' | 31 p1 = 'patch -p1 < ../0001-Fix-build-issues-with-lmbench.patch' |
32 p2 = 'patch -p1 < ../0002-Changing-shebangs-on-lmbench-scripts.patch' | 32 p2 = 'patch -p1 < ../0002-Changing-shebangs-on-lmbench-scripts.patch' |
33 utils.system(p1) | 33 utils.system(p1) |
34 utils.system(p2) | 34 utils.system(p2) |
35 | 35 |
36 # build lmbench | 36 # build lmbench |
37 utils.make() | 37 utils.system('make') |
38 | 38 |
39 # configure lmbench | 39 # configure lmbench |
40 utils.system('yes "" | make config') | 40 utils.system('yes "" | make config') |
41 | 41 |
42 # find the lmbench config file | 42 # find the lmbench config file |
43 config_files = utils.system_output('ls -1 bin/*/CONFIG*').splitlines() | 43 config_files = utils.system_output('ls -1 bin/*/CONFIG*').splitlines() |
44 if len(config_files) != 1: | 44 if len(config_files) != 1: |
45 raise error.TestError('Failed to find a single lmbench config file,' | 45 raise error.TestError('Failed to find a single lmbench config file,' |
46 ' found: %s' % config_files) | 46 ' found: %s' % config_files) |
47 config_file = config_files[0] | 47 config_file = config_files[0] |
48 | 48 |
49 if not fsdir: | 49 if not fsdir: |
50 fsdir = self.tmpdir | 50 fsdir = self.tmpdir |
51 if not file: | 51 if not file: |
52 file = os.path.join(self.tmpdir, 'XXX') | 52 file = os.path.join(self.tmpdir, 'XXX') |
53 | 53 |
54 # patch the resulted config to use the proper temporary directory and | 54 # patch the resulted config to use the proper temporary directory and |
55 # file locations | 55 # file locations |
56 tmp_config_file = config_file + '.tmp' | 56 tmp_config_file = config_file + '.tmp' |
57 utils.system("sed 's!^FSDIR=.*$!FSDIR=%s!' '%s' > '%s'" % | 57 utils.system("sed 's!^FSDIR=.*$!FSDIR=%s!' '%s' > '%s'" % |
58 (fsdir, config_file, tmp_config_file)) | 58 (fsdir, config_file, tmp_config_file)) |
59 utils.system("sed 's!^FILE=.*$!FILE=%s!' '%s' > '%s'" % | 59 utils.system("sed 's!^FILE=.*$!FILE=%s!' '%s' > '%s'" % |
60 (file, tmp_config_file, config_file)) | 60 (file, tmp_config_file, config_file)) |
61 | 61 |
62 | 62 |
63 def run_once(self): | 63 def run_once(self): |
64 os.chdir(self.srcdir) | 64 os.chdir(self.srcdir) |
65 utils.make('rerun') | 65 utils.system('make rerun') |
66 | 66 |
67 | 67 |
68 def postprocess(self): | 68 def postprocess(self): |
69 # Get the results: | 69 # Get the results: |
70 outputdir = self.srcdir + "/results" | 70 outputdir = self.srcdir + "/results" |
71 results = self.resultsdir + "/summary.txt" | 71 results = self.resultsdir + "/summary.txt" |
72 utils.make("-C " + outputdir + " summary > " + results) | 72 utils.system("make -C " + outputdir + " summary > " + results) |
OLD | NEW |