| OLD | NEW |
| 1 import os, subprocess, re, commands, logging | 1 import os, subprocess, re, commands, logging |
| 2 from autotest_lib.client.bin import utils, test | 2 from autotest_lib.client.bin import utils, test |
| 3 from autotest_lib.client.common_lib import error | 3 from autotest_lib.client.common_lib import error |
| 4 | 4 |
| 5 class memory_api(test.test): | 5 class memory_api(test.test): |
| 6 version = 1 | 6 version = 1 |
| 7 | 7 |
| 8 def setup(self): | 8 def setup(self): |
| 9 utils.system("gcc %s -o %s" % | 9 os.mkdir(self.tmpdir) |
| 10 (os.path.join(self.bindir, "memory_api.c"), | 10 utils.system("%s %s -o %s" % |
| 11 (utils.get_cc(), |
| 12 os.path.join(self.bindir, "memory_api.c"), |
| 11 os.path.join(self.tmpdir, "memory_api"))) | 13 os.path.join(self.tmpdir, "memory_api"))) |
| 12 utils.system("gcc %s -o %s" % | 14 utils.system("%s %s -o %s" % |
| 13 (os.path.join(self.bindir, "mremaps.c"), | 15 (utils.get_cc(), |
| 16 os.path.join(self.bindir, "mremaps.c"), |
| 14 os.path.join(self.tmpdir, "mremaps"))) | 17 os.path.join(self.tmpdir, "mremaps"))) |
| 15 | 18 |
| 16 | 19 |
| 17 def initialize(self): | 20 def initialize(self): |
| 18 self.job.require_gcc() | 21 self.job.require_gcc() |
| 19 | 22 |
| 20 | 23 |
| 21 def run_once(self, memsize = "1000000000", args=''): | 24 def run_once(self, memsize = "1000000000", args=''): |
| 22 | 25 |
| 23 vma_re = re.compile("([0-9,a-f]+)-([0-9,a-f]+)") | 26 vma_re = re.compile("([0-9,a-f]+)-([0-9,a-f]+)") |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 logging.info("%s %s %d %d", hex(mem_start), hex(mem_len), vma_count, | 66 logging.info("%s %s %d %d", hex(mem_start), hex(mem_len), vma_count, |
| 64 expected_vma_count) | 67 expected_vma_count) |
| 65 if p1.poll() is None: | 68 if p1.poll() is None: |
| 66 p1.stdin.write("\n") | 69 p1.stdin.write("\n") |
| 67 p1.stdin.flush() | 70 p1.stdin.flush() |
| 68 | 71 |
| 69 if p1.poll() != 0: | 72 if p1.poll() != 0: |
| 70 raise error.TestFail("Unexpected application abort") | 73 raise error.TestFail("Unexpected application abort") |
| 71 | 74 |
| 72 utils.system('%s/mremaps ' % self.tmpdir + '100000000') | 75 utils.system('%s/mremaps ' % self.tmpdir + '100000000') |
| OLD | NEW |