diff options
Diffstat (limited to 'lib/oeqa/selftest')
| l--------- | lib/oeqa/selftest/cases/qemucommand.py | 1 | ||||
| -rw-r--r-- | lib/oeqa/selftest/cases/updater.py (renamed from lib/oeqa/selftest/updater.py) | 25 | ||||
| l--------- | lib/oeqa/selftest/qemucommand.py | 1 |
3 files changed, 16 insertions, 11 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 f28349f..9264616 100644 --- a/lib/oeqa/selftest/updater.py +++ b/lib/oeqa/selftest/cases/updater.py | |||
| @@ -1,18 +1,19 @@ | |||
| 1 | import unittest | ||
| 2 | import os | 1 | import os |
| 3 | import logging | 2 | import logging |
| 4 | import subprocess | 3 | import subprocess |
| 5 | import time | 4 | import time |
| 5 | import unittest | ||
| 6 | 6 | ||
| 7 | from oeqa.selftest.base import oeSelfTest | 7 | from oeqa.selftest.case import OESelftestTestCase |
| 8 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars | 8 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars |
| 9 | from oeqa.selftest.qemucommand import QemuCommand | 9 | from qemucommand import QemuCommand |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | class SotaToolsTests(oeSelfTest): | 12 | class SotaToolsTests(OESelftestTestCase): |
| 13 | 13 | ||
| 14 | @classmethod | 14 | @classmethod |
| 15 | def setUpClass(cls): | 15 | def setUpClass(cls): |
| 16 | super(SotaToolsTests, cls).setUpClass() | ||
| 16 | logger = logging.getLogger("selftest") | 17 | logger = logging.getLogger("selftest") |
| 17 | logger.info('Running bitbake to build aktualizr-native tools') | 18 | logger.info('Running bitbake to build aktualizr-native tools') |
| 18 | bitbake('aktualizr-native') | 19 | bitbake('aktualizr-native') |
| @@ -38,14 +39,15 @@ class SotaToolsTests(oeSelfTest): | |||
| 38 | result = runCmd('%s --help' % p, ignore_status=True) | 39 | result = runCmd('%s --help' % p, ignore_status=True) |
| 39 | self.assertEqual(result.status, 0, "Status not equal to 0. output: %s" % result.output) | 40 | self.assertEqual(result.status, 0, "Status not equal to 0. output: %s" % result.output) |
| 40 | 41 | ||
| 41 | class HsmTests(oeSelfTest): | 42 | |
| 43 | class HsmTests(OESelftestTestCase): | ||
| 42 | 44 | ||
| 43 | def test_hsm(self): | 45 | def test_hsm(self): |
| 44 | self.write_config('SOTA_CLIENT_FEATURES="hsm"') | 46 | self.write_config('SOTA_CLIENT_FEATURES="hsm"') |
| 45 | bitbake('core-image-minimal') | 47 | bitbake('core-image-minimal') |
| 46 | 48 | ||
| 47 | 49 | ||
| 48 | class GeneralTests(oeSelfTest): | 50 | class GeneralTests(OESelftestTestCase): |
| 49 | 51 | ||
| 50 | def test_feature_sota(self): | 52 | def test_feature_sota(self): |
| 51 | result = get_bb_var('DISTRO_FEATURES').find('sota') | 53 | result = get_bb_var('DISTRO_FEATURES').find('sota') |
| @@ -104,10 +106,11 @@ class GeneralTests(oeSelfTest): | |||
| 104 | self.assertNotEqual(size1, size2, "Image sizes are identical; image was not rebuilt.") | 106 | self.assertNotEqual(size1, size2, "Image sizes are identical; image was not rebuilt.") |
| 105 | 107 | ||
| 106 | 108 | ||
| 107 | class QemuTests(oeSelfTest): | 109 | class QemuTests(OESelftestTestCase): |
| 108 | 110 | ||
| 109 | @classmethod | 111 | @classmethod |
| 110 | def setUpClass(cls): | 112 | def setUpClass(cls): |
| 113 | super(QemuTests, cls).setUpClass() | ||
| 111 | cls.qemu, cls.s = qemu_launch(machine='qemux86-64') | 114 | cls.qemu, cls.s = qemu_launch(machine='qemux86-64') |
| 112 | 115 | ||
| 113 | @classmethod | 116 | @classmethod |
| @@ -133,12 +136,13 @@ class QemuTests(oeSelfTest): | |||
| 133 | self.assertEqual(err, b'', 'Error: ' + err.decode()) | 136 | self.assertEqual(err, b'', 'Error: ' + err.decode()) |
| 134 | print(value.decode()) | 137 | print(value.decode()) |
| 135 | 138 | ||
| 136 | class GrubTests(oeSelfTest): | 139 | |
| 140 | class GrubTests(OESelftestTestCase): | ||
| 137 | 141 | ||
| 138 | def setUpLocal(self): | 142 | def setUpLocal(self): |
| 139 | # This is a bit of a hack but I can't see a better option. | 143 | # This is a bit of a hack but I can't see a better option. |
| 140 | path = os.path.abspath(os.path.dirname(__file__)) | 144 | path = os.path.abspath(os.path.dirname(__file__)) |
| 141 | metadir = path + "/../../../../" | 145 | metadir = path + "/../../../../../" |
| 142 | grub_config = 'OSTREE_BOOTLOADER = "grub"\nMACHINE = "intel-corei7-64"' | 146 | grub_config = 'OSTREE_BOOTLOADER = "grub"\nMACHINE = "intel-corei7-64"' |
| 143 | self.append_config(grub_config) | 147 | self.append_config(grub_config) |
| 144 | self.meta_intel = metadir + "meta-intel" | 148 | self.meta_intel = metadir + "meta-intel" |
| @@ -161,7 +165,8 @@ class GrubTests(oeSelfTest): | |||
| 161 | # Strip off line ending. | 165 | # Strip off line ending. |
| 162 | value_str = value.decode()[:-1] | 166 | value_str = value.decode()[:-1] |
| 163 | self.assertEqual(value_str, machine, | 167 | self.assertEqual(value_str, machine, |
| 164 | 'MACHINE does not match hostname: ' + machine + ', ' + value_str) | 168 | 'MACHINE does not match hostname: ' + machine + ', ' + value_str + |
| 169 | '\nIs tianocore ovmf installed?') | ||
| 165 | print(value_str) | 170 | print(value_str) |
| 166 | 171 | ||
| 167 | 172 | ||
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 | ||
