summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/runtime
diff options
context:
space:
mode:
authorEtienne Cordonnier <ecordonnier@snap.com>2024-06-13 12:56:21 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-06-24 12:43:40 +0100
commitd87082efa5daecac35bff3391d06d5d37de48cc4 (patch)
tree0888f5d91244b2de7509cb78f53c0a7ca2cc3f91 /meta/lib/oeqa/runtime
parentedba6889b48dd80b5696320ec402478f7eb5c84d (diff)
downloadpoky-d87082efa5daecac35bff3391d06d5d37de48cc4.tar.gz
oeqa/runtime: fix race-condition in minidebuginfo test
Fix this error where 'coredumpctl info' warns that the coredump is still being processed: ``` AssertionError: 1 != 0 : MiniDebugInfo Test failed: No match found. -- Notice: 1 systemd-coredump@.service unit is running, output may be incomplete. ``` (From OE-Core rev: ad1ce64f5c1f22a7b10025d8cba20dc74354ac81) (From OE-Core rev: ed562345d5a5f2edb649028553199f3f7966e19e) Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/runtime')
-rw-r--r--meta/lib/oeqa/runtime/cases/systemd.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/meta/lib/oeqa/runtime/cases/systemd.py b/meta/lib/oeqa/runtime/cases/systemd.py
index 80fdae240a..640f28abe9 100644
--- a/meta/lib/oeqa/runtime/cases/systemd.py
+++ b/meta/lib/oeqa/runtime/cases/systemd.py
@@ -150,12 +150,21 @@ class SystemdServiceTests(SystemdTest):
150 t_thread.start() 150 t_thread.start()
151 time.sleep(1) 151 time.sleep(1)
152 152
153 status, output = self.target.run('pidof sleep') 153 status, sleep_pid = self.target.run('pidof sleep')
154 # cause segfault on purpose 154 # cause segfault on purpose
155 self.target.run('kill -SEGV %s' % output) 155 self.target.run('kill -SEGV %s' % sleep_pid)
156 self.assertEqual(status, 0, msg = 'Not able to find process that runs sleep, output : %s' % output) 156 self.assertEqual(status, 0, msg = 'Not able to find process that runs sleep, output : %s' % sleep_pid)
157 157
158 (status, output) = self.target.run('coredumpctl info') 158 # Give some time to systemd-coredump@.service to process the coredump
159 for x in range(20):
160 status, output = self.target.run('coredumpctl list %s' % sleep_pid)
161 if status == 0:
162 break
163 time.sleep(1)
164 else:
165 self.fail("Timed out waiting for coredump creation")
166
167 (status, output) = self.target.run('coredumpctl info %s' % sleep_pid)
159 self.assertEqual(status, 0, msg='MiniDebugInfo Test failed: %s' % output) 168 self.assertEqual(status, 0, msg='MiniDebugInfo Test failed: %s' % output)
160 self.assertEqual('sleep_for_duration (busybox.nosuid' in output or 'xnanosleep (sleep.coreutils' in output, 169 self.assertEqual('sleep_for_duration (busybox.nosuid' in output or 'xnanosleep (sleep.coreutils' in output,
161 True, msg='Call stack is missing minidebuginfo symbols (functions shown as "n/a"): %s' % output) 170 True, msg='Call stack is missing minidebuginfo symbols (functions shown as "n/a"): %s' % output)