diff options
author | sohalt <sohalt@sohalt.net> | 2023-08-22 20:14:35 +0200 |
---|---|---|
committer | sohalt <sohalt@sohalt.net> | 2023-08-22 20:14:35 +0200 |
commit | c01874615be331a9f2832488ac56515bf1804197 (patch) | |
tree | 8dd5c6cd8506635ed4406cd23f15cd5bd83d1b7f /nixos/tests/caddy.nix | |
parent | 4b7ad2c7eab37e3ade26e560a5c01a4b5a4321c3 (diff) |
nixos/caddy: Add rfc42 settings option
Diffstat (limited to 'nixos/tests/caddy.nix')
-rw-r--r-- | nixos/tests/caddy.nix | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/nixos/tests/caddy.nix b/nixos/tests/caddy.nix index ed88f08739e85..7802039d2a219 100644 --- a/nixos/tests/caddy.nix +++ b/nixos/tests/caddy.nix @@ -50,6 +50,20 @@ import ./make-test-python.nix ({ pkgs, ... }: { "http://localhost:8081" = { }; }; }; + specialisation.rfc42.configuration = { + services.caddy.settings = { + apps.http.servers.default = { + listen = [ ":80" ]; + routes = [{ + handle = [{ + body = "hello world"; + handler = "static_response"; + status_code = 200; + }]; + }]; + }; + }; + }; }; }; @@ -58,6 +72,7 @@ import ./make-test-python.nix ({ pkgs, ... }: { 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"; + rfc42Config = "${nodes.webserver.system.build.toplevel}/specialisation/rfc42"; in '' url = "http://localhost/example.html" @@ -106,5 +121,12 @@ import ./make-test-python.nix ({ pkgs, ... }: { ) webserver.wait_for_open_port(8080) webserver.wait_for_open_port(8081) + + with subtest("rfc42 settings config"): + webserver.succeed( + "${rfc42Config}/bin/switch-to-configuration test >&2" + ) + webserver.wait_for_open_port(80) + webserver.succeed("curl http://localhost | grep hello") ''; }) |