kiwi-el8/test/unit/bootloader/install/systemd_boot_test.py
Marcus Schäfer fe478de901
Added API for BLS and systemd-boot support
Bootloaders implementing the Boot Loader Spec (BLS) are not
directly compatible with the original Bootloader Class design
in kiwi. Because of that an interface class which translates
the original API into calls following BLS was added. This allows
us to keep the implementations in the Builder classes and the
public BootLoader interface untouched. In addition to the BLS
API an implementation to support the systemd-boot loader is
part of this commit too.

An example type definition to use systemd-boot with an EFI
disk image type looks like the following:

    <type image="oem" filesystem="xfs" firmware="efi" bootloader="systemd_boot" efipartsize="200"/>

The implementation uses bootctl and kernel-install tools
provided from systemd and expects a proper integration
of systemd-boot by the distribution maintainers

This Fixes #1935
2022-11-12 17:39:22 +01:00

26 lines
655 B
Python

from mock import Mock
from pytest import raises
from kiwi.bootloader.install.systemd_boot import BootLoaderInstallSystemdBoot
class TestBootLoaderInstallSystemdBoot:
def setup(self):
self.bootloader = BootLoaderInstallSystemdBoot(
'root_dir', Mock()
)
def setup_method(self, cls):
self.setup()
def test_install(self):
with raises(NotImplementedError):
self.bootloader.install()
def test_install_required(self):
assert self.bootloader.install_required() is False
def test_secure_boot_install(self):
# just pass
self.bootloader.secure_boot_install()