Loading nixos/tests/incus/default.nix +9 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,15 @@ in }; }; channel = incusRunTest { name = "channel"; instances.c1 = { type = "container"; copyChannel = true; }; }; # used in lxc tests to verify container functionality container = incusRunTest { name = "container"; Loading nixos/tests/incus/incus-tests-module.nix +67 −59 Original line number Diff line number Diff line Loading @@ -60,6 +60,11 @@ in default = { }; }; copyChannel = lib.mkEnableOption '' copy channel in test image. disabled by default as it forces image rebuilds excessively. enable to validate channel things. ''; testScript = lib.mkOption { type = lib.types.str; description = "final script provided to test runner"; Loading Loading @@ -104,7 +109,7 @@ in documentation.enable = lib.mkForce false; documentation.nixos.enable = lib.mkForce false; # including a channel forces images to be rebuilt on any changes system.installer.channel.enable = lib.mkForce false; system.installer.channel.enable = lib.mkForce config.copyChannel; environment.etc."nix/registry.json".text = lib.mkForce "{}"; Loading Loading @@ -170,8 +175,7 @@ in # # container specific # + lib.optionalString (config.type == "container") + lib.optionalString (config.type == "container") ( # python '' with subtest("[${image_id}] switch-to-configuration updates /sbin/init via installBootLoader"): Loading Loading @@ -227,7 +231,11 @@ in server.wait_for_instance(instance_name) server.succeed(f"pgrep -a lxcfs | grep 'incus/devices/{instance_name}/lxcfs'") '' + lib.optionalString (config.copyChannel) '' with subtest("[${image_id}] channel copied correctly"): server.succeed(f"incus exec {instance_name} -- systemctl status nix-channel-init.service") '' ) # # virtual-machine specific # Loading Loading
nixos/tests/incus/default.nix +9 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,15 @@ in }; }; channel = incusRunTest { name = "channel"; instances.c1 = { type = "container"; copyChannel = true; }; }; # used in lxc tests to verify container functionality container = incusRunTest { name = "container"; Loading
nixos/tests/incus/incus-tests-module.nix +67 −59 Original line number Diff line number Diff line Loading @@ -60,6 +60,11 @@ in default = { }; }; copyChannel = lib.mkEnableOption '' copy channel in test image. disabled by default as it forces image rebuilds excessively. enable to validate channel things. ''; testScript = lib.mkOption { type = lib.types.str; description = "final script provided to test runner"; Loading Loading @@ -104,7 +109,7 @@ in documentation.enable = lib.mkForce false; documentation.nixos.enable = lib.mkForce false; # including a channel forces images to be rebuilt on any changes system.installer.channel.enable = lib.mkForce false; system.installer.channel.enable = lib.mkForce config.copyChannel; environment.etc."nix/registry.json".text = lib.mkForce "{}"; Loading Loading @@ -170,8 +175,7 @@ in # # container specific # + lib.optionalString (config.type == "container") + lib.optionalString (config.type == "container") ( # python '' with subtest("[${image_id}] switch-to-configuration updates /sbin/init via installBootLoader"): Loading Loading @@ -227,7 +231,11 @@ in server.wait_for_instance(instance_name) server.succeed(f"pgrep -a lxcfs | grep 'incus/devices/{instance_name}/lxcfs'") '' + lib.optionalString (config.copyChannel) '' with subtest("[${image_id}] channel copied correctly"): server.succeed(f"incus exec {instance_name} -- systemctl status nix-channel-init.service") '' ) # # virtual-machine specific # Loading