Skip to content

Commit

Permalink
incus: refactor tests and fix VM CSM support (NixOS#365778)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcstephens authored Dec 20, 2024
2 parents 400e005 + 6cd3dd3 commit d441bda
Show file tree
Hide file tree
Showing 14 changed files with 497 additions and 623 deletions.
4 changes: 4 additions & 0 deletions nixos/modules/virtualisation/incus.nix
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ let
name = "OVMF_VARS.4MB.ms.fd";
path = "${pkgs.OVMFFull.fd}/FV/${ovmf-prefix}_VARS.fd";
}
{
name = "seabios.bin";
path = "${pkgs.seabios-qemu}/share/seabios/bios.bin";
}
];

environment = lib.mkMerge [
Expand Down
4 changes: 2 additions & 2 deletions nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,8 @@ in {
iftop = handleTest ./iftop.nix {};
immich = handleTest ./web-apps/immich.nix {};
incron = handleTest ./incron.nix {};
incus = pkgs.recurseIntoAttrs (handleTest ./incus { inherit handleTestOn; inherit (pkgs) incus; });
incus-lts = pkgs.recurseIntoAttrs (handleTest ./incus { inherit handleTestOn; });
incus = pkgs.recurseIntoAttrs (handleTest ./incus { lts = false; });
incus-lts = pkgs.recurseIntoAttrs (handleTest ./incus { });
influxdb = handleTest ./influxdb.nix {};
influxdb2 = handleTest ./influxdb2.nix {};
initrd-network-openvpn = handleTestOn [ "x86_64-linux" "i686-linux" ] ./initrd-network-openvpn {};
Expand Down
154 changes: 0 additions & 154 deletions nixos/tests/incus/container.nix

This file was deleted.

57 changes: 35 additions & 22 deletions nixos/tests/incus/default.nix
Original file line number Diff line number Diff line change
@@ -1,29 +1,42 @@
{
system ? builtins.currentSystem,
config ? { },
pkgs ? import ../../.. { inherit system config; },
handleTestOn,
incus ? pkgs.incus-lts,
lts ? true,
...
}:
let
incusTest = import ./incus-tests.nix;
in
{
container-legacy-init = import ./container.nix {
name = "container-legacy-init";
inherit incus system pkgs;
all = incusTest {
inherit lts;
allTests = true;
};
container-systemd-init = import ./container.nix {
name = "container-systemd-init";
inherit incus system pkgs;
extra = {
boot.initrd.systemd.enable = true;
};

container = incusTest {
inherit lts;
instanceContainer = true;
};
incusd-options = import ./incusd-options.nix { inherit incus system pkgs; };
lxd-to-incus = import ./lxd-to-incus.nix { inherit incus system pkgs; };
openvswitch = import ./openvswitch.nix { inherit incus system pkgs; };
socket-activated = import ./socket-activated.nix { inherit incus system pkgs; };
storage = import ./storage.nix { inherit incus system pkgs; };
ui = import ./ui.nix { inherit incus system pkgs; };
virtual-machine = handleTestOn [ "x86_64-linux" ] ./virtual-machine.nix {
inherit incus system pkgs;

lvm = incusTest {
inherit lts;
storageLvm = true;
};

lxd-to-incus = import ./lxd-to-incus.nix { };

openvswitch = incusTest {
inherit lts;
networkOvs = true;
};

ui = import ./ui.nix { };

virtual-machine = incusTest {
inherit lts;
instanceVm = true;
};

zfs = incusTest {
inherit lts;
storageLvm = true;
};
}
Loading

0 comments on commit d441bda

Please sign in to comment.