ephemeral-rootfs vm test: the drop-in runs the check from /run/hive-rootfs-check
This commit is contained in:
parent
439cb28c8c
commit
c78d73ccd1
1 changed files with 8 additions and 4 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue