From: Daan De Meyer Date: Thu, 27 Mar 2025 13:24:28 +0000 (+0100) Subject: test: Boot integration test VMs without an initrd if possible X-Git-Tag: v258-rc1~995^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=51b492074674d020de1d556dc2c3fa224b41e508;p=thirdparty%2Fsystemd.git test: Boot integration test VMs without an initrd if possible If we don't need an initrd, let's not waste time in one. We have to gate this by distributions that have the necessary kernel modules to make this work as builtin modules, hopefully we can expand the list in the future. --- diff --git a/test/integration-tests/TEST-08-INITRD/meson.build b/test/integration-tests/TEST-08-INITRD/meson.build index dcbfe20134c..5425096a563 100644 --- a/test/integration-tests/TEST-08-INITRD/meson.build +++ b/test/integration-tests/TEST-08-INITRD/meson.build @@ -8,5 +8,6 @@ integration_tests += [ ], 'exit-code' : 124, 'vm' : true, + 'firmware' : 'linux', }, ] diff --git a/test/integration-tests/TEST-24-CRYPTSETUP/meson.build b/test/integration-tests/TEST-24-CRYPTSETUP/meson.build index 4d65e1d9abb..c9e0271e963 100644 --- a/test/integration-tests/TEST-24-CRYPTSETUP/meson.build +++ b/test/integration-tests/TEST-24-CRYPTSETUP/meson.build @@ -22,5 +22,6 @@ integration_tests += [ '--runtime-size=11G', ], 'vm' : true, + 'firmware' : 'linux', }, ] diff --git a/test/integration-tests/integration-test-wrapper.py b/test/integration-tests/integration-test-wrapper.py index 90f40abfe21..d0989106854 100755 --- a/test/integration-tests/integration-test-wrapper.py +++ b/test/integration-tests/integration-test-wrapper.py @@ -489,6 +489,22 @@ def main() -> None: else: rtc = None + # mkosi will use the UEFI secure boot firmware by default on UEFI platforms. However, this breaks on + # Github Actions in combination with KVM because of a HyperV bug so make sure we use the non secure + # boot firmware on Github Actions. + # TODO: Drop after the HyperV bug that breaks secure boot KVM guests is solved + if args.firmware == 'auto' and os.getenv('GITHUB_ACTIONS'): + firmware = 'uefi' + # Whenever possible, boot without an initrd. This requires the target distribution kernel to have the + # necessary modules (virtio-blk, ext4) builtin. + elif args.firmware == 'linux-noinitrd' and (summary.distribution, summary.release) not in ( + ('fedora', 'rawhide'), + ('arch', 'rolling'), + ): + firmware = 'linux' + else: + firmware = args.firmware + cmd = [ args.mkosi, '--directory', os.fspath(args.meson_source_dir), @@ -508,11 +524,7 @@ def main() -> None: '--runtime-scratch=no', *([f'--qemu-args=-rtc base={rtc}'] if rtc else []), *args.mkosi_args, - # mkosi will use the UEFI secure boot firmware by default on UEFI platforms. However, this breaks on - # Github Actions in combination with KVM because of a HyperV bug so make sure we use the non secure - # boot firmware on Github Actions. - # TODO: Drop after the HyperV bug that breaks secure boot KVM guests is solved - '--firmware', 'uefi' if args.firmware == 'auto' and os.getenv("GITHUB_ACTIONS") else args.firmware, + '--firmware', firmware, *(['--kvm', 'no'] if int(os.getenv('TEST_NO_KVM', '0')) else []), '--kernel-command-line-extra', ' '.join( diff --git a/test/integration-tests/meson.build b/test/integration-tests/meson.build index ecf3df7f090..cdcc1d8dba3 100644 --- a/test/integration-tests/meson.build +++ b/test/integration-tests/meson.build @@ -7,7 +7,7 @@ integration_test_template = { 'timeout' : 1800, 'storage' : 'volatile', 'priority' : 0, - 'firmware' : 'linux', + 'firmware' : 'linux-noinitrd', 'enabled' : true, 'configuration' : { 'memory-accounting' : 'no',