blob: 615c290ce61f2d52bb1506f549b08e3d0749fafb [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001#
2# SPDX-License-Identifier: MIT
3#
4
Brad Bishop316dfdd2018-06-25 12:45:53 -04005import os
6
7from oeqa.runtime.case import OERuntimeTestCase
Brad Bishop316dfdd2018-06-25 12:45:53 -04008from oeqa.core.decorator.data import skipIfNotFeature
Brad Bishop977dc1a2019-02-06 16:01:43 -05009from oeqa.runtime.decorator.package import OEHasPackage
Brad Bishop316dfdd2018-06-25 12:45:53 -040010
11class StapTest(OERuntimeTestCase):
Andrew Geissler595f6302022-01-24 19:11:47 +000012 @skipIfNotFeature('tools-profile', 'Test requires tools-profile to be in IMAGE_FEATURES')
Brad Bishop977dc1a2019-02-06 16:01:43 -050013 @OEHasPackage(['systemtap'])
Andrew Geissler595f6302022-01-24 19:11:47 +000014 @OEHasPackage(['gcc-symlinks'])
15 @OEHasPackage(['kernel-devsrc'])
Brad Bishop316dfdd2018-06-25 12:45:53 -040016 def test_stap(self):
Andrew Geissler595f6302022-01-24 19:11:47 +000017 cmd = 'make -C /usr/src/kernel scripts prepare'
18 status, output = self.target.run(cmd, 900)
19 self.assertEqual(status, 0, msg='\n'.join([cmd, output]))
20
21 cmd = 'stap -v --disable-cache -DSTP_NO_VERREL_CHECK -s1 -e \'probe oneshot { print("Hello, "); println("world!") }\''
22 status, output = self.target.run(cmd, 900)
23 self.assertEqual(status, 0, msg='\n'.join([cmd, output]))
24 self.assertIn('Hello, world!', output, msg='\n'.join([cmd, output]))