summaryrefslogtreecommitdiffstats
path: root/meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py')
-rw-r--r--meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py52
1 files changed, 52 insertions, 0 deletions
diff --git a/meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py b/meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py
new file mode 100644
index 0000000000..848cdf7852
--- /dev/null
+++ b/meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py
@@ -0,0 +1,52 @@
1import os
2
3from oeqa.selftest.case import OESelftestTestCase
4from oeqa.core.decorator.oeid import OETestID
5from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
6
7class Systemdboot(OESelftestTestCase):
8 def _common_setup(self):
9 """
10 Common setup for test cases: 1445, XXXX
11 """
12
13 # Set EFI_PROVIDER = "gummiboot" and MACHINE = "genericx86-64" in conf/local.conf
14 features = 'EFI_PROVIDER = "systemd-boot"\n'
15 features += 'MACHINE = "genericx86-64"'
16 self.append_config(features)
17
18 def _common_build(self):
19 """
20 Common build for test cases: 1445 , XXXX
21 """
22
23 # Build a genericx86-64/efi gummiboot image
24 bitbake('mtools-native core-image-minimal')
25
26
27 @OETestID(1445)
28 def test_efi_systemdboot_images_can_be_built(self):
29 """
30 Summary: Check if systemd-boot images can be built correctly
31 Expected: 1. File systemd-boot.efi should be available in $poky/build/tmp/deploy/images/genericx86-64
32 2. 'systemd-boot" can be built correctly
33 Product: oe-core
34 Author: Jose Perez Carranza <jose.perez.carranza@intel.com>
35 AutomatedBy: Jose Perez Carranza <jose.perez.carranza@intel.com>
36 """
37
38 # We'd use DEPLOY_DIR_IMAGE here, except that we need its value for
39 # MACHINE="genericx86-64 which is probably not the one configured
40 systemdbootfile = os.path.join(get_bb_var('DEPLOY_DIR'), 'images', 'genericx86-64', 'systemd-bootx64.efi')
41
42 self._common_setup()
43
44 # Ensure we're actually testing that this gets built and not that
45 # it was around from an earlier build
46 bitbake('-c cleansstate systemd-boot')
47 runCmd('rm -f %s' % systemdbootfile)
48
49 self._common_build()
50
51 found = os.path.isfile(systemdbootfile)
52 self.assertTrue(found, 'Systemd-Boot file %s not found' % systemdbootfile)