summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/runtime/cases/systemd.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/runtime/cases/systemd.py')
-rw-r--r--meta/lib/oeqa/runtime/cases/systemd.py30
1 files changed, 27 insertions, 3 deletions
diff --git a/meta/lib/oeqa/runtime/cases/systemd.py b/meta/lib/oeqa/runtime/cases/systemd.py
index 7c44abe8ed..5481e1d840 100644
--- a/meta/lib/oeqa/runtime/cases/systemd.py
+++ b/meta/lib/oeqa/runtime/cases/systemd.py
@@ -1,8 +1,11 @@
#
+# Copyright OpenEmbedded Contributors
+#
# SPDX-License-Identifier: MIT
#
import re
+import threading
import time
from oeqa.runtime.case import OERuntimeTestCase
@@ -66,8 +69,8 @@ class SystemdBasicTests(SystemdTest):
"""
endtime = time.time() + (60 * 2)
while True:
- status, output = self.target.run('SYSTEMD_BUS_TIMEOUT=240s systemctl --state=activating')
- if "0 loaded units listed" in output:
+ status, output = self.target.run('SYSTEMD_BUS_TIMEOUT=240s systemctl is-system-running')
+ if "running" in output or "degraded" in output:
return (True, '')
if time.time() >= endtime:
return (False, output)
@@ -134,6 +137,27 @@ class SystemdServiceTests(SystemdTest):
status = self.target.run('mount -oro,remount /')[0]
self.assertTrue(status == 0, msg='Remounting / as r/o failed')
+ @OETestDepends(['systemd.SystemdBasicTests.test_systemd_basic'])
+ @skipIfNotFeature('minidebuginfo', 'Test requires minidebuginfo to be in DISTRO_FEATURES')
+ @OEHasPackage(['busybox'])
+ def test_systemd_coredump_minidebuginfo(self):
+ """
+ Verify that call-stacks generated by systemd-coredump contain symbolicated call-stacks,
+ extracted from the minidebuginfo metadata (.gnu_debugdata elf section).
+ """
+ t_thread = threading.Thread(target=self.target.run, args=("ulimit -c unlimited && sleep 1000",))
+ t_thread.start()
+ time.sleep(1)
+
+ status, output = self.target.run('pidof sleep')
+ # cause segfault on purpose
+ self.target.run('kill -SEGV %s' % output)
+ self.assertEqual(status, 0, msg = 'Not able to find process that runs sleep, output : %s' % output)
+
+ (status, output) = self.target.run('coredumpctl info')
+ self.assertEqual(status, 0, msg='MiniDebugInfo Test failed: %s' % output)
+ self.assertEqual('sleep_for_duration (busybox.nosuid' in output, True, msg='Call stack is missing minidebuginfo symbols (functions shown as "n/a"): %s' % output)
+
class SystemdJournalTests(SystemdTest):
@OETestDepends(['systemd.SystemdBasicTests.test_systemd_basic'])
@@ -152,7 +176,7 @@ class SystemdJournalTests(SystemdTest):
"""
# The expression chain that uniquely identifies the time boot message.
- expr_items=['Startup finished', 'kernel', 'userspace','\.$']
+ expr_items=['Startup finished', 'kernel', 'userspace', r'\.$']
try:
output = self.journalctl(args='-o cat --reverse')
except AssertionError: