diff options
author | sohalt <sohalt@sohalt.net> | 2023-12-06 21:34:38 +0100 |
---|---|---|
committer | sohalt <sohalt@sohalt.net> | 2023-12-06 21:57:21 +0100 |
commit | 3c6b3d71fa696da5c170c0ff44eaa8c51999a80c (patch) | |
tree | 2ed4f7308f952f9f0c99d30f6340da2b9459a5a9 /nixos/tests/caddy.nix | |
parent | ea5566eb3b278d405c7f2ecddae033ed2280ec8f (diff) |
nixos/caddy: Use caddyfile adapter by default when explicitly specifying configFile
Diffstat (limited to 'nixos/tests/caddy.nix')
-rw-r--r-- | nixos/tests/caddy.nix | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/nixos/tests/caddy.nix b/nixos/tests/caddy.nix index 5a0d3539394b6..41d8e57de4686 100644 --- a/nixos/tests/caddy.nix +++ b/nixos/tests/caddy.nix @@ -48,11 +48,19 @@ import ./make-test-python.nix ({ pkgs, ... }: { }; }; }; + specialisation.explicit-config-file.configuration = { + services.caddy.configFile = pkgs.writeText "Caddyfile" '' + localhost:80 + + respond "hello world" + ''; + }; }; }; testScript = { nodes, ... }: let + explicitConfigFile = "${nodes.webserver.system.build.toplevel}/specialisation/explicit-config-file"; justReloadSystem = "${nodes.webserver.system.build.toplevel}/specialisation/config-reload"; multipleConfigs = "${nodes.webserver.system.build.toplevel}/specialisation/multiple-configs"; rfc42Config = "${nodes.webserver.system.build.toplevel}/specialisation/rfc42"; @@ -84,5 +92,12 @@ import ./make-test-python.nix ({ pkgs, ... }: { ) webserver.wait_for_open_port(80) webserver.succeed("curl http://localhost | grep hello") + + with subtest("explicit configFile"): + webserver.succeed( + "${explicitConfigFile}/bin/switch-to-configuration test >&2" + ) + webserver.wait_for_open_port(80) + webserver.succeed("curl http://localhost | grep hello") ''; }) |