diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/oeqa/selftest/cases/updater.py | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/oeqa/selftest/cases/updater.py b/lib/oeqa/selftest/cases/updater.py index 06884e5..e459ffb 100644 --- a/lib/oeqa/selftest/cases/updater.py +++ b/lib/oeqa/selftest/cases/updater.py | |||
| @@ -548,6 +548,47 @@ class SecondaryTests(OESelftestTestCase): | |||
| 548 | stdout, stderr, retcode = self.qemu_command('echo test | nc localhost 9030') | 548 | stdout, stderr, retcode = self.qemu_command('echo test | nc localhost 9030') |
| 549 | self.assertEqual(retcode, 0, "Unable to connect to secondary") | 549 | self.assertEqual(retcode, 0, "Unable to connect to secondary") |
| 550 | 550 | ||
| 551 | |||
| 552 | class PrimaryTests(OESelftestTestCase): | ||
| 553 | @classmethod | ||
| 554 | def setUpClass(cls): | ||
| 555 | super(PrimaryTests, cls).setUpClass() | ||
| 556 | logger = logging.getLogger("selftest") | ||
| 557 | logger.info('Running bitbake to build primary-image') | ||
| 558 | bitbake('primary-image') | ||
| 559 | |||
| 560 | def setUpLocal(self): | ||
| 561 | layer = "meta-updater-qemux86-64" | ||
| 562 | result = runCmd('bitbake-layers show-layers') | ||
| 563 | if re.search(layer, result.output) is None: | ||
| 564 | # Assume the directory layout for finding other layers. We could also | ||
| 565 | # make assumptions by using 'show-layers', but either way, if the | ||
| 566 | # layers we need aren't where we expect them, we are out of like. | ||
| 567 | path = os.path.abspath(os.path.dirname(__file__)) | ||
| 568 | metadir = path + "/../../../../../" | ||
| 569 | self.meta_qemu = metadir + layer | ||
| 570 | runCmd('bitbake-layers add-layer "%s"' % self.meta_qemu) | ||
| 571 | else: | ||
| 572 | self.meta_qemu = None | ||
| 573 | self.append_config('MACHINE = "qemux86-64"') | ||
| 574 | self.append_config('SOTA_CLIENT_PROV = " aktualizr-auto-prov "') | ||
| 575 | self.append_config('SOTA_CLIENT_FEATURES = "secondary-network"') | ||
| 576 | self.qemu, self.s = qemu_launch(machine='qemux86-64', imagename='primary-image') | ||
| 577 | |||
| 578 | def tearDownLocal(self): | ||
| 579 | qemu_terminate(self.s) | ||
| 580 | if self.meta_qemu: | ||
| 581 | runCmd('bitbake-layers remove-layer "%s"' % self.meta_qemu, ignore_status=True) | ||
| 582 | |||
| 583 | def qemu_command(self, command): | ||
| 584 | return qemu_send_command(self.qemu.ssh_port, command) | ||
| 585 | |||
| 586 | def test_aktualizr_present(self): | ||
| 587 | print('Checking aktualizr is present') | ||
| 588 | stdout, stderr, retcode = self.qemu_command('aktualizr --help') | ||
| 589 | self.assertEqual(retcode, 0, "Unable to run aktualizr --help") | ||
| 590 | self.assertEqual(stderr, b'', 'Error: ' + stderr.decode()) | ||
| 591 | |||
| 551 | def qemu_launch(efi=False, machine=None, imagename=None): | 592 | def qemu_launch(efi=False, machine=None, imagename=None): |
| 552 | logger = logging.getLogger("selftest") | 593 | logger = logging.getLogger("selftest") |
| 553 | logger.info('Running bitbake to build core-image-minimal') | 594 | logger.info('Running bitbake to build core-image-minimal') |
