diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2018-07-31 13:09:37 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-07-31 22:47:36 +0100 |
commit | e8143566ccbfdc2adec3e38ce546486e2942a1a1 (patch) | |
tree | b511711ee559b947a92014aea876fa86ad1e635b /meta/lib/oeqa/runtime/cases | |
parent | 983c24aa2384807cff0e67b2daed4eefc06dd46a (diff) | |
download | poky-e8143566ccbfdc2adec3e38ce546486e2942a1a1.tar.gz |
systemd.py: increase default bus timeout
Use SYSTEMD_BUS_TIMEOUT to set default timeout to 240s to avoid
timeout problem on slow qemu machines.
(From OE-Core rev: a5b1dcabdd84915eb0527be4e7bd64ab46860d9d)
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/runtime/cases')
-rw-r--r-- | meta/lib/oeqa/runtime/cases/systemd.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/meta/lib/oeqa/runtime/cases/systemd.py b/meta/lib/oeqa/runtime/cases/systemd.py index db69384c8a..460b8fc3a1 100644 --- a/meta/lib/oeqa/runtime/cases/systemd.py +++ b/meta/lib/oeqa/runtime/cases/systemd.py | |||
@@ -11,11 +11,11 @@ from oeqa.core.decorator.data import skipIfNotFeature | |||
11 | class SystemdTest(OERuntimeTestCase): | 11 | class SystemdTest(OERuntimeTestCase): |
12 | 12 | ||
13 | def systemctl(self, action='', target='', expected=0, verbose=False): | 13 | def systemctl(self, action='', target='', expected=0, verbose=False): |
14 | command = 'systemctl %s %s' % (action, target) | 14 | command = 'SYSTEMD_BUS_TIMEOUT=240s systemctl %s %s' % (action, target) |
15 | status, output = self.target.run(command) | 15 | status, output = self.target.run(command) |
16 | message = '\n'.join([command, output]) | 16 | message = '\n'.join([command, output]) |
17 | if status != expected and verbose: | 17 | if status != expected and verbose: |
18 | cmd = 'systemctl status --full %s' % target | 18 | cmd = 'SYSTEMD_BUS_TIMEOUT=240s systemctl status --full %s' % target |
19 | message += self.target.run(cmd)[1] | 19 | message += self.target.run(cmd)[1] |
20 | self.assertEqual(status, expected, message) | 20 | self.assertEqual(status, expected, message) |
21 | return output | 21 | return output |
@@ -63,7 +63,7 @@ class SystemdBasicTests(SystemdTest): | |||
63 | """ | 63 | """ |
64 | endtime = time.time() + (60 * 2) | 64 | endtime = time.time() + (60 * 2) |
65 | while True: | 65 | while True: |
66 | status, output = self.target.run('systemctl --state=activating') | 66 | status, output = self.target.run('SYSTEMD_BUS_TIMEOUT=240s systemctl --state=activating') |
67 | if "0 loaded units listed" in output: | 67 | if "0 loaded units listed" in output: |
68 | return (True, '') | 68 | return (True, '') |
69 | if time.time() >= endtime: | 69 | if time.time() >= endtime: |