diff options
author | Victor Kamensky <kamensky@cisco.com> | 2018-04-03 08:25:01 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-04-18 18:48:19 +0100 |
commit | 659d19fcddb7edaca8f5221148d479e73304b430 (patch) | |
tree | f155bc42328cce898094996b744c1104aaf58d90 | |
parent | 01658c4e978182a31dc7e2cd4f525066b479c2f9 (diff) | |
download | openembedded-core-659d19fcddb7edaca8f5221148d479e73304b430.tar.gz openembedded-core-659d19fcddb7edaca8f5221148d479e73304b430.tar.bz2 openembedded-core-659d19fcddb7edaca8f5221148d479e73304b430.zip |
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.
Signed-off-by: Victor Kamensky <kamensky@cisco.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r-- | meta/lib/oeqa/runtime/cases/stap.py | 33 | ||||
-rw-r--r-- | meta/lib/oeqa/runtime/files/hello.stp | 1 |
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 @@ +import os + +from oeqa.runtime.case import OERuntimeTestCase +from oeqa.core.decorator.depends import OETestDepends +from oeqa.core.decorator.oeid import OETestID +from oeqa.core.decorator.data import skipIfNotFeature + +class StapTest(OERuntimeTestCase): + + @classmethod + def setUpClass(cls): + src = os.path.join(cls.tc.runtime_files_dir, 'hello.stp') + dst = '/tmp/hello.stp' + cls.tc.target.copyTo(src, dst) + + @classmethod + def tearDownClass(cls): + files = '/tmp/hello.stp' + cls.tc.target.run('rm %s' % files) + + @OETestID(1652) + @skipIfNotFeature('tools-profile', + 'Test requires tools-profile to be in IMAGE_FEATURES') + @OETestDepends(['kernelmodule.KernelModuleTest.test_kernel_module']) + def test_stap(self): + cmds = [ + 'cd /usr/src/kernel && make scripts prepare', + 'cd /lib/modules/`uname -r` && (if [ ! -L build ]; then ln -s /usr/src/kernel build; fi)', + 'stap --disable-cache -DSTP_NO_VERREL_CHECK /tmp/hello.stp' + ] + for cmd in cmds: + status, output = self.target.run(cmd, 900) + 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") } |