From 0f97141ce595c3e7f1e044a98be5c4ea10be8556 Mon Sep 17 00:00:00 2001 From: Mohammed Al Sahaf Date: Tue, 24 Oct 2023 10:48:27 +0300 Subject: [PATCH] test: acmeserver: add smoke test for the ACME server directory --- caddytest/integration/acmeserver_test.go | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 caddytest/integration/acmeserver_test.go diff --git a/caddytest/integration/acmeserver_test.go b/caddytest/integration/acmeserver_test.go new file mode 100644 index 000000000000..f9a5051b535c --- /dev/null +++ b/caddytest/integration/acmeserver_test.go @@ -0,0 +1,32 @@ +package integration + +import ( + "testing" + + "github.com/caddyserver/caddy/v2/caddytest" +) + +func TestACMEServerDirectory(t *testing.T) { + tester := caddytest.NewTester(t) + tester.InitServer(` + { + skip_install_trust + admin localhost:2999 + http_port 9080 + https_port 9443 + pki { + ca local { + name "Caddy Local Authority" + } + } + } + acme.localhost:9443 { + acme_server + } + `, "caddyfile") + tester.AssertGetResponse( + "https://acme.localhost:9443/acme/local/directory", + 200, + `{"newNonce":"https://acme.localhost:9443/acme/local/new-nonce","newAccount":"https://acme.localhost:9443/acme/local/new-account","newOrder":"https://acme.localhost:9443/acme/local/new-order","revokeCert":"https://acme.localhost:9443/acme/local/revoke-cert","keyChange":"https://acme.localhost:9443/acme/local/key-change"} +`) +}