mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 12:59:02 +02:00

Systemtap refuses modules names like stap-hello, it says: > ERROR: Safety pattern mismatch for -m parameter ('stap-hello' vs. '^[a-z0-9_]+$') rc=1 'stap-hello' was introduced by: 6cf4d23a2d26c2767edd93f2eb317ff759b5a992 (oeqa/runtime/stap: improve systemtap test) and '-m parameter' regexp check was in SystemTap from 2010, not sure how this test case ever passed after mentioned change. (From OE-Core rev: bb916c60a32be57babaf67d0bcad4724547feb31) Signed-off-by: Victor Kamensky <victor.kamensky7@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
35 lines
1.3 KiB
Python
35 lines
1.3 KiB
Python
#
|
|
# Copyright OpenEmbedded Contributors
|
|
#
|
|
# SPDX-License-Identifier: MIT
|
|
#
|
|
|
|
import os
|
|
|
|
from oeqa.runtime.case import OERuntimeTestCase
|
|
from oeqa.core.decorator.data import skipIfNotFeature
|
|
from oeqa.runtime.decorator.package import OEHasPackage
|
|
|
|
class StapTest(OERuntimeTestCase):
|
|
@skipIfNotFeature('tools-profile', 'Test requires tools-profile to be in IMAGE_FEATURES')
|
|
@OEHasPackage(['systemtap'])
|
|
@OEHasPackage(['gcc-symlinks'])
|
|
@OEHasPackage(['kernel-devsrc'])
|
|
def test_stap(self):
|
|
try:
|
|
cmd = 'make -j -C /usr/src/kernel scripts prepare'
|
|
status, output = self.target.run(cmd, 900)
|
|
self.assertEqual(status, 0, msg='\n'.join([cmd, output]))
|
|
|
|
cmd = 'stap -v -p4 -m stap_hello --disable-cache -DSTP_NO_VERREL_CHECK -e \'probe oneshot { print("Hello, "); println("SystemTap!") }\''
|
|
status, output = self.target.run(cmd, 900)
|
|
self.assertEqual(status, 0, msg='\n'.join([cmd, output]))
|
|
|
|
cmd = 'staprun -v -R -b1 stap_hello.ko'
|
|
self.assertEqual(status, 0, msg='\n'.join([cmd, output]))
|
|
self.assertIn('Hello, SystemTap!', output, msg='\n'.join([cmd, output]))
|
|
except:
|
|
status, dmesg = self.target.run('dmesg')
|
|
if status == 0:
|
|
print(dmesg)
|