From 514bfa6674600e08c321b9efdab807a14835c4ff Mon Sep 17 00:00:00 2001 From: Jared Baur Date: Wed, 31 Jan 2024 09:16:04 -0800 Subject: [PATCH] nixos/sysupdate: fix systemd-sysupdate test The test fails when the `Target`'s parent directories don't exist. For the purpose of this test though, we can just download it to the root directory for simplicity. --- nixos/tests/systemd-sysupdate.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nixos/tests/systemd-sysupdate.nix b/nixos/tests/systemd-sysupdate.nix index 37811605dbb2..6592764c9ff4 100644 --- a/nixos/tests/systemd-sysupdate.nix +++ b/nixos/tests/systemd-sysupdate.nix @@ -23,8 +23,8 @@ in mkdir -p $out cd $out - echo "nixos" > nixos_1.efi - sha256sum nixos_1.efi > SHA256SUMS + echo "nixos" > nixos_1.txt + sha256sum nixos_1.txt > SHA256SUMS export GNUPGHOME="$(mktemp -d)" cp -R ${gpgKeyring}/* $GNUPGHOME @@ -39,15 +39,15 @@ in systemd.sysupdate = { enable = true; transfers = { - "uki" = { + "text-file" = { Source = { Type = "url-file"; Path = "http://server/"; - MatchPattern = "nixos_@v.efi"; + MatchPattern = "nixos_@v.txt"; }; Target = { - Path = "/boot/EFI/Linux"; - MatchPattern = "nixos_@v.efi"; + Path = "/"; + MatchPattern = [ "nixos_@v.txt" ]; }; }; }; @@ -61,6 +61,6 @@ in server.wait_for_unit("nginx.service") target.succeed("systemctl start systemd-sysupdate") - assert "nixos" in target.wait_until_succeeds("cat /boot/EFI/Linux/nixos_1.efi", timeout=5) + assert "nixos" in target.wait_until_succeeds("cat /nixos_1.txt", timeout=5) ''; }