diff options
author | Janne Heß <janne@hess.ooo> | 2022-04-04 12:57:32 +0100 |
---|---|---|
committer | Janne Heß <janne@hess.ooo> | 2022-04-11 20:04:33 +0100 |
commit | 3df2691e6b5500e853bb62591fce613603fc2478 (patch) | |
tree | c11616c68683962608af2fff5126891f3a6532ce /nixos/tests/systemd-initrd-simple.nix | |
parent | adab6ce5527a8c87f87ed0cae60a020cf9a8d942 (diff) |
nixos/stage-1-systemd: Handover between the systemds directly
Diffstat (limited to 'nixos/tests/systemd-initrd-simple.nix')
-rw-r--r-- | nixos/tests/systemd-initrd-simple.nix | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/nixos/tests/systemd-initrd-simple.nix b/nixos/tests/systemd-initrd-simple.nix index ba62cdf3bbc77..959cc87c0f267 100644 --- a/nixos/tests/systemd-initrd-simple.nix +++ b/nixos/tests/systemd-initrd-simple.nix @@ -14,14 +14,31 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: { testScript = '' import subprocess - oldAvail = machine.succeed("df --output=avail / | sed 1d") - machine.shutdown() + with subtest("handover to stage-2 systemd works"): + machine.wait_for_unit("multi-user.target") + machine.succeed("systemd-analyze | grep -q '(initrd)'") # direct handover + machine.succeed("touch /testfile") # / is writable + machine.fail("touch /nix/store/testfile") # /nix/store is not writable + # Special filesystems are mounted by systemd + machine.succeed("[ -e /run/booted-system ]") # /run + machine.succeed("[ -e /sys/class ]") # /sys + machine.succeed("[ -e /dev/null ]") # /dev + machine.succeed("[ -e /proc/1 ]") # /proc + # stage-2-init mounted more special filesystems + machine.succeed("[ -e /dev/shm ]") # /dev/shm + machine.succeed("[ -e /dev/pts/ptmx ]") # /dev/pts + machine.succeed("[ -e /run/keys ]") # /run/keys - subprocess.check_call(["qemu-img", "resize", "vm-state-machine/machine.qcow2", "+1G"]) - machine.start() - newAvail = machine.succeed("df --output=avail / | sed 1d") + with subtest("growfs works"): + oldAvail = machine.succeed("df --output=avail / | sed 1d") + machine.shutdown() - assert int(oldAvail) < int(newAvail), "File system did not grow" + subprocess.check_call(["qemu-img", "resize", "vm-state-machine/machine.qcow2", "+1G"]) + + machine.start() + newAvail = machine.succeed("df --output=avail / | sed 1d") + + assert int(oldAvail) < int(newAvail), "File system did not grow" ''; }) |