diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 382d84fd6df1..a1b472b1d075 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -743,11 +743,11 @@ in immich-vectorchord-reindex = runTest ./web-apps/immich-vectorchord-reindex.nix; incron = runTest ./incron.nix; incus = import ./incus { - inherit runTest; + inherit runTestOn; package = pkgs.incus; }; incus-lts = import ./incus { - inherit runTest; + inherit runTestOn; package = pkgs.incus-lts; }; influxdb = runTest ./influxdb.nix; diff --git a/nixos/tests/incus/default.nix b/nixos/tests/incus/default.nix index db8bf44ccf4a..a09e4e8c3ace 100644 --- a/nixos/tests/incus/default.nix +++ b/nixos/tests/incus/default.nix @@ -1,11 +1,11 @@ { package, - runTest, + runTestOn, }: let incusRunTest = config: - runTest { + runTestOn [ "x86_64-linux" "aarch64-linux" ] { imports = [ ./incus-tests-module.nix ./incus-tests.nix @@ -18,6 +18,8 @@ let }; in { + # this is the main test which will test as much as possible + # run this for testing incus upgrades, also available in incus package tests all = incusRunTest { name = "all"; appArmor = true; @@ -43,6 +45,7 @@ in }; }; + # used in lxc tests to verify container functionality container = incusRunTest { name = "container"; @@ -63,7 +66,7 @@ in network.ovs = true; }; - ui = runTest { + ui = runTestOn [ "x86_64-linux" "aarch64-linux" ] { imports = [ ./ui.nix ]; _module.args = { inherit package; }; diff --git a/nixos/tests/incus/incus-tests.nix b/nixos/tests/incus/incus-tests.nix index ec5a6061b0d2..10470b36a795 100644 --- a/nixos/tests/incus/incus-tests.nix +++ b/nixos/tests/incus/incus-tests.nix @@ -5,14 +5,29 @@ ... }: -# TODO aarch64 vm filter let cfg = config.tests.incus; - instanceScript = lib.foldlAttrs ( - acc: name: instance: - acc + instance.testScript - ) "" cfg.instances; + # limit building of VMs to these systems as nested virtualization is + # required to test VMs, but support for this is poor outside x86 + # will print warnings on those systems rather than failing outright + vmsEnabled = lib.elem pkgs.stdenv.system [ "x86_64-linux" ]; + + instanceScript = lib.pipe cfg.instances [ + (lib.filterAttrs ( + name: instance: + let + keep = instance.type != "virtual-machine" || vmsEnabled; + in + lib.warnIf (!keep) '' + Skipping virtual-machine ${name} as VMs are disabled on ${pkgs.stdenv.system} + '' keep + )) + (lib.foldlAttrs ( + acc: name: instance: + acc + instance.testScript + ) "") + ]; in { name = "${cfg.package.name}-${cfg.name}"; @@ -21,9 +36,6 @@ in maintainers = lib.teams.lxc.members; }; - # sshBackdoor.enable = true; - # enableDebugHook = true; - nodes.server = { virtualisation = { cores = 2;