summaryrefslogtreecommitdiffstats
path: root/meta-yocto-bsp/lib/oeqa/selftest/cases
diff options
context:
space:
mode:
Diffstat (limited to 'meta-yocto-bsp/lib/oeqa/selftest/cases')
-rw-r--r--meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py74
1 files changed, 0 insertions, 74 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
deleted file mode 100644
index 781763d1f1..0000000000
--- a/meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py
+++ /dev/null
@@ -1,74 +0,0 @@
1import os
2
3from oeqa.selftest.case import OESelftestTestCase
4from oeqa.core.decorator.depends import OETestDepends
5from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu
6
7class Systemdboot(OESelftestTestCase):
8
9 def test_efi_systemdboot_images_can_be_built(self):
10 """
11 Summary: Check if systemd-boot images can be built correctly
12 Expected: 1. File systemd-boot.efi should be available in $poky/build/tmp/deploy/images/genericx86-64
13 2. 'systemd-boot" can be built correctly
14 Product: oe-core
15 Author: Jose Perez Carranza <jose.perez.carranza@intel.com>
16 AutomatedBy: Jose Perez Carranza <jose.perez.carranza@intel.com>
17 """
18
19 # Set EFI_PROVIDER = "systemdboot" and MACHINE = "genericx86-64" in conf/local.conf
20 features = 'EFI_PROVIDER = "systemd-boot"\n'
21 features += 'MACHINE = "genericx86-64"\n'
22 features += 'IMAGE_FSTYPES += "wic"\n'
23 features += 'COMPATIBLE_MACHINE:pn-ssh-pregen-hostkeys:genericx86-64 = "genericx86-64"\n'
24 self.append_config(features)
25
26 image = 'core-image-minimal'
27 bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_LINK_NAME'], image)
28 systemdbootfile = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], 'systemd-bootx64.efi')
29
30 # Ensure we're actually testing that this gets built and not that
31 # it was around from an earlier build
32 bitbake('-c clean systemd-boot')
33 runCmd('rm -f %s' % systemdbootfile)
34
35 # Build a genericx86-64/efi systemdboot image
36 bitbake('mtools-native core-image-minimal wic-tools')
37
38 found = os.path.isfile(systemdbootfile)
39 self.assertTrue(found, 'Systemd-Boot file %s not found' % systemdbootfile)
40
41 """
42 Summary: Check if EFI bootloader for systemd is correctly build
43 Dependencies: Image was built correctly on testcase 1445
44 Steps: 1. Copy bootx64.efi file from the wic created
45 under build/tmp/deploy/images/genericx86-64
46 2. Check bootx64.efi was copied from wic
47 3. Verify the checksums from the copied and previously
48 created file are equal.
49 Expected : Systemd-bootx64.efi and bootx64.efi should be the same
50 hence checksums should be equal.
51 Product: oe-core
52 Author: Jose Perez Carranza <jose.perez.carranza at linux-intel.com>
53 AutomatedBy: Jose Perez Carranza <jose.perez.carranza at linux-intel.com>
54 """
55
56 systemdbootimage = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], '%s.wic' % bb_vars['IMAGE_LINK_NAME'])
57 imagebootfile = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], 'bootx64.efi')
58
59 # Clean environment before start the test
60 if os.path.isfile(imagebootfile):
61 runCmd('rm -f %s' % imagebootfile)
62
63 sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
64
65 runCmd('wic cp %s:1/EFI/BOOT/bootx64.efi %s -n %s' % (systemdbootimage,
66 imagebootfile, sysroot))
67
68 found = os.path.isfile(imagebootfile)
69 self.assertTrue(found, 'bootx64.efi file %s was not copied from image'
70 % imagebootfile)
71
72 result = runCmd('md5sum %s %s' % (systemdbootfile, imagebootfile))
73 self.assertEqual(result.output.split()[0], result.output.split()[2],
74 '%s was not correclty generated' % imagebootfile)