-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: acmeserver: add smoke test for the ACME server directory (#5914)
- Loading branch information
1 parent
65c489a
commit 1a4c857
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package integration | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/caddyserver/caddy/v2/caddytest" | ||
) | ||
|
||
func TestACMEServerDirectory(t *testing.T) { | ||
tester := caddytest.NewTester(t) | ||
tester.InitServer(` | ||
{ | ||
skip_install_trust | ||
local_certs | ||
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"} | ||
`) | ||
} |