OLD | NEW |
1 import os, shutil, re | 1 import os, shutil, re |
2 from autotest_lib.client.bin import test, utils | 2 from autotest_lib.client.bin import test, utils |
3 from autotest_lib.client.common_lib import error | 3 from autotest_lib.client.common_lib import error |
4 | 4 |
5 | 5 |
6 class systemtap(test.test): | 6 class systemtap(test.test): |
7 """ | 7 """ |
8 This autotest module runs the systemtap test suite. | 8 This autotest module runs the systemtap test suite. |
9 | 9 |
10 @author Anton Blanchard <anton@au.ibm.com> | 10 @author Anton Blanchard <anton@au.ibm.com> |
(...skipping 25 matching lines...) Expand all Loading... |
36 depdir = os.path.join(self.autodir, 'deps/systemtap') | 36 depdir = os.path.join(self.autodir, 'deps/systemtap') |
37 if os.path.exists(os.path.join(depdir, tarball_systemtap)): | 37 if os.path.exists(os.path.join(depdir, tarball_systemtap)): |
38 tarball = utils.unmap_url(depdir, tarball_systemtap, self.tmpdir) | 38 tarball = utils.unmap_url(depdir, tarball_systemtap, self.tmpdir) |
39 else: | 39 else: |
40 tarball = utils.unmap_url(self.bindir, tarball_systemtap, self.tmpdi
r) | 40 tarball = utils.unmap_url(self.bindir, tarball_systemtap, self.tmpdi
r) |
41 utils.extract_tarball_to_dir(tarball_systemtap, self.srcdir) | 41 utils.extract_tarball_to_dir(tarball_systemtap, self.srcdir) |
42 | 42 |
43 testsuite = os.path.join(self.srcdir, 'testsuite') | 43 testsuite = os.path.join(self.srcdir, 'testsuite') |
44 os.chdir(testsuite) | 44 os.chdir(testsuite) |
45 | 45 |
46 utils.configure() | 46 utils.system('./configure') |
47 utils.make() | 47 utils.system('make') |
48 | 48 |
49 # Run a simple systemtap script to make sure systemtap and the | 49 # Run a simple systemtap script to make sure systemtap and the |
50 # kernel debuginfo packages are correctly installed | 50 # kernel debuginfo packages are correctly installed |
51 script = "PATH=%s/bin:$PATH stap -c /bin/true -e 'probe syscall.read { e
xit() }'" % self.systemtap_dir | 51 script = "PATH=%s/bin:$PATH stap -c /bin/true -e 'probe syscall.read { e
xit() }'" % self.systemtap_dir |
52 try: | 52 try: |
53 utils.system(script) | 53 utils.system(script) |
54 except: | 54 except: |
55 raise error.TestError('simple systemtap test failed, kernel debuginf
o package may be missing: %s' % script) | 55 raise error.TestError('simple systemtap test failed, kernel debuginf
o package may be missing: %s' % script) |
56 | 56 |
57 | 57 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 for line in f: | 93 for line in f: |
94 result = r.match(line) | 94 result = r.match(line) |
95 if result: | 95 if result: |
96 key = result.group(1) | 96 key = result.group(1) |
97 key = key.strip().replace(' ', '_') | 97 key = key.strip().replace(' ', '_') |
98 value = result.group(2) | 98 value = result.group(2) |
99 keyval[key] = value | 99 keyval[key] = value |
100 f.close() | 100 f.close() |
101 | 101 |
102 self.write_perf_keyval(keyval) | 102 self.write_perf_keyval(keyval) |
OLD | NEW |