nixos/tests/incus: enable testing both LTS and non-LTS

This commit is contained in:
Adam Stephens 2024-05-09 10:03:07 -04:00
parent 7d5b333dcd
commit e58c57a868
No known key found for this signature in database
11 changed files with 69 additions and 27 deletions

View File

@ -424,7 +424,8 @@ in {
icingaweb2 = handleTest ./icingaweb2.nix {};
iftop = handleTest ./iftop.nix {};
incron = handleTest ./incron.nix {};
incus = pkgs.recurseIntoAttrs (handleTest ./incus { inherit handleTestOn; });
incus = pkgs.recurseIntoAttrs (handleTest ./incus { inherit handleTestOn; inherit (pkgs) incus; });
incus-lts = pkgs.recurseIntoAttrs (handleTest ./incus { inherit handleTestOn; });
influxdb = handleTest ./influxdb.nix {};
influxdb2 = handleTest ./influxdb2.nix {};
initrd-network-openvpn = handleTestOn [ "x86_64-linux" "i686-linux" ] ./initrd-network-openvpn {};

View File

@ -1,4 +1,4 @@
import ../make-test-python.nix ({ pkgs, lib, extra ? {}, name ? "incus-container", ... } :
import ../make-test-python.nix ({ pkgs, lib, extra ? {}, name ? "incus-container", incus ? pkgs.incus-lts, ... } :
let
releases = import ../../release.nix {
@ -28,7 +28,10 @@ in
memorySize = 1024;
diskSize = 4096;
incus.enable = true;
incus = {
enable = true;
package = incus;
};
};
networking.nftables.enable = true;
};

View File

@ -3,24 +3,27 @@
config ? { },
pkgs ? import ../../.. { inherit system config; },
handleTestOn,
incus ? pkgs.incus-lts,
}:
{
container-legacy-init = import ./container.nix {
name = "container-legacy-init";
inherit system pkgs;
inherit incus system pkgs;
};
container-systemd-init = import ./container.nix {
name = "container-systemd-init";
inherit system pkgs;
inherit incus system pkgs;
extra = {
boot.initrd.systemd.enable = true;
};
};
incusd-options = import ./incusd-options.nix { inherit system pkgs; };
lxd-to-incus = import ./lxd-to-incus.nix { inherit system pkgs; };
openvswitch = import ./openvswitch.nix { inherit system pkgs; };
socket-activated = import ./socket-activated.nix { inherit system pkgs; };
storage = import ./storage.nix { inherit system pkgs; };
ui = import ./ui.nix { inherit system pkgs; };
virtual-machine = handleTestOn [ "x86_64-linux" ] ./virtual-machine.nix { inherit system pkgs; };
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;
};
}

View File

@ -1,7 +1,12 @@
# this is a set of tests for non-default options. typically the default options
# will be handled by the other tests
import ../make-test-python.nix (
{ pkgs, lib, ... }:
{
pkgs,
lib,
incus ? pkgs.incus-lts,
...
}:
let
releases = import ../../release.nix {
@ -29,6 +34,7 @@ import ../make-test-python.nix (
incus = {
enable = true;
package = incus;
softDaemonRestart = false;
preseed = {

View File

@ -1,6 +1,11 @@
import ../make-test-python.nix (
{ pkgs, lib, ... }:
{
pkgs,
lib,
incus ? pkgs.incus-lts,
...
}:
let
releases = import ../../release.nix { configuration.documentation.enable = lib.mkForce false; };
@ -65,7 +70,10 @@ import ../make-test-python.nix (
];
};
incus.enable = true;
incus = {
enable = true;
package = incus;
};
};
networking.nftables.enable = true;
};

View File

@ -1,4 +1,4 @@
import ../make-test-python.nix ({ pkgs, lib, ... } :
import ../make-test-python.nix ({ pkgs, lib, incus ? pkgs.incus-lts, ... } :
{
name = "incus-openvswitch";
@ -9,7 +9,11 @@ import ../make-test-python.nix ({ pkgs, lib, ... } :
nodes.machine = { lib, ... }: {
virtualisation = {
incus.enable = true;
incus = {
enable = true;
package = incus;
};
vswitch.enable = true;
incus.preseed = {
networks = [

View File

@ -1,4 +1,4 @@
import ../make-test-python.nix ({ pkgs, lib, ... } :
import ../make-test-python.nix ({ pkgs, lib, incus ? pkgs.incus-lts, ... } :
{
name = "incus-socket-activated";
@ -9,8 +9,11 @@ import ../make-test-python.nix ({ pkgs, lib, ... } :
nodes.machine = { lib, ... }: {
virtualisation = {
incus.enable = true;
incus.socketActivation = true;
incus = {
enable = true;
package = incus;
socketActivation = true;
};
};
networking.nftables.enable = true;
};

View File

@ -1,5 +1,10 @@
import ../make-test-python.nix (
{ pkgs, lib, ... }:
{
pkgs,
lib,
incus ? pkgs.incus-lts,
...
}:
{
name = "incus-storage";
@ -19,7 +24,10 @@ import ../make-test-python.nix (
virtualisation = {
emptyDiskImages = [ 2048 ];
incus.enable = true;
incus = {
enable = true;
package = incus;
};
};
};

View File

@ -1,4 +1,4 @@
import ../make-test-python.nix ({ pkgs, lib, ... }: {
import ../make-test-python.nix ({ pkgs, lib, incus ? pkgs.incus-lts, ... }: {
name = "incus-ui";
meta = {
@ -7,7 +7,10 @@ import ../make-test-python.nix ({ pkgs, lib, ... }: {
nodes.machine = { lib, ... }: {
virtualisation = {
incus.enable = true;
incus = {
enable = true;
package = incus;
};
incus.ui.enable = true;
};
networking.nftables.enable = true;

View File

@ -1,4 +1,4 @@
import ../make-test-python.nix ({ pkgs, lib, ... }:
import ../make-test-python.nix ({ pkgs, lib, incus ? pkgs.incus-lts, ... }:
let
releases = import ../../release.nix {
@ -33,7 +33,10 @@ in
# Provide a TPM to test vTPM support for guests
tpm.enable = true;
incus.enable = true;
incus = {
enable = true;
package = incus;
};
};
networking.nftables.enable = true;
};

View File

@ -115,7 +115,7 @@ buildGoModule rec {
;
};
tests = nixosTests.incus;
tests = if lts then nixosTests.incus-lts else nixosTests.incus;
ui = callPackage ./ui.nix { };