about summary refs log tree commit diff
path: root/nixos/tests/caddy.nix
diff options
context:
space:
mode:
authorSylvain Fankhauser <sephi@fhtagn.top>2023-02-21 17:21:38 +0100
committerSylvain Fankhauser <sephi@fhtagn.top>2023-07-04 11:25:05 +0200
commit1f0ac736b48dbeaed1b3da975d13246b4d3a886c (patch)
treef9298e9c9c766d2c3965d3f420369d3f07fc77a7 /nixos/tests/caddy.nix
parentd9c0d0ddfb3dac5bd5e1e564f48c87c86d1def97 (diff)
nixos/caddy: add support for reload
Diffstat (limited to 'nixos/tests/caddy.nix')
-rw-r--r--nixos/tests/caddy.nix9
1 files changed, 6 insertions, 3 deletions
diff --git a/nixos/tests/caddy.nix b/nixos/tests/caddy.nix
index c4abd33d0395d..ed88f08739e85 100644
--- a/nixos/tests/caddy.nix
+++ b/nixos/tests/caddy.nix
@@ -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(