diff options
author | Patrick Vacek <patrickvacek@gmail.com> | 2019-04-30 16:04:35 +0200 |
---|---|---|
committer | Patrick Vacek <patrickvacek@gmail.com> | 2019-04-30 16:12:13 +0200 |
commit | 8eaad5cbf99c026ed74cdd9ce58c6b826482113a (patch) | |
tree | d4b71fb6d1860c77b5c54d59b8b2010dc18c9d64 | |
parent | f68440e901522cc03c6151e8bca47117b18e5b6b (diff) | |
download | meta-updater-8eaad5cbf99c026ed74cdd9ce58c6b826482113a.tar.gz |
selftest: retry aktualizr failure check due to resource constraints.fix/latest-aktualizr
For some reason it now often fails if you don't briefly pause first, so
just retry it if it fails a few times.
Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
-rw-r--r-- | lib/oeqa/selftest/cases/updater_qemux86_64.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/oeqa/selftest/cases/updater_qemux86_64.py b/lib/oeqa/selftest/cases/updater_qemux86_64.py index c928093..e91cfc8 100644 --- a/lib/oeqa/selftest/cases/updater_qemux86_64.py +++ b/lib/oeqa/selftest/cases/updater_qemux86_64.py | |||
@@ -395,7 +395,7 @@ class ResourceControlTests(OESelftestTestCase): | |||
395 | self.append_config('IMAGE_INSTALL_append += " aktualizr-resource-control "') | 395 | self.append_config('IMAGE_INSTALL_append += " aktualizr-resource-control "') |
396 | self.append_config('RESOURCE_CPU_WEIGHT_pn-aktualizr = "1000"') | 396 | self.append_config('RESOURCE_CPU_WEIGHT_pn-aktualizr = "1000"') |
397 | self.append_config('RESOURCE_MEMORY_HIGH_pn-aktualizr = "50M"') | 397 | self.append_config('RESOURCE_MEMORY_HIGH_pn-aktualizr = "50M"') |
398 | self.append_config('RESOURCE_MEMORY_MAX_pn-aktualizr = "1M"') | 398 | #self.append_config('RESOURCE_MEMORY_MAX_pn-aktualizr = "1M"') |
399 | self.qemu, self.s = qemu_launch(machine='qemux86-64') | 399 | self.qemu, self.s = qemu_launch(machine='qemux86-64') |
400 | 400 | ||
401 | def tearDownLocal(self): | 401 | def tearDownLocal(self): |
@@ -408,11 +408,18 @@ class ResourceControlTests(OESelftestTestCase): | |||
408 | 408 | ||
409 | def test_aktualizr_resource_control(self): | 409 | def test_aktualizr_resource_control(self): |
410 | print('Checking aktualizr was killed') | 410 | print('Checking aktualizr was killed') |
411 | stdout, stderr, retcode = self.qemu_command('systemctl --no-pager show aktualizr') | 411 | ran_ok = False |
412 | for delay in [5, 5, 5, 5]: | ||
413 | sleep(delay) | ||
414 | stdout, stderr, retcode = self.qemu_command('systemctl --no-pager show aktualizr') | ||
415 | if retcode == 0 and b'ExecMainStatus=9' in stdout: | ||
416 | ran_ok = True | ||
417 | break | ||
418 | self.assertTrue(ran_ok, 'Aktualizr was not killed') | ||
419 | |||
412 | self.assertIn(b'CPUWeight=1000', stdout, 'CPUWeight was not set correctly') | 420 | self.assertIn(b'CPUWeight=1000', stdout, 'CPUWeight was not set correctly') |
413 | self.assertIn(b'MemoryHigh=52428800', stdout, 'MemoryHigh was not set correctly') | 421 | self.assertIn(b'MemoryHigh=52428800', stdout, 'MemoryHigh was not set correctly') |
414 | self.assertIn(b'MemoryMax=1048576', stdout, 'MemoryMax was not set correctly') | 422 | self.assertIn(b'MemoryMax=1048576', stdout, 'MemoryMax was not set correctly') |
415 | self.assertIn(b'ExecMainStatus=9', stdout, 'Aktualizr was not killed') | ||
416 | 423 | ||
417 | self.qemu_command('systemctl --runtime set-property aktualizr MemoryMax=') | 424 | self.qemu_command('systemctl --runtime set-property aktualizr MemoryMax=') |
418 | self.qemu_command('systemctl restart aktualizr') | 425 | self.qemu_command('systemctl restart aktualizr') |