diff options
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/runtime_test.py | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py index 7d3922ce44..4b56e5beca 100644 --- a/meta/lib/oeqa/selftest/cases/runtime_test.py +++ b/meta/lib/oeqa/selftest/cases/runtime_test.py | |||
| @@ -322,3 +322,80 @@ class Postinst(OESelftestTestCase): | |||
| 322 | self.assertFalse(os.path.isfile(os.path.join(hosttestdir, "rootfs-after-failure")), | 322 | self.assertFalse(os.path.isfile(os.path.join(hosttestdir, "rootfs-after-failure")), |
| 323 | "rootfs-after-failure file was created") | 323 | "rootfs-after-failure file was created") |
| 324 | 324 | ||
| 325 | class SystemTap(OESelftestTestCase): | ||
| 326 | """ | ||
| 327 | Summary: The purpose of this test case is to verify native crosstap | ||
| 328 | works while talking to a target. | ||
| 329 | Expected: The script should successfully connect to the qemu machine | ||
| 330 | and run some systemtap examples on a qemu machine. | ||
| 331 | """ | ||
| 332 | |||
| 333 | @classmethod | ||
| 334 | def setUpClass(cls): | ||
| 335 | super(SystemTap, cls).setUpClass() | ||
| 336 | cls.image = "core-image-minimal" | ||
| 337 | |||
| 338 | def default_config(self): | ||
| 339 | return """ | ||
| 340 | # These aren't the actual IP addresses but testexport class needs something defined | ||
| 341 | TEST_SERVER_IP = "192.168.7.1" | ||
| 342 | TEST_TARGET_IP = "192.168.7.2" | ||
| 343 | |||
| 344 | EXTRA_IMAGE_FEATURES += "tools-profile dbg-pkgs" | ||
| 345 | IMAGE_FEATURES_append = " ssh-server-dropbear" | ||
| 346 | |||
| 347 | # enables kernel debug symbols | ||
| 348 | KERNEL_EXTRA_FEATURES_append = " features/debug/debug-kernel.scc" | ||
| 349 | KERNEL_EXTRA_FEATURES_append = " features/systemtap/systemtap.scc" | ||
| 350 | |||
| 351 | # add systemtap run-time into target image if it is not there yet | ||
| 352 | IMAGE_INSTALL_append = " systemtap" | ||
| 353 | """ | ||
| 354 | |||
| 355 | def test_crosstap_helloworld(self): | ||
| 356 | self.write_config(self.default_config()) | ||
| 357 | bitbake('systemtap-native') | ||
| 358 | systemtap_examples = os.path.join(get_bb_var("WORKDIR","systemtap-native"), "usr/share/systemtap/examples") | ||
| 359 | bitbake(self.image) | ||
| 360 | |||
| 361 | with runqemu(self.image) as qemu: | ||
| 362 | cmd = "crosstap -r root@192.168.7.2 -s %s/general/helloworld.stp " % systemtap_examples | ||
| 363 | result = runCmd(cmd) | ||
| 364 | self.assertEqual(0, result.status, 'crosstap helloworld returned a non 0 status:%s' % result.output) | ||
| 365 | |||
| 366 | def test_crosstap_pstree(self): | ||
| 367 | self.write_config(self.default_config()) | ||
| 368 | |||
| 369 | bitbake('systemtap-native') | ||
| 370 | systemtap_examples = os.path.join(get_bb_var("WORKDIR","systemtap-native"), "usr/share/systemtap/examples") | ||
| 371 | bitbake(self.image) | ||
| 372 | |||
| 373 | with runqemu(self.image) as qemu: | ||
| 374 | cmd = "crosstap -r root@192.168.7.2 -s %s/process/pstree.stp" % systemtap_examples | ||
| 375 | result = runCmd(cmd) | ||
| 376 | self.assertEqual(0, result.status, 'crosstap pstree returned a non 0 status:%s' % result.output) | ||
| 377 | |||
| 378 | def test_crosstap_syscalls_by_proc(self): | ||
| 379 | self.write_config(self.default_config()) | ||
| 380 | |||
| 381 | bitbake('systemtap-native') | ||
| 382 | systemtap_examples = os.path.join(get_bb_var("WORKDIR","systemtap-native"), "usr/share/systemtap/examples") | ||
| 383 | bitbake(self.image) | ||
| 384 | |||
| 385 | with runqemu(self.image) as qemu: | ||
| 386 | cmd = "crosstap -r root@192.168.7.2 -s %s/process/ syscalls_by_proc.stp" % systemtap_examples | ||
| 387 | result = runCmd(cmd) | ||
| 388 | self.assertEqual(0, result.status, 'crosstap syscalls_by_proc returned a non 0 status:%s' % result.output) | ||
| 389 | |||
| 390 | def test_crosstap_syscalls_by_pid(self): | ||
| 391 | self.write_config(self.default_config()) | ||
| 392 | |||
| 393 | bitbake('systemtap-native') | ||
| 394 | systemtap_examples = os.path.join(get_bb_var("WORKDIR","systemtap-native"), "usr/share/systemtap/examples") | ||
| 395 | bitbake(self.image) | ||
| 396 | |||
| 397 | with runqemu(self.image) as qemu: | ||
| 398 | cmd = "crosstap -r root@192.168.7.2 -s %s/process/ syscalls_by_pid.stp" % systemtap_examples | ||
| 399 | result = runCmd(cmd) | ||
| 400 | self.assertEqual(0, result.status, 'crosstap syscalls_by_pid returned a non 0 status:%s' % result.output) | ||
| 401 | |||
