diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 9bce49c9e302..10a381c2c8f4 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -161,6 +161,7 @@ in nat.standalone = handleTest ./nat.nix { withFirewall = false; }; ndppd = handleTest ./ndppd.nix {}; neo4j = handleTest ./neo4j.nix {}; + nesting = handleTest ./nesting.nix {}; netdata = handleTest ./netdata.nix {}; networking.networkd = handleTest ./networking.nix { networkd = true; }; networking.scripted = handleTest ./networking.nix { networkd = false; }; diff --git a/nixos/tests/nesting.nix b/nixos/tests/nesting.nix new file mode 100644 index 000000000000..3be64d7a9b54 --- /dev/null +++ b/nixos/tests/nesting.nix @@ -0,0 +1,22 @@ +import ./make-test.nix { + name = "nesting"; + machine = { pkgs, ... }: { + environment.systemPackages = [ pkgs.cowsay ]; + nesting.clone = [ + ({ pkgs, ... }: { + environment.systemPackages = [ pkgs.hello ]; + }) + ]; + }; + testScript = '' + $machine->waitForUnit("default.target"); + $machine->succeed("cowsay hey"); + $machine->fail("hello"); + + # Nested clones do inherit from parent + $machine->succeed("/run/current-system/fine-tune/child-1/bin/switch-to-configuration test"); + $machine->succeed("cowsay hey"); + $machine->succeed("hello"); + + ''; +}