[oe-commits] [openembedded-core] 03/04: oeqa/runtime/cases/systemd.py: avoid timeout problem
git at git.openembedded.org
git at git.openembedded.org
Sat Jul 7 10:09:50 UTC 2018
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit 8fae0b36f2fa402f2fd06814b1caa4176fffa084
Author: Chen Qi <Qi.Chen at windriver.com>
AuthorDate: Mon Jun 25 17:33:51 2018 +0800
oeqa/runtime/cases/systemd.py: avoid timeout problem
I've encountered the following error when doing testimage.
RESULTS - systemd.SystemdBasicTests.test_systemd_list - Testcase 551: FAILED
After investigation, I found that it's not functionality issue. It's
just that the qemu was not running fast enough. And it resulted 'time out'
problem when using `systemctl list-unit-files'.
The correctness could be verified by using 'busctl' directly.
e.g.
busctl --timeout=240 call org.freedesktop.systemd1 \
/org/freedesktop/systemd1 org.freedesktop.systemd1.Manager \
ListUnitFilesByPatterns asas 0 0
Checking the source codes, I can see that the timeout is 25s. I don't
think we should patch systemd's source codes just for such a simple
runtime test case.
So instead, I change the test case to use 'busctl' directly if
'systemctl list-unit-files' gets a timeout error.
Signed-off-by: Chen Qi <Qi.Chen at windriver.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/lib/oeqa/runtime/cases/systemd.py | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/meta/lib/oeqa/runtime/cases/systemd.py b/meta/lib/oeqa/runtime/cases/systemd.py
index db69384..b4f1025 100644
--- a/meta/lib/oeqa/runtime/cases/systemd.py
+++ b/meta/lib/oeqa/runtime/cases/systemd.py
@@ -81,7 +81,19 @@ class SystemdBasicTests(SystemdTest):
@OETestID(551)
@OETestDepends(['systemd.SystemdBasicTests.test_systemd_basic'])
def test_systemd_list(self):
- self.systemctl('list-unit-files')
+ command = 'systemctl list-unit-files'
+ status, output = self.target.run(command)
+ message = '\n'.join([command, output])
+ match = re.search('Connection timed out', output)
+ if match:
+ # it's possible that qemu is running slow
+ # use busctl to check the results with timeout set to 240s
+ command = 'busctl --timeout=240 call org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager ListUnitFilesByPatterns asas 0 0'
+ status, output = self.target.run(command)
+ message = '\n'.join([command, output])
+ self.assertEqual(status, 0, message)
+ else:
+ self.assertEqual(status, 0, message)
@OETestID(550)
@OETestDepends(['systemd.SystemdBasicTests.test_systemd_basic'])
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list