1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 03:30:45 +00:00

libvirtd: add zfs storage driver tests

This commit is contained in:
Tako Marks 2022-09-16 21:52:00 +02:00
parent f00d562080
commit a0f2ca21da

View file

@ -12,6 +12,8 @@ import ./make-test-python.nix ({ pkgs, ... }: {
libvirtd.enable = true;
};
boot.supportedFilesystems = [ "zfs" ];
networking.hostId = "deadbeef"; # needed for zfs
networking.nameservers = [ "192.168.122.1" ];
security.polkit.enable = true;
environment.systemPackages = with pkgs; [ virt-manager ];
@ -37,6 +39,13 @@ import ./make-test-python.nix ({ pkgs, ... }: {
virthost.succeed("virsh vol-create-as foo loop0p1 25MB")
virthost.succeed("virsh vol-create-as foo loop0p2 50MB")
with subtest("check if virsh zfs pools work"):
virthost.succeed("fallocate -l100m /tmp/zfs; losetup /dev/loop1 /tmp/zfs;")
virthost.succeed("zpool create zfs_loop /dev/loop1")
virthost.succeed("virsh pool-define-as --name zfs_storagepool --source-name zfs_loop --type zfs")
virthost.succeed("virsh pool-start zfs_storagepool")
virthost.succeed("virsh vol-create-as zfs_storagepool disk1 25MB")
with subtest("check if nixos install iso boots and network works"):
virthost.succeed(
"virt-install -n nixos --osinfo=nixos-unstable --ram=1024 --graphics=none --disk=`find ${nixosInstallISO}/iso -type f | head -n1`,readonly=on --import --noautoconsole"