about summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-12-07 09:07:35 +0200
committerGitHub <noreply@github.com>2023-12-07 09:07:35 +0200
commit4db2e0cc80f38b19f92fcddd846f6bf6caf7ea60 (patch)
tree060b33ea5fa08946457043f0f611adb75c3ac292 /nixos/tests
parent53755e6dbd153ffc4724addb354d59a0993eeebc (diff)
parent3c6b3d71fa696da5c170c0ff44eaa8c51999a80c (diff)
downloadnixlib-4db2e0cc80f38b19f92fcddd846f6bf6caf7ea60.tar
nixlib-4db2e0cc80f38b19f92fcddd846f6bf6caf7ea60.tar.gz
nixlib-4db2e0cc80f38b19f92fcddd846f6bf6caf7ea60.tar.bz2
nixlib-4db2e0cc80f38b19f92fcddd846f6bf6caf7ea60.tar.lz
nixlib-4db2e0cc80f38b19f92fcddd846f6bf6caf7ea60.tar.xz
nixlib-4db2e0cc80f38b19f92fcddd846f6bf6caf7ea60.tar.zst
nixlib-4db2e0cc80f38b19f92fcddd846f6bf6caf7ea60.zip
Merge pull request #272542 from Sohalt/caddy-config-file
nixos/caddy: use caddyfile adapter by default with explicit configFile
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/caddy.nix15
1 files changed, 15 insertions, 0 deletions
diff --git a/nixos/tests/caddy.nix b/nixos/tests/caddy.nix
index 5a0d3539394b..41d8e57de468 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")
     '';
 })