mirror of
https://github.com/thib8956/nginx-proxy
synced 2025-02-24 09:48:14 +00:00
Merge pull request #2355 from SchoNie/fix-test_restart_while_missing_cert.py-xfails-xpass
Fix xpass and xfails test_restart_while_missing_cert.py
This commit is contained in:
commit
db27a07741
@ -9,8 +9,6 @@ from requests import ConnectionError
|
|||||||
|
|
||||||
script_dir = os.path.dirname(__file__)
|
script_dir = os.path.dirname(__file__)
|
||||||
|
|
||||||
pytestmark = pytest.mark.xfail() # TODO delete this marker once those issues are fixed
|
|
||||||
|
|
||||||
@pytest.fixture(scope="module", autouse=True)
|
@pytest.fixture(scope="module", autouse=True)
|
||||||
def certs():
|
def certs():
|
||||||
"""
|
"""
|
||||||
@ -45,28 +43,24 @@ def test_https_web_is_200(docker_compose, nginxproxy):
|
|||||||
assert "answer from port 81\n" in r.text
|
assert "answer from port 81\n" in r.text
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.incremental
|
|
||||||
def test_delete_cert_and_restart_reverseproxy(docker_compose):
|
def test_delete_cert_and_restart_reverseproxy(docker_compose):
|
||||||
os.remove(join(script_dir, "tmp_certs", "web.nginx-proxy.crt"))
|
os.remove(join(script_dir, "tmp_certs", "web.nginx-proxy.crt"))
|
||||||
docker_compose.containers.get("reverseproxy").restart()
|
docker_compose.containers.get("reverseproxy").restart()
|
||||||
sleep(3) # give time for the container to initialize
|
sleep(5) # give time for the container to initialize
|
||||||
assert "running" == docker_compose.containers.get("reverseproxy").status
|
assert "running" == docker_compose.containers.get("reverseproxy").status
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.incremental
|
def test_unknown_virtual_host_is_still_503(docker_compose, nginxproxy):
|
||||||
def test_unknown_virtual_host_is_still_503(nginxproxy):
|
|
||||||
r = nginxproxy.get("http://foo.nginx-proxy/")
|
r = nginxproxy.get("http://foo.nginx-proxy/")
|
||||||
assert r.status_code == 503
|
assert r.status_code == 503
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.incremental
|
def test_http_web_is_now_200(docker_compose, nginxproxy):
|
||||||
def test_http_web_is_now_200(nginxproxy):
|
|
||||||
r = nginxproxy.get("http://web.nginx-proxy/port", allow_redirects=False)
|
r = nginxproxy.get("http://web.nginx-proxy/port", allow_redirects=False)
|
||||||
assert r.status_code == 200
|
assert r.status_code == 200
|
||||||
assert "answer from port 81\n" == r.text
|
assert "answer from port 81\n" == r.text
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.incremental
|
|
||||||
def test_https_web_is_now_broken_since_there_is_no_cert(nginxproxy):
|
def test_https_web_is_now_broken_since_there_is_no_cert(nginxproxy):
|
||||||
with pytest.raises(ConnectionError):
|
with pytest.raises(ConnectionError):
|
||||||
nginxproxy.get("https://web.nginx-proxy/port")
|
nginxproxy.get("https://web.nginx-proxy/port")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user