1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-19 04:02:10 +00:00
nixpkgs/nixos/tests/systemd-initrd-simple.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
617 B
Nix
Raw Normal View History

2022-03-21 03:51:50 +00:00
import ./make-test-python.nix ({ lib, pkgs, ... }: {
2022-03-20 20:11:32 +00:00
name = "systemd-initrd-simple";
machine = { pkgs, ... }: {
boot.initrd.systemd.enable = true;
2022-03-21 03:51:50 +00:00
fileSystems = lib.mkVMOverride {
"/".autoResize = true;
};
2022-03-20 20:11:32 +00:00
};
testScript = ''
2022-03-21 03:51:50 +00:00
import subprocess
oldAvail = machine.succeed("df --output=avail / | sed 1d")
machine.shutdown()
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"
2022-03-20 20:11:32 +00:00
'';
})