nixpkgs/nixos/tests/lvm2/vdo.nix
Simon Hauser c4edf93988
Cleanup helsinki maintainer (#353611)
* maintainers: update email conni2461

* maintainers: add helsinki-jo

* tree-wide: cleanup maintainership of helsinki-systems
2024-11-04 12:59:26 +01:00

28 lines
1015 B
Nix

{ kernelPackages ? null, mkXfsFlags ? "" }:
import ../make-test-python.nix ({ pkgs, lib, ... }: {
name = "lvm2-vdo";
meta.maintainers = [ ];
nodes.machine = { pkgs, lib, ... }: {
# Minimum required size for VDO volume: 5063921664 bytes
virtualisation.emptyDiskImages = [ 8192 ];
services.lvm = {
boot.vdo.enable = true;
dmeventd.enable = true;
};
environment.systemPackages = with pkgs; [ xfsprogs ];
boot = lib.mkIf (kernelPackages != null) { inherit kernelPackages; };
};
testScript = ''
machine.succeed("vgcreate test_vg /dev/vdb")
machine.succeed("lvcreate --type vdo -n vdo_lv -L 6G -V 12G test_vg/vdo_pool_lv")
machine.succeed("mkfs.xfs ${mkXfsFlags} -K /dev/test_vg/vdo_lv")
machine.succeed("mkdir /mnt; mount /dev/test_vg/vdo_lv /mnt")
assert "/dev/mapper/test_vg-vdo_lv" == machine.succeed("findmnt -no SOURCE /mnt").strip()
machine.succeed("umount /mnt")
machine.succeed("vdostats")
machine.succeed("vgchange -a n")
'';
})