mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 12:15:34 +03:00
nixos/caddy: add support for reload
This commit is contained in:
parent
d9c0d0ddfb
commit
1f0ac736b4
3 changed files with 48 additions and 8 deletions
|
@ -20,6 +20,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
|
|||
}
|
||||
}
|
||||
'';
|
||||
services.caddy.enableReload = true;
|
||||
|
||||
specialisation.etag.configuration = {
|
||||
services.caddy.extraConfig = lib.mkForce ''
|
||||
|
@ -54,9 +55,9 @@ import ./make-test-python.nix ({ pkgs, ... }: {
|
|||
|
||||
testScript = { nodes, ... }:
|
||||
let
|
||||
etagSystem = "${nodes.webserver.config.system.build.toplevel}/specialisation/etag";
|
||||
justReloadSystem = "${nodes.webserver.config.system.build.toplevel}/specialisation/config-reload";
|
||||
multipleConfigs = "${nodes.webserver.config.system.build.toplevel}/specialisation/multiple-configs";
|
||||
etagSystem = "${nodes.webserver.system.build.toplevel}/specialisation/etag";
|
||||
justReloadSystem = "${nodes.webserver.system.build.toplevel}/specialisation/config-reload";
|
||||
multipleConfigs = "${nodes.webserver.system.build.toplevel}/specialisation/multiple-configs";
|
||||
in
|
||||
''
|
||||
url = "http://localhost/example.html"
|
||||
|
@ -96,6 +97,8 @@ import ./make-test-python.nix ({ pkgs, ... }: {
|
|||
"${justReloadSystem}/bin/switch-to-configuration test >&2"
|
||||
)
|
||||
webserver.wait_for_open_port(8080)
|
||||
webserver.fail("journalctl -u caddy | grep -q -i stopped")
|
||||
webserver.succeed("journalctl -u caddy | grep -q -i reloaded")
|
||||
|
||||
with subtest("multiple configs are correctly merged"):
|
||||
webserver.succeed(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue