diff options
Diffstat (limited to 'lib')
| l--------- | lib/oeqa/selftest/cases/qemucommand.py | 1 | ||||
| -rw-r--r-- | lib/oeqa/selftest/cases/updater.py (renamed from lib/oeqa/selftest/updater.py) | 27 | ||||
| l--------- | lib/oeqa/selftest/qemucommand.py | 1 |
3 files changed, 17 insertions, 12 deletions
diff --git a/lib/oeqa/selftest/cases/qemucommand.py b/lib/oeqa/selftest/cases/qemucommand.py new file mode 120000 index 0000000..075cdb8 --- /dev/null +++ b/lib/oeqa/selftest/cases/qemucommand.py | |||
| @@ -0,0 +1 @@ | |||
| ../../../../scripts/qemucommand.py \ No newline at end of file | |||
diff --git a/lib/oeqa/selftest/updater.py b/lib/oeqa/selftest/cases/updater.py index 8fbc857..b544762 100644 --- a/lib/oeqa/selftest/updater.py +++ b/lib/oeqa/selftest/cases/updater.py | |||
| @@ -6,15 +6,16 @@ import subprocess | |||
| 6 | import unittest | 6 | import unittest |
| 7 | from time import sleep | 7 | from time import sleep |
| 8 | 8 | ||
| 9 | from oeqa.selftest.base import oeSelfTest | 9 | from oeqa.selftest.case import OESelftestTestCase |
| 10 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars | 10 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars |
| 11 | from oeqa.selftest.qemucommand import QemuCommand | 11 | from qemucommand import QemuCommand |
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | class SotaToolsTests(oeSelfTest): | 14 | class SotaToolsTests(OESelftestTestCase): |
| 15 | 15 | ||
| 16 | @classmethod | 16 | @classmethod |
| 17 | def setUpClass(cls): | 17 | def setUpClass(cls): |
| 18 | super(SotaToolsTests, cls).setUpClass() | ||
| 18 | logger = logging.getLogger("selftest") | 19 | logger = logging.getLogger("selftest") |
| 19 | logger.info('Running bitbake to build aktualizr-native tools') | 20 | logger.info('Running bitbake to build aktualizr-native tools') |
| 20 | bitbake('aktualizr-native') | 21 | bitbake('aktualizr-native') |
| @@ -29,7 +30,7 @@ class SotaToolsTests(oeSelfTest): | |||
| 29 | akt_native_run(self, 'garage-sign --help') | 30 | akt_native_run(self, 'garage-sign --help') |
| 30 | 31 | ||
| 31 | 32 | ||
| 32 | class GeneralTests(oeSelfTest): | 33 | class GeneralTests(OESelftestTestCase): |
| 33 | 34 | ||
| 34 | def test_feature_sota(self): | 35 | def test_feature_sota(self): |
| 35 | result = get_bb_var('DISTRO_FEATURES').find('sota') | 36 | result = get_bb_var('DISTRO_FEATURES').find('sota') |
| @@ -93,10 +94,11 @@ class GeneralTests(oeSelfTest): | |||
| 93 | self.assertNotEqual(size1, size2, "Image sizes are identical; image was not rebuilt.") | 94 | self.assertNotEqual(size1, size2, "Image sizes are identical; image was not rebuilt.") |
| 94 | 95 | ||
| 95 | 96 | ||
| 96 | class AktualizrToolsTests(oeSelfTest): | 97 | class AktualizrToolsTests(OESelftestTestCase): |
| 97 | 98 | ||
| 98 | @classmethod | 99 | @classmethod |
| 99 | def setUpClass(cls): | 100 | def setUpClass(cls): |
| 101 | super(AktualizrToolsTests, cls).setUpClass() | ||
| 100 | logger = logging.getLogger("selftest") | 102 | logger = logging.getLogger("selftest") |
| 101 | logger.info('Running bitbake to build aktualizr-native tools') | 103 | logger.info('Running bitbake to build aktualizr-native tools') |
| 102 | bitbake('aktualizr-native') | 104 | bitbake('aktualizr-native') |
| @@ -132,15 +134,17 @@ class AktualizrToolsTests(oeSelfTest): | |||
| 132 | self.assertTrue(os.path.getsize(ca_path) > 0, "Client certificate at %s is empty." % ca_path) | 134 | self.assertTrue(os.path.getsize(ca_path) > 0, "Client certificate at %s is empty." % ca_path) |
| 133 | 135 | ||
| 134 | 136 | ||
| 135 | class QemuTests(oeSelfTest): | 137 | class QemuTests(OESelftestTestCase): |
| 136 | 138 | ||
| 137 | @classmethod | 139 | @classmethod |
| 138 | def setUpClass(cls): | 140 | def setUpClass(cls): |
| 141 | super(QemuTests, cls).setUpClass() | ||
| 139 | cls.qemu, cls.s = qemu_launch(machine='qemux86-64') | 142 | cls.qemu, cls.s = qemu_launch(machine='qemux86-64') |
| 140 | 143 | ||
| 141 | @classmethod | 144 | @classmethod |
| 142 | def tearDownClass(cls): | 145 | def tearDownClass(cls): |
| 143 | qemu_terminate(cls.s) | 146 | qemu_terminate(cls.s) |
| 147 | super(QemuTests, cls).tearDownClass() | ||
| 144 | 148 | ||
| 145 | def qemu_command(self, command): | 149 | def qemu_command(self, command): |
| 146 | return qemu_send_command(self.qemu.ssh_port, command) | 150 | return qemu_send_command(self.qemu.ssh_port, command) |
| @@ -168,12 +172,12 @@ class QemuTests(oeSelfTest): | |||
| 168 | self.assertTrue(ran_ok, 'aktualizr-info failed: ' + stderr.decode() + stdout.decode()) | 172 | self.assertTrue(ran_ok, 'aktualizr-info failed: ' + stderr.decode() + stdout.decode()) |
| 169 | 173 | ||
| 170 | 174 | ||
| 171 | class GrubTests(oeSelfTest): | 175 | class GrubTests(OESelftestTestCase): |
| 172 | 176 | ||
| 173 | def setUpLocal(self): | 177 | def setUpLocal(self): |
| 174 | # This is a bit of a hack but I can't see a better option. | 178 | # This is a bit of a hack but I can't see a better option. |
| 175 | path = os.path.abspath(os.path.dirname(__file__)) | 179 | path = os.path.abspath(os.path.dirname(__file__)) |
| 176 | metadir = path + "/../../../../" | 180 | metadir = path + "/../../../../../" |
| 177 | grub_config = 'OSTREE_BOOTLOADER = "grub"\nMACHINE = "intel-corei7-64"' | 181 | grub_config = 'OSTREE_BOOTLOADER = "grub"\nMACHINE = "intel-corei7-64"' |
| 178 | self.append_config(grub_config) | 182 | self.append_config(grub_config) |
| 179 | self.meta_intel = metadir + "meta-intel" | 183 | self.meta_intel = metadir + "meta-intel" |
| @@ -215,7 +219,7 @@ class GrubTests(oeSelfTest): | |||
| 215 | self.assertTrue(ran_ok, 'aktualizr-info failed: ' + stderr.decode() + stdout.decode()) | 219 | self.assertTrue(ran_ok, 'aktualizr-info failed: ' + stderr.decode() + stdout.decode()) |
| 216 | 220 | ||
| 217 | 221 | ||
| 218 | class ImplProvTests(oeSelfTest): | 222 | class ImplProvTests(OESelftestTestCase): |
| 219 | 223 | ||
| 220 | def setUpLocal(self): | 224 | def setUpLocal(self): |
| 221 | self.append_config('SOTA_CLIENT_PROV = " aktualizr-implicit-prov "') | 225 | self.append_config('SOTA_CLIENT_PROV = " aktualizr-implicit-prov "') |
| @@ -287,7 +291,7 @@ class ImplProvTests(oeSelfTest): | |||
| 287 | logger.info('Device successfully provisioned with ID: ' + m.group(1)) | 291 | logger.info('Device successfully provisioned with ID: ' + m.group(1)) |
| 288 | 292 | ||
| 289 | 293 | ||
| 290 | class HsmTests(oeSelfTest): | 294 | class HsmTests(OESelftestTestCase): |
| 291 | 295 | ||
| 292 | def setUpLocal(self): | 296 | def setUpLocal(self): |
| 293 | self.append_config('SOTA_CLIENT_PROV = "aktualizr-hsm-prov"') | 297 | self.append_config('SOTA_CLIENT_PROV = "aktualizr-hsm-prov"') |
| @@ -311,7 +315,8 @@ class HsmTests(oeSelfTest): | |||
| 311 | # Strip off line ending. | 315 | # Strip off line ending. |
| 312 | value_str = stdout.decode()[:-1] | 316 | value_str = stdout.decode()[:-1] |
| 313 | self.assertEqual(value_str, machine, | 317 | self.assertEqual(value_str, machine, |
| 314 | 'MACHINE does not match hostname: ' + machine + ', ' + value_str) | 318 | 'MACHINE does not match hostname: ' + machine + ', ' + value_str + |
| 319 | '\nIs tianocore ovmf installed?') | ||
| 315 | print(value_str) | 320 | print(value_str) |
| 316 | print('Checking output of aktualizr-info:') | 321 | print('Checking output of aktualizr-info:') |
| 317 | ran_ok = False | 322 | ran_ok = False |
diff --git a/lib/oeqa/selftest/qemucommand.py b/lib/oeqa/selftest/qemucommand.py deleted file mode 120000 index bc06dde..0000000 --- a/lib/oeqa/selftest/qemucommand.py +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | ../../../scripts/qemucommand.py \ No newline at end of file | ||
