summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Kamensky <kamensky@cisco.com>2018-04-03 08:25:01 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-04-18 18:57:06 +0100
commit7e03441c9f6fe714b118845642140ea1c807eac7 (patch)
treebe2c704ef83cf1c5d0cbdba858bcff6c6dd2600a
parent5f7a0c72c5ca9715ba6c8727dae32db7659fb9f6 (diff)
downloadpoky-7e03441c9f6fe714b118845642140ea1c807eac7.tar.gz
oeqa/runtime/stap.py: add runtime test for systemtap
Add runtime test for stap to test basic SystemTap operations: can compile very basic module and run on target device. Note we disable (-DSTP_NO_VERREL_CHECK) SystemTap additional kernel release check since during OE testing mismatching kernel-devsrc and kernels are used. (From OE-Core rev: 659d19fcddb7edaca8f5221148d479e73304b430) Signed-off-by: Victor Kamensky <kamensky@cisco.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/runtime/cases/stap.py33
-rw-r--r--meta/lib/oeqa/runtime/files/hello.stp1
2 files changed, 34 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/cases/stap.py b/meta/lib/oeqa/runtime/cases/stap.py
new file mode 100644
index 0000000000..fc728bfc55
--- /dev/null
+++ b/meta/lib/oeqa/runtime/cases/stap.py
@@ -0,0 +1,33 @@
1import os
2
3from oeqa.runtime.case import OERuntimeTestCase
4from oeqa.core.decorator.depends import OETestDepends
5from oeqa.core.decorator.oeid import OETestID
6from oeqa.core.decorator.data import skipIfNotFeature
7
8class StapTest(OERuntimeTestCase):
9
10 @classmethod
11 def setUpClass(cls):
12 src = os.path.join(cls.tc.runtime_files_dir, 'hello.stp')
13 dst = '/tmp/hello.stp'
14 cls.tc.target.copyTo(src, dst)
15
16 @classmethod
17 def tearDownClass(cls):
18 files = '/tmp/hello.stp'
19 cls.tc.target.run('rm %s' % files)
20
21 @OETestID(1652)
22 @skipIfNotFeature('tools-profile',
23 'Test requires tools-profile to be in IMAGE_FEATURES')
24 @OETestDepends(['kernelmodule.KernelModuleTest.test_kernel_module'])
25 def test_stap(self):
26 cmds = [
27 'cd /usr/src/kernel && make scripts prepare',
28 'cd /lib/modules/`uname -r` && (if [ ! -L build ]; then ln -s /usr/src/kernel build; fi)',
29 'stap --disable-cache -DSTP_NO_VERREL_CHECK /tmp/hello.stp'
30 ]
31 for cmd in cmds:
32 status, output = self.target.run(cmd, 900)
33 self.assertEqual(status, 0, msg='\n'.join([cmd, output]))
diff --git a/meta/lib/oeqa/runtime/files/hello.stp b/meta/lib/oeqa/runtime/files/hello.stp
new file mode 100644
index 0000000000..3677147162
--- /dev/null
+++ b/meta/lib/oeqa/runtime/files/hello.stp
@@ -0,0 +1 @@
probe oneshot { println("hello world") }