nixos/tests/incus: fix multi-system support

Changed files
+23 -16
nixos
+2 -2
nixos/tests/all-tests.nix
···
iftop = handleTest ./iftop.nix {};
immich = handleTest ./web-apps/immich.nix {};
incron = handleTest ./incron.nix {};
-
incus = pkgs.recurseIntoAttrs (handleTest ./incus { lts = false; });
-
incus-lts = pkgs.recurseIntoAttrs (handleTest ./incus { });
+
incus = pkgs.recurseIntoAttrs (handleTest ./incus { lts = false; inherit system pkgs; });
+
incus-lts = pkgs.recurseIntoAttrs (handleTest ./incus { inherit system pkgs; });
influxdb = handleTest ./influxdb.nix {};
influxdb2 = handleTest ./influxdb2.nix {};
initrd-network-openvpn = handleTestOn [ "x86_64-linux" "i686-linux" ] ./initrd-network-openvpn {};
+15 -8
nixos/tests/incus/default.nix
···
{
+
system ? builtins.currentSystem,
+
config ? { },
+
pkgs ? import ../../.. { inherit system config; },
lts ? true,
...
}:
···
in
{
all = incusTest {
-
inherit lts;
+
inherit lts pkgs system;
allTests = true;
};
container = incusTest {
-
inherit lts;
+
inherit lts pkgs system;
instanceContainer = true;
};
lvm = incusTest {
-
inherit lts;
+
inherit lts pkgs system;
storageLvm = true;
};
-
lxd-to-incus = import ./lxd-to-incus.nix { };
+
lxd-to-incus = import ./lxd-to-incus.nix {
+
inherit lts pkgs system;
+
};
openvswitch = incusTest {
-
inherit lts;
+
inherit lts pkgs system;
networkOvs = true;
};
-
ui = import ./ui.nix { };
+
ui = import ./ui.nix {
+
inherit lts pkgs system;
+
};
virtual-machine = incusTest {
-
inherit lts;
+
inherit lts pkgs system;
instanceVm = true;
};
zfs = incusTest {
-
inherit lts;
+
inherit lts pkgs system;
storageLvm = true;
};
}
+1 -1
nixos/tests/incus/incus-tests.nix
···
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 create lvm1 --empty --storage lvm_pool")
machine.succeed("incus list lvm1")
'';
}
+3 -3
nixos/tests/incus/lxd-to-incus.nix
···
{
pkgs,
lib,
-
incus ? pkgs.incus-lts,
+
lts ? true,
...
}:
···
};
nodes.machine =
-
{ lib, ... }:
+
{ ... }:
{
virtualisation = {
diskSize = 6144;
···
incus = {
enable = true;
-
package = incus;
+
package = if lts then pkgs.incus-lts else pkgs.incus;
};
};
networking.nftables.enable = true;
+2 -2
nixos/tests/incus/ui.nix
···
{
pkgs,
lib,
-
incus ? pkgs.incus-lts,
+
lts ? true,
...
}:
{
···
virtualisation = {
incus = {
enable = true;
-
package = incus;
+
package = if lts then pkgs.incus-lts else pkgs.incus;
};
incus.ui.enable = true;
};