diff options
author | California Sullivan <california.l.sullivan@intel.com> | 2018-02-28 18:15:15 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-03-06 06:35:42 -0800 |
commit | 7e9b658196ed0e4ee475d0e0a2836e851b6ede4f (patch) | |
tree | 046f09752a06615b97b146df30aca1e533ab159f /meta/lib/oeqa | |
parent | 24c88e544b37acf909ade542e5cdcb0022d40547 (diff) | |
download | poky-7e9b658196ed0e4ee475d0e0a2836e851b6ede4f.tar.gz |
selftests: Add test case for booting a generic EFI boot partition image
Simple test case that adds 'efi' to MACHINE_FEATURES, sets WKS_FILE to
"efi-bootdisk.wks.in", installed required boot items, and attempts to
boot the wic image.
Quick check to make sure that the feature actually works.
(From OE-Core rev: 192c8738f4a8d0f82848a440acf24a1892f2ce93)
Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/efibootpartition.py | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/efibootpartition.py b/meta/lib/oeqa/selftest/cases/efibootpartition.py new file mode 100644 index 0000000000..0c83256696 --- /dev/null +++ b/meta/lib/oeqa/selftest/cases/efibootpartition.py | |||
@@ -0,0 +1,45 @@ | |||
1 | # Based on runqemu.py test file | ||
2 | # | ||
3 | # Copyright (c) 2017 Wind River Systems, Inc. | ||
4 | # | ||
5 | |||
6 | import re | ||
7 | |||
8 | from oeqa.selftest.case import OESelftestTestCase | ||
9 | from oeqa.utils.commands import bitbake, runqemu, get_bb_var | ||
10 | |||
11 | class GenericEFITest(OESelftestTestCase): | ||
12 | """EFI booting test class""" | ||
13 | |||
14 | buffer = True | ||
15 | cmd_common = "runqemu nographic serial wic ovmf" | ||
16 | efi_provider = "systemd-boot" | ||
17 | image = "core-image-minimal" | ||
18 | machine = "qemux86-64" | ||
19 | recipes_built = False | ||
20 | |||
21 | @classmethod | ||
22 | def setUpLocal(self): | ||
23 | super(GenericEFITest, self).setUpLocal(self) | ||
24 | |||
25 | self.write_config(self, | ||
26 | """ | ||
27 | EFI_PROVIDER = "%s" | ||
28 | IMAGE_FSTYPES_pn-%s_append = " wic" | ||
29 | MACHINE = "%s" | ||
30 | MACHINE_FEATURES_append = " efi" | ||
31 | WKS_FILE = "efi-bootdisk.wks.in" | ||
32 | IMAGE_INSTALL_append = " grub-efi systemd-boot kernel-image-bzimage" | ||
33 | """ | ||
34 | % (self.efi_provider, self.image, self.machine)) | ||
35 | if not self.recipes_built: | ||
36 | bitbake("ovmf") | ||
37 | bitbake(self.image) | ||
38 | self.recipes_built = True | ||
39 | |||
40 | @classmethod | ||
41 | def test_boot_efi(self): | ||
42 | """Test generic boot partition with qemu""" | ||
43 | cmd = "%s %s" % (self.cmd_common, self.machine) | ||
44 | with runqemu(self.image, ssh=False, launch_cmd=cmd) as qemu: | ||
45 | self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd) | ||