at 23.05-pre 1.4 kB view raw
1import ./make-test-python.nix { 2 name = "specialisation"; 3 nodes = { 4 inheritconf = { pkgs, ... }: { 5 environment.systemPackages = [ pkgs.cowsay ]; 6 specialisation.inheritconf.configuration = { pkgs, ... }: { 7 environment.systemPackages = [ pkgs.hello ]; 8 }; 9 }; 10 noinheritconf = { pkgs, ... }: { 11 environment.systemPackages = [ pkgs.cowsay ]; 12 specialisation.noinheritconf = { 13 inheritParentConfig = false; 14 configuration = { pkgs, ... }: { 15 environment.systemPackages = [ pkgs.hello ]; 16 }; 17 }; 18 }; 19 }; 20 testScript = '' 21 inheritconf.wait_for_unit("default.target") 22 inheritconf.succeed("cowsay hey") 23 inheritconf.fail("hello") 24 25 with subtest("Nested clones do inherit from parent"): 26 inheritconf.succeed( 27 "/run/current-system/specialisation/inheritconf/bin/switch-to-configuration test" 28 ) 29 inheritconf.succeed("cowsay hey") 30 inheritconf.succeed("hello") 31 32 noinheritconf.wait_for_unit("default.target") 33 noinheritconf.succeed("cowsay hey") 34 noinheritconf.fail("hello") 35 36 with subtest("Nested children do not inherit from parent"): 37 noinheritconf.succeed( 38 "/run/current-system/specialisation/noinheritconf/bin/switch-to-configuration test" 39 ) 40 noinheritconf.fail("cowsay hey") 41 noinheritconf.succeed("hello") 42 ''; 43}