diff options
-rw-r--r-- | meta/lib/oeqa/runtime/systemd.py | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/meta/lib/oeqa/runtime/systemd.py b/meta/lib/oeqa/runtime/systemd.py index 6414dd6e0e..6de84f891b 100644 --- a/meta/lib/oeqa/runtime/systemd.py +++ b/meta/lib/oeqa/runtime/systemd.py | |||
@@ -37,25 +37,19 @@ class SystemdBasicTests(SystemdTest): | |||
37 | Block until systemd has finished activating any units being activated, | 37 | Block until systemd has finished activating any units being activated, |
38 | or until two minutes has elapsed. | 38 | or until two minutes has elapsed. |
39 | 39 | ||
40 | Returns a tuple, either (True, None) if all units have finished | 40 | Returns a tuple, either (True, '') if all units have finished |
41 | acitvating, or (False, message string) if there are still units | 41 | activating, or (False, message string) if there are still units |
42 | activating (generally, failing units that restart). | 42 | activating (generally, failing units that restart). |
43 | """ | 43 | """ |
44 | import time | 44 | import time |
45 | settled = False | ||
46 | endtime = time.time() + (60 * 2) | 45 | endtime = time.time() + (60 * 2) |
47 | while time.time() < endtime: | 46 | while True: |
48 | status = self.target.run('systemctl --state=activating | grep -q "0 loaded units listed"') | ||
49 | if status == 0: | ||
50 | settled = True | ||
51 | break | ||
52 | time.sleep(10) | ||
53 | |||
54 | if settled: | ||
55 | return (True, None) | ||
56 | else: | ||
57 | status, output = self.target.run('systemctl --state=activating') | 47 | status, output = self.target.run('systemctl --state=activating') |
58 | return (settled, output) | 48 | if "0 loaded units listed" in output: |
49 | return (True, '') | ||
50 | if time.time() >= endtime: | ||
51 | return (False, output) | ||
52 | time.sleep(10) | ||
59 | 53 | ||
60 | @skipUnlessPassed('test_systemd_basic') | 54 | @skipUnlessPassed('test_systemd_basic') |
61 | def test_systemd_failed(self): | 55 | def test_systemd_failed(self): |