mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
Merge pull request #312623 from jpds/nixos-test-step-caddy
nixos/step-ca: Added Caddy example to integration tests
This commit is contained in:
commit
006641f290
@ -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, ... }: {
|
catester = { config, pkgs, ... }: {
|
||||||
security.pki.certificateFiles = [ "${test-certificates}/root_ca.crt" ];
|
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")
|
caserver.wait_for_unit("step-ca.service")
|
||||||
caclient.wait_for_unit("acme-finished-caclient.target")
|
caclient.wait_for_unit("acme-finished-caclient.target")
|
||||||
catester.succeed("curl https://caclient/ | grep \"Welcome to nginx!\"")
|
catester.succeed("curl https://caclient/ | grep \"Welcome to nginx!\"")
|
||||||
|
|
||||||
|
caclientcaddy.wait_for_unit("caddy.service")
|
||||||
|
catester.succeed("curl https://caclientcaddy/ | grep \"Welcome to Caddy!\"")
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user