diff options
author | Mykhaylo Sul <ext-mykhaylo.sul@here.com> | 2019-11-05 10:05:27 +0100 |
---|---|---|
committer | Patrick Vacek <patrickvacek@gmail.com> | 2019-11-20 10:42:32 +0100 |
commit | c020b3fde33bc532a5f90c7325fcb889f790ddec (patch) | |
tree | 3be8fdf07e46df2b086de5fb9f903666e7aaac2c /lib/oeqa | |
parent | d9cd0e37d52ac4cbe17173af134424722232a0ae (diff) | |
download | meta-updater-c020b3fde33bc532a5f90c7325fcb889f790ddec.tar.gz |
OTA-3988: oe-selftest for the non-systemd case
Signed-off-by: Mykhaylo Sul <ext-mykhaylo.sul@here.com>
Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
Diffstat (limited to 'lib/oeqa')
-rw-r--r-- | lib/oeqa/selftest/cases/updater_qemux86_64.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/lib/oeqa/selftest/cases/updater_qemux86_64.py b/lib/oeqa/selftest/cases/updater_qemux86_64.py index 4506300..5f152ad 100644 --- a/lib/oeqa/selftest/cases/updater_qemux86_64.py +++ b/lib/oeqa/selftest/cases/updater_qemux86_64.py | |||
@@ -465,4 +465,40 @@ class ResourceControlTests(OESelftestTestCase): | |||
465 | stdout, stderr, retcode = self.qemu_command('systemctl --no-pager show --property=ExecMainStatus aktualizr') | 465 | stdout, stderr, retcode = self.qemu_command('systemctl --no-pager show --property=ExecMainStatus aktualizr') |
466 | self.assertIn(b'ExecMainStatus=0', stdout, 'Aktualizr did not restart') | 466 | self.assertIn(b'ExecMainStatus=0', stdout, 'Aktualizr did not restart') |
467 | 467 | ||
468 | |||
469 | class NonSystemdTests(OESelftestTestCase): | ||
470 | def setUpLocal(self): | ||
471 | layer = "meta-updater-qemux86-64" | ||
472 | result = runCmd('bitbake-layers show-layers') | ||
473 | if re.search(layer, result.output) is None: | ||
474 | self.meta_qemu = metadir() + layer | ||
475 | runCmd('bitbake-layers add-layer "%s"' % self.meta_qemu) | ||
476 | else: | ||
477 | self.meta_qemu = None | ||
478 | self.append_config('MACHINE = "qemux86-64"') | ||
479 | self.append_config('SOTA_CLIENT_PROV = " aktualizr-shared-prov "') | ||
480 | self.append_config('IMAGE_FSTYPES_remove = "ostreepush garagesign garagecheck"') | ||
481 | self.append_config('DISTRO = "poky-sota"') | ||
482 | self.append_config('IMAGE_INSTALL_remove += " aktualizr-resource-control"') | ||
483 | self.qemu, self.s = qemu_launch(machine='qemux86-64') | ||
484 | |||
485 | def tearDownLocal(self): | ||
486 | qemu_terminate(self.s) | ||
487 | if self.meta_qemu: | ||
488 | runCmd('bitbake-layers remove-layer "%s"' % self.meta_qemu, ignore_status=True) | ||
489 | |||
490 | def qemu_command(self, command): | ||
491 | return qemu_send_command(self.qemu.ssh_port, command) | ||
492 | |||
493 | def test_provisioning(self): | ||
494 | print('Checking if systemd is not installed...') | ||
495 | stdout, stderr, retcode = self.qemu_command('systemctl') | ||
496 | self.assertTrue(retcode != 0, 'systemd is installed while it is not supposed to: ' + str(stdout)) | ||
497 | |||
498 | stdout, stderr, retcode = self.qemu_command('aktualizr --run-mode once') | ||
499 | self.assertEqual(retcode, 0, 'Failed to run aktualizr: ' + str(stdout) + str(stderr)) | ||
500 | |||
501 | machine = get_bb_var('MACHINE', 'core-image-minimal') | ||
502 | verifyProvisioned(self, machine) | ||
503 | |||
468 | # vim:set ts=4 sw=4 sts=4 expandtab: | 504 | # vim:set ts=4 sw=4 sts=4 expandtab: |