Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-24.11] incus: test refactor, fix CSM #366918

Merged
merged 3 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 35 additions & 27 deletions nixos/modules/virtualisation/incus.nix
Original file line number Diff line number Diff line change
Expand Up @@ -81,34 +81,42 @@ let
fdSize2MB = true;
};
ovmf-prefix = if pkgs.stdenv.hostPlatform.isAarch64 then "AAVMF" else "OVMF";
ovmf = pkgs.linkFarm "incus-ovmf" [
# 2MB must remain the default or existing VMs will fail to boot. New VMs will prefer 4MB
{
name = "OVMF_CODE.fd";
path = "${OVMF2MB.fd}/FV/${ovmf-prefix}_CODE.fd";
}
{
name = "OVMF_VARS.fd";
path = "${OVMF2MB.fd}/FV/${ovmf-prefix}_VARS.fd";
}
{
name = "OVMF_VARS.ms.fd";
path = "${OVMF2MB.fd}/FV/${ovmf-prefix}_VARS.fd";
}
ovmf = pkgs.linkFarm "incus-ovmf" (
[
# 2MB must remain the default or existing VMs will fail to boot. New VMs will prefer 4MB
{
name = "OVMF_CODE.fd";
path = "${OVMF2MB.fd}/FV/${ovmf-prefix}_CODE.fd";
}
{
name = "OVMF_VARS.fd";
path = "${OVMF2MB.fd}/FV/${ovmf-prefix}_VARS.fd";
}
{
name = "OVMF_VARS.ms.fd";
path = "${OVMF2MB.fd}/FV/${ovmf-prefix}_VARS.fd";
}

{
name = "OVMF_CODE.4MB.fd";
path = "${pkgs.OVMFFull.fd}/FV/${ovmf-prefix}_CODE.fd";
}
{
name = "OVMF_VARS.4MB.fd";
path = "${pkgs.OVMFFull.fd}/FV/${ovmf-prefix}_VARS.fd";
}
{
name = "OVMF_VARS.4MB.ms.fd";
path = "${pkgs.OVMFFull.fd}/FV/${ovmf-prefix}_VARS.fd";
}
];
{
name = "OVMF_CODE.4MB.fd";
path = "${pkgs.OVMFFull.fd}/FV/${ovmf-prefix}_CODE.fd";
}
{
name = "OVMF_VARS.4MB.fd";
path = "${pkgs.OVMFFull.fd}/FV/${ovmf-prefix}_VARS.fd";
}
{
name = "OVMF_VARS.4MB.ms.fd";
path = "${pkgs.OVMFFull.fd}/FV/${ovmf-prefix}_VARS.fd";
}
]
++ lib.optionals pkgs.stdenv.hostPlatform.isx86_64 [
{
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 @@ -464,8 +464,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
Loading