From 9bdae476ae0c7650c3cd27fe1638ad737b659a1c Mon Sep 17 00:00:00 2001 From: nikstur Date: Tue, 23 Jun 2026 13:17:30 +0200 Subject: [PATCH] nixos/tests/systemd-boot: fix update test for systemd 261 This test breaks with systemd 261 because the parsing of PEs has been changed. This fixes it by using a version that is closer to actual systemd versions but still always older than any reasonable actual version of systemd. --- nixos/tests/systemd-boot.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nixos/tests/systemd-boot.nix b/nixos/tests/systemd-boot.nix index c2d9131f1974..e001f11ce3a3 100644 --- a/nixos/tests/systemd-boot.nix +++ b/nixos/tests/systemd-boot.nix @@ -460,6 +460,9 @@ in nodes.machine = common; testScript = + let + oldVersion = "222"; + in # python '' machine.succeed("mount -o remount,rw /boot") @@ -469,13 +472,13 @@ in machine.succeed( """ find /boot -iname '*boot*.efi' -print0 | \ - xargs -0 -I '{}' sed -i 's/#### LoaderInfo: systemd-boot .* ####/#### LoaderInfo: systemd-boot 000.0-1-notnixos ####/' '{}' + xargs -0 -I '{}' sed -i 's/#### LoaderInfo: systemd-boot .* ####/#### LoaderInfo: systemd-boot ${oldVersion} ####/' '{}' """ ) return machine.succeed("/run/current-system/bin/switch-to-configuration boot 2>&1") output = switch() - assert "updating systemd-boot from 000.0-1-notnixos to " in output, "Couldn't find systemd-boot update message" + assert "updating systemd-boot from ${oldVersion} to " in output, "Couldn't find systemd-boot update message" assert 'to "/boot/EFI/systemd/systemd-bootx64.efi"' in output, "systemd-boot not copied to to /boot/EFI/systemd/systemd-bootx64.efi" assert 'to "/boot/EFI/BOOT/BOOTX64.EFI"' in output, "systemd-boot not copied to to /boot/EFI/BOOT/BOOTX64.EFI" @@ -486,7 +489,7 @@ in "mv /boot/EFI/BOOT/bootx64.efi.new /boot/EFI/BOOT/bootx64.efi", ) output = switch() - assert "updating systemd-boot from 000.0-1-notnixos to " in output, "Couldn't find systemd-boot update message" + assert "updating systemd-boot from ${oldVersion} to " in output, "Couldn't find systemd-boot update message" assert 'to "/boot/EFI/systemd/systemd-bootx64.efi"' in output, "systemd-boot not copied to to /boot/EFI/systemd/systemd-bootx64.efi" assert 'to "/boot/EFI/BOOT/BOOTX64.EFI"' in output, "systemd-boot not copied to to /boot/EFI/BOOT/BOOTX64.EFI" '';