runtime_test.py 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. #
  2. # Copyright OpenEmbedded Contributors
  3. #
  4. # SPDX-License-Identifier: MIT
  5. #
  6. from oeqa.selftest.case import OESelftestTestCase
  7. from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu
  8. from oeqa.core.decorator import OETestTag
  9. import os
  10. import tempfile
  11. import oe.lsb
  12. from oeqa.core.decorator.data import skipIfNotQemu, skipIfNotMachine
  13. class TestExport(OESelftestTestCase):
  14. @OETestTag("runqemu")
  15. def test_testexport_basic(self):
  16. """
  17. Summary: Check basic testexport functionality with only ping test enabled.
  18. Expected: 1. testexport directory must be created.
  19. 2. runexported.py must run without any error/exception.
  20. 3. ping test must succeed.
  21. Product: oe-core
  22. Author: Mariano Lopez <mariano.lopez@intel.com>
  23. """
  24. features = 'IMAGE_CLASSES += "testexport"\n'
  25. # These aren't the actual IP addresses but testexport class needs something defined
  26. features += 'TEST_SERVER_IP = "192.168.7.1"\n'
  27. features += 'TEST_TARGET_IP = "192.168.7.1"\n'
  28. features += 'TEST_SUITES = "ping"\n'
  29. self.write_config(features)
  30. # Build tesexport for core-image-minimal
  31. bitbake('core-image-minimal')
  32. bitbake('-c testexport core-image-minimal')
  33. testexport_dir = get_bb_var('TEST_EXPORT_DIR', 'core-image-minimal')
  34. # Verify if TEST_EXPORT_DIR was created
  35. isdir = os.path.isdir(testexport_dir)
  36. self.assertEqual(True, isdir, 'Failed to create testexport dir: %s' % testexport_dir)
  37. with runqemu('core-image-minimal') as qemu:
  38. # Attempt to run runexported.py to perform ping test
  39. test_path = os.path.join(testexport_dir, "oe-test")
  40. data_file = os.path.join(testexport_dir, 'data', 'testdata.json')
  41. manifest = os.path.join(testexport_dir, 'data', 'manifest')
  42. cmd = ("%s runtime --test-data-file %s --packages-manifest %s "
  43. "--target-ip %s --server-ip %s --quiet"
  44. % (test_path, data_file, manifest, qemu.ip, qemu.server_ip))
  45. result = runCmd(cmd)
  46. # Verify ping test was succesful
  47. self.assertEqual(0, result.status, 'oe-test runtime returned a non 0 status')
  48. def test_testexport_sdk(self):
  49. """
  50. Summary: Check sdk functionality for testexport.
  51. Expected: 1. testexport directory must be created.
  52. 2. SDK tarball must exists.
  53. 3. Uncompressing of tarball must succeed.
  54. 4. Check if the SDK directory is added to PATH.
  55. 5. Run tar from the SDK directory.
  56. Product: oe-core
  57. Author: Mariano Lopez <mariano.lopez@intel.com>
  58. """
  59. features = 'IMAGE_CLASSES += "testexport"\n'
  60. # These aren't the actual IP addresses but testexport class needs something defined
  61. features += 'TEST_SERVER_IP = "192.168.7.1"\n'
  62. features += 'TEST_TARGET_IP = "192.168.7.1"\n'
  63. features += 'TEST_SUITES = "ping"\n'
  64. features += 'TEST_EXPORT_SDK_ENABLED = "1"\n'
  65. features += 'TEST_EXPORT_SDK_PACKAGES = "nativesdk-tar"\n'
  66. self.write_config(features)
  67. # Build tesexport for core-image-minimal
  68. bitbake('core-image-minimal')
  69. bitbake('-c testexport core-image-minimal')
  70. needed_vars = ['TEST_EXPORT_DIR', 'TEST_EXPORT_SDK_DIR', 'TEST_EXPORT_SDK_NAME']
  71. bb_vars = get_bb_vars(needed_vars, 'core-image-minimal')
  72. testexport_dir = bb_vars['TEST_EXPORT_DIR']
  73. sdk_dir = bb_vars['TEST_EXPORT_SDK_DIR']
  74. sdk_name = bb_vars['TEST_EXPORT_SDK_NAME']
  75. # Check for SDK
  76. tarball_name = "%s.sh" % sdk_name
  77. tarball_path = os.path.join(testexport_dir, sdk_dir, tarball_name)
  78. msg = "Couldn't find SDK tarball: %s" % tarball_path
  79. self.assertEqual(os.path.isfile(tarball_path), True, msg)
  80. with tempfile.TemporaryDirectory() as tmpdirname:
  81. # Extract SDK and run tar from SDK
  82. result = runCmd("%s -y -d %s" % (tarball_path, tmpdirname))
  83. self.assertEqual(0, result.status, "Couldn't extract SDK")
  84. env_script = result.output.split()[-1]
  85. result = runCmd(". %s; which tar" % env_script, shell=True)
  86. self.assertEqual(0, result.status, "Couldn't setup SDK environment")
  87. is_sdk_tar = True if tmpdirname in result.output else False
  88. self.assertTrue(is_sdk_tar, "Couldn't setup SDK environment")
  89. tar_sdk = result.output
  90. result = runCmd("%s --version" % tar_sdk)
  91. self.assertEqual(0, result.status, "Couldn't run tar from SDK")
  92. @OETestTag("runqemu")
  93. class TestImage(OESelftestTestCase):
  94. def test_testimage_install(self):
  95. """
  96. Summary: Check install packages functionality for testimage/testexport.
  97. Expected: 1. Import tests from a directory other than meta.
  98. 2. Check install/uninstall of socat.
  99. Product: oe-core
  100. Author: Mariano Lopez <mariano.lopez@intel.com>
  101. """
  102. if get_bb_var('DISTRO') == 'poky-tiny':
  103. self.skipTest('core-image-full-cmdline not buildable for poky-tiny')
  104. features = 'IMAGE_CLASSES += "testimage"\n'
  105. features += 'IMAGE_INSTALL:append = " libssl"\n'
  106. features += 'TEST_SUITES = "ping ssh selftest"\n'
  107. self.write_config(features)
  108. bitbake('core-image-full-cmdline socat')
  109. bitbake('-c testimage core-image-full-cmdline')
  110. def test_testimage_slirp(self):
  111. """
  112. Summary: Check basic testimage functionality with qemu and slirp networking.
  113. """
  114. features = '''
  115. IMAGE_CLASSES:append = " testimage"
  116. IMAGE_FEATURES:append = " ssh-server-dropbear"
  117. IMAGE_ROOTFS_EXTRA_SPACE:append = "${@bb.utils.contains("IMAGE_CLASSES", "testimage", " + 5120", "", d)}"
  118. TEST_RUNQEMUPARAMS += " slirp"
  119. '''
  120. self.write_config(features)
  121. bitbake('core-image-minimal')
  122. bitbake('-c testimage core-image-minimal')
  123. def test_testimage_dnf(self):
  124. """
  125. Summary: Check package feeds functionality for dnf
  126. Expected: 1. Check that remote package feeds can be accessed
  127. Product: oe-core
  128. Author: Alexander Kanavin <alex.kanavin@gmail.com>
  129. """
  130. if get_bb_var('DISTRO') == 'poky-tiny':
  131. self.skipTest('core-image-full-cmdline not buildable for poky-tiny')
  132. features = 'IMAGE_CLASSES += "testimage"\n'
  133. features += 'TEST_SUITES = "ping ssh dnf_runtime dnf.DnfBasicTest.test_dnf_help"\n'
  134. # We don't yet know what the server ip and port will be - they will be patched
  135. # in at the start of the on-image test
  136. features += 'PACKAGE_FEED_URIS = "http://bogus_ip:bogus_port"\n'
  137. features += 'EXTRA_IMAGE_FEATURES += "package-management"\n'
  138. features += 'PACKAGE_CLASSES = "package_rpm"\n'
  139. bitbake('gnupg-native -c addto_recipe_sysroot')
  140. # Enable package feed signing
  141. self.gpg_home = tempfile.mkdtemp(prefix="oeqa-feed-sign-")
  142. self.track_for_cleanup(self.gpg_home)
  143. signing_key_dir = os.path.join(self.testlayer_path, 'files', 'signing')
  144. runCmd('gpgconf --list-dirs --homedir %s; gpg -v --batch --homedir %s --import %s' % (self.gpg_home, self.gpg_home, os.path.join(signing_key_dir, 'key.secret')), native_sysroot=get_bb_var("RECIPE_SYSROOT_NATIVE", "gnupg-native"), shell=True)
  145. features += 'INHERIT += "sign_package_feed"\n'
  146. features += 'PACKAGE_FEED_GPG_NAME = "testuser"\n'
  147. features += 'PACKAGE_FEED_GPG_PASSPHRASE_FILE = "%s"\n' % os.path.join(signing_key_dir, 'key.passphrase')
  148. features += 'GPG_PATH = "%s"\n' % self.gpg_home
  149. self.write_config(features)
  150. bitbake('core-image-full-cmdline socat')
  151. bitbake('-c testimage core-image-full-cmdline')
  152. def test_testimage_apt(self):
  153. """
  154. Summary: Check package feeds functionality for apt
  155. Expected: 1. Check that remote package feeds can be accessed
  156. Product: oe-core
  157. Author: Ferry Toth <fntoth@gmail.com>
  158. """
  159. if get_bb_var('DISTRO') == 'poky-tiny':
  160. self.skipTest('core-image-full-cmdline not buildable for poky-tiny')
  161. features = 'IMAGE_CLASSES += "testimage"\n'
  162. features += 'TEST_SUITES = "ping ssh apt.AptRepoTest.test_apt_install_from_repo"\n'
  163. # We don't yet know what the server ip and port will be - they will be patched
  164. # in at the start of the on-image test
  165. features += 'PACKAGE_FEED_URIS = "http://bogus_ip:bogus_port"\n'
  166. features += 'EXTRA_IMAGE_FEATURES += "package-management"\n'
  167. features += 'PACKAGE_CLASSES = "package_deb"\n'
  168. # We need gnupg on the target to install keys
  169. features += 'IMAGE_INSTALL:append:pn-core-image-full-cmdline = " gnupg"\n'
  170. bitbake('gnupg-native -c addto_recipe_sysroot')
  171. # Enable package feed signing
  172. self.gpg_home = tempfile.mkdtemp(prefix="oeqa-feed-sign-")
  173. self.track_for_cleanup(self.gpg_home)
  174. signing_key_dir = os.path.join(self.testlayer_path, 'files', 'signing')
  175. runCmd('gpgconf --list-dirs --homedir %s; gpg -v --batch --homedir %s --import %s' % (self.gpg_home, self.gpg_home, os.path.join(signing_key_dir, 'key.secret')), native_sysroot=get_bb_var("RECIPE_SYSROOT_NATIVE", "gnupg-native"), shell=True)
  176. features += 'INHERIT += "sign_package_feed"\n'
  177. features += 'PACKAGE_FEED_GPG_NAME = "testuser"\n'
  178. features += 'PACKAGE_FEED_GPG_PASSPHRASE_FILE = "%s"\n' % os.path.join(signing_key_dir, 'key.passphrase')
  179. features += 'GPG_PATH = "%s"\n' % self.gpg_home
  180. self.write_config(features)
  181. # Build core-image-sato and testimage
  182. bitbake('core-image-full-cmdline socat')
  183. bitbake('-c testimage core-image-full-cmdline')
  184. # https://bugzilla.yoctoproject.org/show_bug.cgi?id=14966
  185. @skipIfNotMachine("qemux86-64", "test needs qemux86-64")
  186. def test_testimage_virgl_gtk_sdl(self):
  187. """
  188. Summary: Check host-assisted accelerate OpenGL functionality in qemu with gtk and SDL frontends
  189. Expected: 1. Check that virgl kernel driver is loaded and 3d acceleration is enabled
  190. 2. Check that kmscube demo runs without crashing.
  191. Product: oe-core
  192. Author: Alexander Kanavin <alex.kanavin@gmail.com>
  193. """
  194. if "DISPLAY" not in os.environ:
  195. self.skipTest("virgl gtk test must be run inside a X session")
  196. distro = oe.lsb.distro_identifier()
  197. if distro and distro == 'debian-8':
  198. self.skipTest('virgl isn\'t working with Debian 8')
  199. if distro and distro == 'debian-9':
  200. self.skipTest('virgl isn\'t working with Debian 9')
  201. if distro and distro == 'centos-7':
  202. self.skipTest('virgl isn\'t working with Centos 7')
  203. if distro and distro == 'opensuseleap-15.0':
  204. self.skipTest('virgl isn\'t working with Opensuse 15.0')
  205. qemu_packageconfig = get_bb_var('PACKAGECONFIG', 'qemu-system-native')
  206. qemu_distrofeatures = get_bb_var('DISTRO_FEATURES', 'qemu-system-native')
  207. features = 'IMAGE_CLASSES += "testimage"\n'
  208. if 'gtk+' not in qemu_packageconfig:
  209. features += 'PACKAGECONFIG:append:pn-qemu-system-native = " gtk+"\n'
  210. if 'sdl' not in qemu_packageconfig:
  211. features += 'PACKAGECONFIG:append:pn-qemu-system-native = " sdl"\n'
  212. if 'opengl' not in qemu_distrofeatures:
  213. features += 'DISTRO_FEATURES:append = " opengl"\n'
  214. features += 'TEST_SUITES = "ping ssh virgl"\n'
  215. features += 'IMAGE_FEATURES:append = " ssh-server-dropbear"\n'
  216. features += 'IMAGE_INSTALL:append = " kmscube"\n'
  217. features_gtk = features + 'TEST_RUNQEMUPARAMS += " gtk gl"\n'
  218. self.write_config(features_gtk)
  219. bitbake('core-image-minimal')
  220. bitbake('-c testimage core-image-minimal')
  221. features_sdl = features + 'TEST_RUNQEMUPARAMS += " sdl gl"\n'
  222. self.write_config(features_sdl)
  223. bitbake('core-image-minimal')
  224. bitbake('-c testimage core-image-minimal')
  225. @skipIfNotMachine("qemux86-64", "test needs qemux86-64")
  226. def test_testimage_virgl_headless(self):
  227. """
  228. Summary: Check host-assisted accelerate OpenGL functionality in qemu with egl-headless frontend
  229. Expected: 1. Check that virgl kernel driver is loaded and 3d acceleration is enabled
  230. 2. Check that kmscube demo runs without crashing.
  231. Product: oe-core
  232. Author: Alexander Kanavin <alex.kanavin@gmail.com>
  233. """
  234. import subprocess, os
  235. distro = oe.lsb.distro_identifier()
  236. # Merge request to address the issue on centos/rhel/derivatives:
  237. # https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3449
  238. if distro and (distro in ['debian-9', 'debian-10', 'centos-7', 'centos-8', 'centos-9', 'ubuntu-16.04', 'ubuntu-18.04'] or
  239. distro.startswith('almalinux') or distro.startswith('rocky')):
  240. self.skipTest('virgl headless cannot be tested with %s' %(distro))
  241. qemu_distrofeatures = get_bb_var('DISTRO_FEATURES', 'qemu-system-native')
  242. features = 'IMAGE_CLASSES += "testimage"\n'
  243. if 'opengl' not in qemu_distrofeatures:
  244. features += 'DISTRO_FEATURES:append = " opengl"\n'
  245. features += 'TEST_SUITES = "ping ssh virgl"\n'
  246. features += 'IMAGE_FEATURES:append = " ssh-server-dropbear"\n'
  247. features += 'IMAGE_INSTALL:append = " kmscube"\n'
  248. features += 'TEST_RUNQEMUPARAMS += " egl-headless"\n'
  249. self.write_config(features)
  250. bitbake('core-image-minimal')
  251. bitbake('-c testimage core-image-minimal')
  252. @OETestTag("runqemu")
  253. class Postinst(OESelftestTestCase):
  254. def init_manager_loop(self, init_manager):
  255. import oe.path
  256. vars = get_bb_vars(("IMAGE_ROOTFS", "sysconfdir"), "core-image-minimal")
  257. rootfs = vars["IMAGE_ROOTFS"]
  258. self.assertIsNotNone(rootfs)
  259. sysconfdir = vars["sysconfdir"]
  260. self.assertIsNotNone(sysconfdir)
  261. # Need to use oe.path here as sysconfdir starts with /
  262. hosttestdir = oe.path.join(rootfs, sysconfdir, "postinst-test")
  263. targettestdir = os.path.join(sysconfdir, "postinst-test")
  264. for classes in ("package_rpm", "package_deb", "package_ipk"):
  265. with self.subTest(init_manager=init_manager, package_class=classes):
  266. features = 'CORE_IMAGE_EXTRA_INSTALL = "postinst-delayed-b"\n'
  267. features += 'IMAGE_FEATURES += "package-management empty-root-password"\n'
  268. features += 'PACKAGE_CLASSES = "%s"\n' % classes
  269. if init_manager == "systemd":
  270. features += 'INIT_MANAGER = "systemd"\n'
  271. self.write_config(features)
  272. bitbake('core-image-minimal')
  273. self.assertTrue(os.path.isfile(os.path.join(hosttestdir, "rootfs")),
  274. "rootfs state file was not created")
  275. with runqemu('core-image-minimal') as qemu:
  276. # Make the test echo a string and search for that as
  277. # run_serial()'s status code is useless.'
  278. for filename in ("rootfs", "delayed-a", "delayed-b"):
  279. status, output = qemu.run_serial("test -f %s && echo found" % os.path.join(targettestdir, filename))
  280. self.assertIn("found", output, "%s was not present on boot" % filename)
  281. @skipIfNotQemu()
  282. def test_postinst_rootfs_and_boot_sysvinit(self):
  283. """
  284. Summary: The purpose of this test case is to verify Post-installation
  285. scripts are called when rootfs is created and also test
  286. that script can be delayed to run at first boot.
  287. Dependencies: NA
  288. Steps: 1. Add proper configuration to local.conf file
  289. 2. Build a "core-image-minimal" image
  290. 3. Verify that file created by postinst_rootfs recipe is
  291. present on rootfs dir.
  292. 4. Boot the image created on qemu and verify that the file
  293. created by postinst_boot recipe is present on image.
  294. Expected: The files are successfully created during rootfs and boot
  295. time for 3 different package managers: rpm,ipk,deb and
  296. for initialization managers: sysvinit.
  297. """
  298. self.init_manager_loop("sysvinit")
  299. @skipIfNotQemu()
  300. def test_postinst_rootfs_and_boot_systemd(self):
  301. """
  302. Summary: The purpose of this test case is to verify Post-installation
  303. scripts are called when rootfs is created and also test
  304. that script can be delayed to run at first boot.
  305. Dependencies: NA
  306. Steps: 1. Add proper configuration to local.conf file
  307. 2. Build a "core-image-minimal" image
  308. 3. Verify that file created by postinst_rootfs recipe is
  309. present on rootfs dir.
  310. 4. Boot the image created on qemu and verify that the file
  311. created by postinst_boot recipe is present on image.
  312. Expected: The files are successfully created during rootfs and boot
  313. time for 3 different package managers: rpm,ipk,deb and
  314. for initialization managers: systemd.
  315. """
  316. self.init_manager_loop("systemd")
  317. def test_failing_postinst(self):
  318. """
  319. Summary: The purpose of this test case is to verify that post-installation
  320. scripts that contain errors are properly reported.
  321. Expected: The scriptlet failure is properly reported.
  322. The file that is created after the error in the scriptlet is not present.
  323. Product: oe-core
  324. Author: Alexander Kanavin <alex.kanavin@gmail.com>
  325. """
  326. import oe.path
  327. vars = get_bb_vars(("IMAGE_ROOTFS", "sysconfdir"), "core-image-minimal")
  328. rootfs = vars["IMAGE_ROOTFS"]
  329. self.assertIsNotNone(rootfs)
  330. sysconfdir = vars["sysconfdir"]
  331. self.assertIsNotNone(sysconfdir)
  332. # Need to use oe.path here as sysconfdir starts with /
  333. hosttestdir = oe.path.join(rootfs, sysconfdir, "postinst-test")
  334. for classes in ("package_rpm", "package_deb", "package_ipk"):
  335. with self.subTest(package_class=classes):
  336. features = 'CORE_IMAGE_EXTRA_INSTALL = "postinst-rootfs-failing"\n'
  337. features += 'PACKAGE_CLASSES = "%s"\n' % classes
  338. self.write_config(features)
  339. bb_result = bitbake('core-image-minimal', ignore_status=True)
  340. self.assertGreaterEqual(bb_result.output.find("Postinstall scriptlets of ['postinst-rootfs-failing'] have failed."), 0,
  341. "Warning about a failed scriptlet not found in bitbake output: %s" %(bb_result.output))
  342. self.assertTrue(os.path.isfile(os.path.join(hosttestdir, "rootfs-before-failure")),
  343. "rootfs-before-failure file was not created")
  344. self.assertFalse(os.path.isfile(os.path.join(hosttestdir, "rootfs-after-failure")),
  345. "rootfs-after-failure file was created")
  346. @OETestTag("runqemu")
  347. class SystemTap(OESelftestTestCase):
  348. """
  349. Summary: The purpose of this test case is to verify native crosstap
  350. works while talking to a target.
  351. Expected: The script should successfully connect to the qemu machine
  352. and run some systemtap examples on a qemu machine.
  353. """
  354. @classmethod
  355. def setUpClass(cls):
  356. super(SystemTap, cls).setUpClass()
  357. cls.image = "core-image-minimal"
  358. def default_config(self):
  359. return """
  360. # These aren't the actual IP addresses but testexport class needs something defined
  361. TEST_SERVER_IP = "192.168.7.1"
  362. TEST_TARGET_IP = "192.168.7.2"
  363. EXTRA_IMAGE_FEATURES += "tools-profile dbg-pkgs"
  364. IMAGE_FEATURES:append = " ssh-server-dropbear"
  365. # enables kernel debug symbols
  366. KERNEL_EXTRA_FEATURES:append = " features/debug/debug-kernel.scc"
  367. KERNEL_EXTRA_FEATURES:append = " features/systemtap/systemtap.scc"
  368. # add systemtap run-time into target image if it is not there yet
  369. IMAGE_INSTALL:append = " systemtap-runtime"
  370. """
  371. def test_crosstap_helloworld(self):
  372. self.write_config(self.default_config())
  373. bitbake('systemtap-native')
  374. systemtap_examples = os.path.join(get_bb_var("WORKDIR","systemtap-native"), "usr/share/systemtap/examples")
  375. bitbake(self.image)
  376. with runqemu(self.image) as qemu:
  377. cmd = "crosstap -r root@192.168.7.2 -s %s/general/helloworld.stp " % systemtap_examples
  378. result = runCmd(cmd)
  379. self.assertEqual(0, result.status, 'crosstap helloworld returned a non 0 status:%s' % result.output)
  380. def test_crosstap_pstree(self):
  381. self.write_config(self.default_config())
  382. bitbake('systemtap-native')
  383. systemtap_examples = os.path.join(get_bb_var("WORKDIR","systemtap-native"), "usr/share/systemtap/examples")
  384. bitbake(self.image)
  385. with runqemu(self.image) as qemu:
  386. cmd = "crosstap -r root@192.168.7.2 -s %s/process/pstree.stp" % systemtap_examples
  387. result = runCmd(cmd)
  388. self.assertEqual(0, result.status, 'crosstap pstree returned a non 0 status:%s' % result.output)
  389. def test_crosstap_syscalls_by_proc(self):
  390. self.write_config(self.default_config())
  391. bitbake('systemtap-native')
  392. systemtap_examples = os.path.join(get_bb_var("WORKDIR","systemtap-native"), "usr/share/systemtap/examples")
  393. bitbake(self.image)
  394. with runqemu(self.image) as qemu:
  395. cmd = "crosstap -r root@192.168.7.2 -s %s/process/ syscalls_by_proc.stp" % systemtap_examples
  396. result = runCmd(cmd)
  397. self.assertEqual(0, result.status, 'crosstap syscalls_by_proc returned a non 0 status:%s' % result.output)
  398. def test_crosstap_syscalls_by_pid(self):
  399. self.write_config(self.default_config())
  400. bitbake('systemtap-native')
  401. systemtap_examples = os.path.join(get_bb_var("WORKDIR","systemtap-native"), "usr/share/systemtap/examples")
  402. bitbake(self.image)
  403. with runqemu(self.image) as qemu:
  404. cmd = "crosstap -r root@192.168.7.2 -s %s/process/ syscalls_by_pid.stp" % systemtap_examples
  405. result = runCmd(cmd)
  406. self.assertEqual(0, result.status, 'crosstap syscalls_by_pid returned a non 0 status:%s' % result.output)