1
0
mirror of https://github.com/thib8956/nginx-proxy synced 2025-07-02 23:05:46 +00:00

tests: Add tests for how Let's Encrypt ACME challenge is handled

At the moment no changes to functionality are done, only the current
behavior is captured.
This commit is contained in:
Povilas Kanapickas
2024-05-04 23:52:57 +03:00
parent c4c65a4441
commit d6c38a0bab
17 changed files with 91 additions and 1 deletions

View File

@ -21,3 +21,13 @@ def test_web1_HSTS_policy_is_active(docker_compose, nginxproxy, subdomain):
r = nginxproxy.get(f"https://{subdomain}.nginx-proxy.tld/port", allow_redirects=False)
assert "answer from port 81\n" in r.text
assert "Strict-Transport-Security" in r.headers
@pytest.mark.parametrize("subdomain", ["foo", "bar"])
def test_web1_acme_challenge_works(docker_compose, nginxproxy, acme_challenge_path, subdomain):
r = nginxproxy.get(
f"http://web3.nginx-proxy.tld/{acme_challenge_path}",
allow_redirects=False
)
assert r.status_code == 200
assert "challenge-teststring\n" in r.text