From c78d73ccd1bf2013e02ae1245d589130e498f31b Mon Sep 17 00:00:00 2001 From: atlas Date: Thu, 19 Nov 2026 10:31:49 +0100 Subject: [PATCH] ephemeral-rootfs vm test: the drop-in runs the check from /run/hive-rootfs-check --- nix/vm-tests/agent-ephemeral-rootfs.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/nix/vm-tests/agent-ephemeral-rootfs.nix b/nix/vm-tests/agent-ephemeral-rootfs.nix index ff6689d14..58e1abc93 100644 --- a/nix/vm-tests/agent-ephemeral-rootfs.nix +++ b/nix/vm-tests/agent-ephemeral-rootfs.nix @@ -307,10 +307,14 @@ pkgs.testers.runNixOSTest { ]: priv_request(host, req) dropin = host.succeed(f"cat /run/systemd/system/container@{MACHINE}.service.d/hyperhive-limits.conf") - assert "ExecStartPre=/nix/store/" in dropin and f"check-rootfs {MACHINE}\n" in dropin, dropin - # The build the drop-in names is rooted against garbage collection. - build = "/".join(dropin.split("ExecStartPre=")[1].split()[0].split("/")[:4]) - assert host.succeed(f"readlink /nix/var/nix/gcroots/hyperhive-check-rootfs/{MACHINE}").strip() == build, build + # The check runs from the module's link to the current package, so the + # unit text does not change with the build. + assert f"ExecStartPre=/run/hive-rootfs-check check-rootfs {MACHINE}\n" in dropin, dropin + assert host.succeed("readlink /run/hive-rootfs-check").strip() == "${hivePriv}/bin/hive-priv" + # The link is outside the store and is never collected, so no build is + # rooted for the container. The directory is the control for the lookup. + host.succeed("test -d /nix/var/nix/gcroots") + host.fail(f"test -e /nix/var/nix/gcroots/hyperhive-check-rootfs/{MACHINE}") # `root` is a link to a directory outside the root, which the start # script would `chmod 0700` as host root.