systemd-initrd: Test autoResize
This commit is contained in:
parent
9828446608
commit
2431347042
|
@ -1,11 +1,24 @@
|
|||
import ./make-test-python.nix ({ pkgs, ... }: {
|
||||
import ./make-test-python.nix ({ lib, pkgs, ... }: {
|
||||
name = "systemd-initrd-simple";
|
||||
|
||||
machine = { pkgs, ... }: {
|
||||
boot.initrd.systemd.enable = true;
|
||||
fileSystems = lib.mkVMOverride {
|
||||
"/".autoResize = true;
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
machine.wait_for_unit("basic.target")
|
||||
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"
|
||||
'';
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue