summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmin Kuster <akuster808@gmail.com>2019-11-07 13:25:34 -0800
committerArmin Kuster <akuster808@gmail.com>2019-11-10 08:11:39 -0800
commit37c1b70d5b30641792bac7d414fa3afa497cb698 (patch)
tree3784250adc79ed3e1068d6c1faafd98aeac69f52
parent2f0c6fd7d4ac2dbef5366ba2d49a02457931ab67 (diff)
downloadopenembedded-core-contrib-akuster/qa_changes.tar.gz
OEQA: add crosstab selftestakuster/qa_changes
Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta/lib/oeqa/selftest/cases/runtime_test.py52
-rw-r--r--meta/lib/oeqa/selftest/files/trace_open.stp5
-rw-r--r--meta/lib/oeqa/selftest/files/trace_open2.stp4
3 files changed, 61 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py
index 28804ea15e..63206e3c35 100644
--- a/meta/lib/oeqa/selftest/cases/runtime_test.py
+++ b/meta/lib/oeqa/selftest/cases/runtime_test.py
@@ -339,3 +339,55 @@ class Bsp(OESelftestTestCase):
with runqemu('core-image-minimal') as qemu:
result = runCmd("which bash" , shell=True)
self.assertEqual(0, result.status, "Couldn't find bash")
+
+
+class SystemTap(OESelftestTestCase):
+ """
+ Summary: The purpose of this test case is to verify native crosstap
+ works while talking to a target. Test came from manual.
+ Expected: The script should successfully connect to the qemu machine
+ and there should be presented a list of services
+ (pid, process name) which run on the qemu machine.
+ """
+
+ @classmethod
+ def setUpClass(cls):
+ super(SystemTap, cls).setUpClass()
+ cls.tmpdir_stapQA = tempfile.mkdtemp(prefix='stap')
+ runCmd('cp %s/../selftest/files/*.stp %s' % (cls.tc.files_dir, cls.tmpdir_stapQA))
+
+ @classmethod
+ def tearDownClass(cls):
+ shutil.rmtree(cls.tmpdir_stapQA, ignore_errors=True)
+
+ def test_crosstap_script(self):
+ # These aren't the actual IP addresses but testexport class needs something defined
+ target_ip = "192.168.7.2"
+ features = 'TEST_SERVER_IP = "192.168.7.1"\n'
+ features += 'TEST_TARGET_IP = "%s"\n' % target_ip
+
+ features += 'EXTRA_IMAGE_FEATURES += "tools-profile"\n'
+ features += 'IMAGE_FEATURES_append = " ssh-server-dropbear"\n'
+
+ # crosstap setup
+ features += 'IMAGE_GEN_DEBUGFS = "1"\n'
+ features += 'IMAGE_FSTYPES_DEBUGFS = "tar.bz2"\n'
+ features += 'USER_CLASSES += "image-combined-dbg"\n'
+
+ # enables kernel debug symbols
+ features += 'KERNEL_EXTRA_FEATURES_append = " features/debug/debug-kernel.scc"\n'
+ features += 'KERNEL_EXTRA_FEATURES_append = " features/systemtap/systemtap.scc"\n'
+
+ # add systemtap run-time into target image if it is not there yet
+ features += 'IMAGE_INSTALL_append = " systemtap"\n'
+
+ self.write_config(features)
+
+ bitbake('systemtap-native')
+ bitbake('core-image-minimal')
+
+ with runqemu('core-image-minimal') as qemu:
+ cmd = "crosstap -r root@%s -s %s/trace_open2.stp " % (target_ip, self.tmpdir_stapQA)
+ result = runCmd(cmd)
+ self.assertEqual(0, result.status, 'crosstap runtime returned a non 0 status:%s' % result.output)
+
diff --git a/meta/lib/oeqa/selftest/files/trace_open.stp b/meta/lib/oeqa/selftest/files/trace_open.stp
new file mode 100644
index 0000000000..29b73d243a
--- /dev/null
+++ b/meta/lib/oeqa/selftest/files/trace_open.stp
@@ -0,0 +1,5 @@
+probe syscall.open
+
+{
+printf ("%s(%d) open (%s)", execname(), pid(), argstr)
+}
diff --git a/meta/lib/oeqa/selftest/files/trace_open2.stp b/meta/lib/oeqa/selftest/files/trace_open2.stp
new file mode 100644
index 0000000000..b59c00f051
--- /dev/null
+++ b/meta/lib/oeqa/selftest/files/trace_open2.stp
@@ -0,0 +1,4 @@
+probe syscall.open
+{
+printf ("%s(%d) open", execname(), pid())
+}