summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/runtime')
-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") }