summary refs log tree commit diff
path: root/nixos/tests/caddy.nix
diff options
context:
space:
mode:
authorsohalt <sohalt@sohalt.net>2023-08-22 20:14:35 +0200
committersohalt <sohalt@sohalt.net>2023-08-22 20:14:35 +0200
commitc01874615be331a9f2832488ac56515bf1804197 (patch)
tree8dd5c6cd8506635ed4406cd23f15cd5bd83d1b7f /nixos/tests/caddy.nix
parent4b7ad2c7eab37e3ade26e560a5c01a4b5a4321c3 (diff)
downloadnixpkgs-c01874615be331a9f2832488ac56515bf1804197.tar
nixpkgs-c01874615be331a9f2832488ac56515bf1804197.tar.gz
nixpkgs-c01874615be331a9f2832488ac56515bf1804197.tar.bz2
nixpkgs-c01874615be331a9f2832488ac56515bf1804197.tar.lz
nixpkgs-c01874615be331a9f2832488ac56515bf1804197.tar.xz
nixpkgs-c01874615be331a9f2832488ac56515bf1804197.tar.zst
nixpkgs-c01874615be331a9f2832488ac56515bf1804197.zip
nixos/caddy: Add rfc42 settings option
Diffstat (limited to 'nixos/tests/caddy.nix')
-rw-r--r--nixos/tests/caddy.nix22
1 files changed, 22 insertions, 0 deletions
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")
     '';
 })