2022-03-21 04:51:50 +01:00
|
|
|
import ./make-test-python.nix ({ lib, pkgs, ... }: {
|
2022-03-20 21:11:32 +01:00
|
|
|
name = "systemd-initrd-simple";
|
|
|
|
|
|
|
|
machine = { pkgs, ... }: {
|
2022-04-01 10:58:38 +02:00
|
|
|
boot.initrd.systemd = {
|
|
|
|
enable = true;
|
|
|
|
emergencyAccess = true;
|
|
|
|
};
|
2022-03-21 04:51:50 +01:00
|
|
|
fileSystems = lib.mkVMOverride {
|
|
|
|
"/".autoResize = true;
|
|
|
|
};
|
2022-03-20 21:11:32 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
2022-03-21 04:51:50 +01: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 21:11:32 +01:00
|
|
|
'';
|
|
|
|
})
|