OLD | NEW |
1 import signal, os | 1 import signal, os |
2 from autotest_lib.client.bin import utils, test | 2 from autotest_lib.client.bin import utils, test |
3 | 3 |
4 class bash_shared_mapping(test.test): | 4 class bash_shared_mapping(test.test): |
5 version = 3 | 5 version = 3 |
6 | 6 |
7 # http://www.zip.com.au/~akpm/linux/patches/stuff/ext3-tools.tar.gz | 7 # http://www.zip.com.au/~akpm/linux/patches/stuff/ext3-tools.tar.gz |
8 def setup(self, tarball = 'ext3-tools.tar.gz'): | 8 def setup(self, tarball = 'ext3-tools.tar.gz'): |
9 self.tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) | 9 self.tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) |
10 utils.extract_tarball_to_dir(self.tarball, self.srcdir) | 10 utils.extract_tarball_to_dir(self.tarball, self.srcdir) |
11 | 11 |
12 os.chdir(self.srcdir) | 12 os.chdir(self.srcdir) |
| 13 utils.system('patch -p1 < ../makefile.patch') |
13 utils.make('bash-shared-mapping usemem') | 14 utils.make('bash-shared-mapping usemem') |
14 | 15 |
15 | 16 |
16 def initialize(self): | 17 def initialize(self): |
17 self.job.require_gcc() | 18 self.job.require_gcc() |
18 | 19 |
19 | 20 |
20 def execute(self, testdir = None, iterations = 10000): | 21 def execute(self, testdir = None, iterations = 10000): |
21 if not testdir: | 22 if not testdir: |
22 testdir = self.tmpdir | 23 testdir = self.tmpdir |
(...skipping 11 matching lines...) Expand all Loading... |
34 for i in (0,1): | 35 for i in (0,1): |
35 pid[i] = os.spawnv(os.P_NOWAIT, usemem, args) | 36 pid[i] = os.spawnv(os.P_NOWAIT, usemem, args) |
36 | 37 |
37 cmd = "%s/bash-shared-mapping %s %d -t %d -n %d" % \ | 38 cmd = "%s/bash-shared-mapping %s %d -t %d -n %d" % \ |
38 (self.srcdir, file, kilobytes, | 39 (self.srcdir, file, kilobytes, |
39 utils.count_cpus(), iterations) | 40 utils.count_cpus(), iterations) |
40 os.system(cmd) | 41 os.system(cmd) |
41 | 42 |
42 for i in (0, 1): | 43 for i in (0, 1): |
43 os.kill(pid[i], signal.SIGKILL) | 44 os.kill(pid[i], signal.SIGKILL) |
OLD | NEW |