incus: add lvm to storage test

This commit is contained in:
Adam C. Stephens 2024-11-23 13:15:12 -05:00
parent 964bdaac30
commit 496390848d
No known key found for this signature in database

View File

@ -13,17 +13,25 @@ import ../make-test-python.nix (
maintainers = lib.teams.lxc.members;
};
nodes.machine =
{ lib, ... }:
{
nodes.machine = {
boot.supportedFilesystems = [ "zfs" ];
boot.zfs.forceImportRoot = false;
environment.systemPackages = [ pkgs.parted ];
networking.hostId = "01234567";
networking.nftables.enable = true;
services.lvm = {
boot.thin.enable = true;
dmeventd.enable = true;
};
virtualisation = {
emptyDiskImages = [ 2048 ];
emptyDiskImages = [
2048
2048
];
incus = {
enable = true;
package = incus;
@ -31,7 +39,8 @@ import ../make-test-python.nix (
};
};
testScript = ''
testScript = # python
''
machine.wait_for_unit("incus.service")
with subtest("Verify zfs pool created and usable"):
@ -43,12 +52,33 @@ import ../make-test-python.nix (
machine.succeed("incus storage create zfs_pool zfs source=zfs_pool/incus")
machine.succeed("zfs list zfs_pool/incus")
machine.succeed("incus storage volume create zfs_pool test_fs --type filesystem")
machine.succeed("incus storage volume create zfs_pool test_vol --type block")
machine.succeed("incus storage show zfs_pool")
machine.succeed("incus storage volume list zfs_pool")
machine.succeed("incus storage volume show zfs_pool test_fs")
machine.succeed("incus storage volume show zfs_pool test_vol")
machine.succeed("incus create zfs1 --empty --storage zfs_pool")
machine.succeed("incus list zfs1")
with subtest("Verify lvm pool created and usable"):
machine.succeed("incus storage create lvm_pool lvm source=/dev/vdc lvm.vg_name=incus_pool")
machine.succeed("vgs incus_pool")
machine.succeed("incus storage volume create lvm_pool test_fs --type filesystem")
machine.succeed("incus storage volume create lvm_pool test_vol --type block")
machine.succeed("incus storage show lvm_pool")
machine.succeed("incus storage volume list lvm_pool")
machine.succeed("incus storage volume show lvm_pool test_fs")
machine.succeed("incus storage volume show lvm_pool test_vol")
machine.succeed("incus create lvm1 --empty --storage zfs_pool")
machine.succeed("incus list lvm1")
'';
}
)