diff options
Diffstat (limited to 'meta/lib/oeqa/runtime/cases/systemd.py')
-rw-r--r-- | meta/lib/oeqa/runtime/cases/systemd.py | 30 |
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 @@ | |||
1 | # | 1 | # |
2 | # Copyright OpenEmbedded Contributors | ||
3 | # | ||
2 | # SPDX-License-Identifier: MIT | 4 | # SPDX-License-Identifier: MIT |
3 | # | 5 | # |
4 | 6 | ||
5 | import re | 7 | import re |
8 | import threading | ||
6 | import time | 9 | import time |
7 | 10 | ||
8 | from oeqa.runtime.case import OERuntimeTestCase | 11 | from oeqa.runtime.case import OERuntimeTestCase |
@@ -66,8 +69,8 @@ class SystemdBasicTests(SystemdTest): | |||
66 | """ | 69 | """ |
67 | endtime = time.time() + (60 * 2) | 70 | endtime = time.time() + (60 * 2) |
68 | while True: | 71 | while True: |
69 | status, output = self.target.run('SYSTEMD_BUS_TIMEOUT=240s systemctl --state=activating') | 72 | status, output = self.target.run('SYSTEMD_BUS_TIMEOUT=240s systemctl is-system-running') |
70 | if "0 loaded units listed" in output: | 73 | if "running" in output or "degraded" in output: |
71 | return (True, '') | 74 | return (True, '') |
72 | if time.time() >= endtime: | 75 | if time.time() >= endtime: |
73 | return (False, output) | 76 | return (False, output) |
@@ -134,6 +137,27 @@ class SystemdServiceTests(SystemdTest): | |||
134 | status = self.target.run('mount -oro,remount /')[0] | 137 | status = self.target.run('mount -oro,remount /')[0] |
135 | self.assertTrue(status == 0, msg='Remounting / as r/o failed') | 138 | self.assertTrue(status == 0, msg='Remounting / as r/o failed') |
136 | 139 | ||
140 | @OETestDepends(['systemd.SystemdBasicTests.test_systemd_basic']) | ||
141 | @skipIfNotFeature('minidebuginfo', 'Test requires minidebuginfo to be in DISTRO_FEATURES') | ||
142 | @OEHasPackage(['busybox']) | ||
143 | def test_systemd_coredump_minidebuginfo(self): | ||
144 | """ | ||
145 | Verify that call-stacks generated by systemd-coredump contain symbolicated call-stacks, | ||
146 | extracted from the minidebuginfo metadata (.gnu_debugdata elf section). | ||
147 | """ | ||
148 | t_thread = threading.Thread(target=self.target.run, args=("ulimit -c unlimited && sleep 1000",)) | ||
149 | t_thread.start() | ||
150 | time.sleep(1) | ||
151 | |||
152 | status, output = self.target.run('pidof sleep') | ||
153 | # cause segfault on purpose | ||
154 | self.target.run('kill -SEGV %s' % output) | ||
155 | self.assertEqual(status, 0, msg = 'Not able to find process that runs sleep, output : %s' % output) | ||
156 | |||
157 | (status, output) = self.target.run('coredumpctl info') | ||
158 | self.assertEqual(status, 0, msg='MiniDebugInfo Test failed: %s' % output) | ||
159 | self.assertEqual('sleep_for_duration (busybox.nosuid' in output, True, msg='Call stack is missing minidebuginfo symbols (functions shown as "n/a"): %s' % output) | ||
160 | |||
137 | class SystemdJournalTests(SystemdTest): | 161 | class SystemdJournalTests(SystemdTest): |
138 | 162 | ||
139 | @OETestDepends(['systemd.SystemdBasicTests.test_systemd_basic']) | 163 | @OETestDepends(['systemd.SystemdBasicTests.test_systemd_basic']) |
@@ -152,7 +176,7 @@ class SystemdJournalTests(SystemdTest): | |||
152 | """ | 176 | """ |
153 | 177 | ||
154 | # The expression chain that uniquely identifies the time boot message. | 178 | # The expression chain that uniquely identifies the time boot message. |
155 | expr_items=['Startup finished', 'kernel', 'userspace','\.$'] | 179 | expr_items=['Startup finished', 'kernel', 'userspace', r'\.$'] |
156 | try: | 180 | try: |
157 | output = self.journalctl(args='-o cat --reverse') | 181 | output = self.journalctl(args='-o cat --reverse') |
158 | except AssertionError: | 182 | except AssertionError: |