blob: 96e197a2d68c4afc942f424f52c5c54e4f4fcee2 [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001import 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',
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080028 'cd /lib/modules/`uname -r` && (if [ ! -e build ]; then ln -s /usr/src/kernel build; fi)',
Brad Bishop316dfdd2018-06-25 12:45:53 -040029 '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]))