| 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('make bash-shared-mapping usemem') | 13 utils.make('bash-shared-mapping usemem') |
| 14 | 14 |
| 15 | 15 |
| 16 def initialize(self): | 16 def initialize(self): |
| 17 self.job.require_gcc() | 17 self.job.require_gcc() |
| 18 | 18 |
| 19 | 19 |
| 20 def execute(self, testdir = None, iterations = 10000): | 20 def execute(self, testdir = None, iterations = 10000): |
| 21 if not testdir: | 21 if not testdir: |
| 22 testdir = self.tmpdir | 22 testdir = self.tmpdir |
| 23 os.chdir(testdir) | 23 os.chdir(testdir) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 34 for i in (0,1): | 34 for i in (0,1): |
| 35 pid[i] = os.spawnv(os.P_NOWAIT, usemem, args) | 35 pid[i] = os.spawnv(os.P_NOWAIT, usemem, args) |
| 36 | 36 |
| 37 cmd = "%s/bash-shared-mapping %s %d -t %d -n %d" % \ | 37 cmd = "%s/bash-shared-mapping %s %d -t %d -n %d" % \ |
| 38 (self.srcdir, file, kilobytes, | 38 (self.srcdir, file, kilobytes, |
| 39 utils.count_cpus(), iterations) | 39 utils.count_cpus(), iterations) |
| 40 os.system(cmd) | 40 os.system(cmd) |
| 41 | 41 |
| 42 for i in (0, 1): | 42 for i in (0, 1): |
| 43 os.kill(pid[i], signal.SIGKILL) | 43 os.kill(pid[i], signal.SIGKILL) |
| OLD | NEW |