diff options
author | Graham Christensen <graham@grahamc.com> | 2020-03-05 17:07:20 -0500 |
---|---|---|
committer | Graham Christensen <graham@grahamc.com> | 2020-04-12 08:12:50 -0400 |
commit | ec2d28e3233c4c04fe6afe13e828691d099167ae (patch) | |
tree | 80d3efd6ffd191559bd5d222a765570cc73c604e /nixos/tests/caddy.nix | |
parent | 807ca93fadd5197c2260490de0c76e500562dc05 (diff) |
specialisation: replace nesting with named configurations
Co-authored-by: worldofpeace <worldofpeace@protonmail.ch>
Diffstat (limited to 'nixos/tests/caddy.nix')
-rw-r--r-- | nixos/tests/caddy.nix | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/nixos/tests/caddy.nix b/nixos/tests/caddy.nix index fc10df0c79b54..144d83179a16d 100644 --- a/nixos/tests/caddy.nix +++ b/nixos/tests/caddy.nix @@ -20,35 +20,33 @@ import ./make-test-python.nix ({ pkgs, ... }: { } ''; - nesting.clone = [ - { - services.caddy.config = lib.mkForce '' - http://localhost { - gzip + specialisation.etag.configuration = { + services.caddy.config = lib.mkForce '' + http://localhost { + gzip - root ${ - pkgs.runCommand "testdir2" {} '' - mkdir "$out" - echo changed > "$out/example.html" - '' - } + root ${ + pkgs.runCommand "testdir2" {} '' + mkdir "$out" + echo changed > "$out/example.html" + '' } - ''; - } + } + ''; + }; - { - services.caddy.config = '' - http://localhost:8080 { - } - ''; - } - ]; + specialisation.config-reload.configuration = { + services.caddy.config = '' + http://localhost:8080 { + } + ''; + }; }; }; testScript = { nodes, ... }: let - etagSystem = "${nodes.webserver.config.system.build.toplevel}/fine-tune/child-1"; - justReloadSystem = "${nodes.webserver.config.system.build.toplevel}/fine-tune/child-2"; + etagSystem = "${nodes.webserver.config.system.build.toplevel}/specialisation/etag"; + justReloadSystem = "${nodes.webserver.config.system.build.toplevel}/specialisation/config-reload"; in '' url = "http://localhost/example.html" webserver.wait_for_unit("caddy") @@ -77,7 +75,7 @@ import ./make-test-python.nix ({ pkgs, ... }: { assert old_etag != new_etag, "Old ETag {} is the same as {}".format( old_etag, new_etag ) - + with subtest("config is reloaded on nixos-rebuild switch"): webserver.succeed( "${justReloadSystem}/bin/switch-to-configuration test >&2" |