From c01874615be331a9f2832488ac56515bf1804197 Mon Sep 17 00:00:00 2001 From: sohalt Date: Tue, 22 Aug 2023 20:14:35 +0200 Subject: nixos/caddy: Add rfc42 settings option --- nixos/tests/caddy.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'nixos/tests/caddy.nix') diff --git a/nixos/tests/caddy.nix b/nixos/tests/caddy.nix index ed88f08739e..7802039d2a2 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") ''; }) -- cgit 1.4.1