about summary refs log tree commit diff
path: root/nixos/tests/step-ca.nix
diff options
context:
space:
mode:
authorJonathan Davies <jpds@protonmail.com>2024-05-18 10:35:20 +0100
committerJonathan Davies <jpds@protonmail.com>2024-05-18 10:43:23 +0100
commitd01d4303423e49de20008cba95b4a517d17e830a (patch)
treead58242852086e4b04121cb4a5c364da80756c8a /nixos/tests/step-ca.nix
parent9dd634b59ac5c170789c15c20b3b436ad36759e1 (diff)
nixos/step-ca: Added Caddy example to integration tests.
Diffstat (limited to 'nixos/tests/step-ca.nix')
-rw-r--r--nixos/tests/step-ca.nix21
1 files changed, 21 insertions, 0 deletions
diff --git a/nixos/tests/step-ca.nix b/nixos/tests/step-ca.nix
index a855b590232dd..31ec0078e0f63 100644
--- a/nixos/tests/step-ca.nix
+++ b/nixos/tests/step-ca.nix
@@ -62,6 +62,24 @@ import ./make-test-python.nix ({ pkgs, ... }:
             };
           };
 
+        caclientcaddy =
+          { config, pkgs, ... }: {
+            security.pki.certificateFiles = [ "${test-certificates}/root_ca.crt" ];
+
+            networking.firewall.allowedTCPPorts = [ 80 443 ];
+
+            services.caddy = {
+              enable = true;
+              virtualHosts."caclientcaddy".extraConfig = ''
+                respond "Welcome to Caddy!"
+
+                tls caddy@example.org {
+                  ca https://caserver:8443/acme/acme/directory
+                }
+              '';
+            };
+          };
+
         catester = { config, pkgs, ... }: {
           security.pki.certificateFiles = [ "${test-certificates}/root_ca.crt" ];
         };
@@ -73,5 +91,8 @@ import ./make-test-python.nix ({ pkgs, ... }:
         caserver.wait_for_unit("step-ca.service")
         caclient.wait_for_unit("acme-finished-caclient.target")
         catester.succeed("curl https://caclient/ | grep \"Welcome to nginx!\"")
+
+        caclientcaddy.wait_for_unit("caddy.service")
+        catester.succeed("curl https://caclientcaddy/ | grep \"Welcome to Caddy!\"")
       '';
   })