nixosTests.systemd-sysupdate: use updatectl as frontend for updates

This commit is contained in:
Jared Baur
2025-07-11 23:45:16 -07:00
parent 996cc69171
commit 61d37d7733

View File

@@ -1,7 +1,7 @@
# Tests downloading a signed update artifact from a server to a target machine. # Tests downloading a signed update artifact from a server to a target machine.
# This test does not rely on the `systemd.timer` units provided by the # This test does not rely on the `systemd.timer` units provided by the
# `systemd-sysupdate` module but triggers the `systemd-sysupdate` service # `systemd-sysupdate` module but triggers the `updatectl` tool directly to
# manually to make the test more robust. # demonstrate how to initiate updates manually.
{ lib, pkgs, ... }: { lib, pkgs, ... }:
@@ -62,7 +62,8 @@ in
testScript = '' testScript = ''
server.wait_for_unit("nginx.service") server.wait_for_unit("nginx.service")
target.succeed("systemctl start systemd-sysupdate") print(target.succeed("updatectl list"))
target.succeed("updatectl update")
assert "nixos" in target.wait_until_succeeds("cat /nixos_1.txt", timeout=5) assert "nixos" in target.wait_until_succeeds("cat /nixos_1.txt", timeout=5)
''; '';
} }