Watch
0
0
Fork
You've already forked hyperhive
0

ephemeral-rootfs vm test: the drop-in runs the check from /run/hive-rootfs-check

This commit is contained in:
atlas 2026-11-19 10:31:49 +01:00 • committed by mara
commit c78d73ccd1

View file

@ -307,10 +307,14 @@ pkgs.testers.runNixOSTest {
]: ]:
priv_request(host, req) priv_request(host, req)
dropin = host.succeed(f"cat /run/systemd/system/container@{MACHINE}.service.d/hyperhive-limits.conf") 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 check runs from the module's link to the current package, so the
# The build the drop-in names is rooted against garbage collection. # unit text does not change with the build.
build = "/".join(dropin.split("ExecStartPre=")[1].split()[0].split("/")[:4]) assert f"ExecStartPre=/run/hive-rootfs-check check-rootfs {MACHINE}\n" in dropin, dropin
assert host.succeed(f"readlink /nix/var/nix/gcroots/hyperhive-check-rootfs/{MACHINE}").strip() == build, build 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 # `root` is a link to a directory outside the root, which the start
# script would `chmod 0700` as host root. # script would `chmod 0700` as host root.