diff options
author | Ross Burton <ross@burtonini.com> | 2022-01-31 13:54:08 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-02-01 07:31:18 +0000 |
commit | 440a5f6ee682a9ab17a3da00178733b39749bdcf (patch) | |
tree | a0fa9f67e36d272bfe904d1cc505fa09c3a2dc1f /meta/lib | |
parent | 351ee239c7c5693371b80233a318ca10e0cfeb35 (diff) | |
download | poky-440a5f6ee682a9ab17a3da00178733b39749bdcf.tar.gz |
oeqa/runtime/stap: improve systemtap test
Split the test up into compile and execute phases, as the stap binary
is known to be quite memory-hungry and this can result in the probe
being unable to allocate enough memory for the buffers it needs.
If the test fails, dump the dmesg as any useful messages will be there.
(From OE-Core rev: 6cf4d23a2d26c2767edd93f2eb317ff759b5a992)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/runtime/cases/stap.py | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/meta/lib/oeqa/runtime/cases/stap.py b/meta/lib/oeqa/runtime/cases/stap.py index 615c290ce6..480eaabf2d 100644 --- a/meta/lib/oeqa/runtime/cases/stap.py +++ b/meta/lib/oeqa/runtime/cases/stap.py | |||
@@ -14,11 +14,19 @@ class StapTest(OERuntimeTestCase): | |||
14 | @OEHasPackage(['gcc-symlinks']) | 14 | @OEHasPackage(['gcc-symlinks']) |
15 | @OEHasPackage(['kernel-devsrc']) | 15 | @OEHasPackage(['kernel-devsrc']) |
16 | def test_stap(self): | 16 | def test_stap(self): |
17 | cmd = 'make -C /usr/src/kernel scripts prepare' | 17 | try: |
18 | status, output = self.target.run(cmd, 900) | 18 | cmd = 'make -j -C /usr/src/kernel scripts prepare' |
19 | self.assertEqual(status, 0, msg='\n'.join([cmd, output])) | 19 | status, output = self.target.run(cmd, 900) |
20 | self.assertEqual(status, 0, msg='\n'.join([cmd, output])) | ||
20 | 21 | ||
21 | cmd = 'stap -v --disable-cache -DSTP_NO_VERREL_CHECK -s1 -e \'probe oneshot { print("Hello, "); println("world!") }\'' | 22 | cmd = 'stap -v -p4 -m stap-hello --disable-cache -DSTP_NO_VERREL_CHECK -e \'probe oneshot { print("Hello, "); println("SystemTap!") }\'' |
22 | status, output = self.target.run(cmd, 900) | 23 | status, output = self.target.run(cmd, 900) |
23 | self.assertEqual(status, 0, msg='\n'.join([cmd, output])) | 24 | self.assertEqual(status, 0, msg='\n'.join([cmd, output])) |
24 | self.assertIn('Hello, world!', output, msg='\n'.join([cmd, output])) | 25 | |
26 | cmd = 'staprun -v -R -b1 stap-hello.ko' | ||
27 | self.assertEqual(status, 0, msg='\n'.join([cmd, output])) | ||
28 | self.assertIn('Hello, SystemTap!', output, msg='\n'.join([cmd, output])) | ||
29 | except: | ||
30 | status, dmesg = self.target.run('dmesg') | ||
31 | if status == 0: | ||
32 | print(dmesg) | ||