Skip to content

Commit

Permalink
Merge pull request #2356 from nginx-proxy/revert-2355
Browse files Browse the repository at this point in the history
test: revert "Fix test" and "Sleep longer"
  • Loading branch information
buchdag committed Dec 24, 2023
2 parents db27a07 + a4ced5b commit 18e7885
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

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)
def certs():
"""
Expand Down Expand Up @@ -43,24 +45,28 @@ def test_https_web_is_200(docker_compose, nginxproxy):
assert "answer from port 81\n" in r.text


@pytest.mark.incremental
def test_delete_cert_and_restart_reverseproxy(docker_compose):
os.remove(join(script_dir, "tmp_certs", "web.nginx-proxy.crt"))
docker_compose.containers.get("reverseproxy").restart()
sleep(5) # give time for the container to initialize
sleep(3) # give time for the container to initialize
assert "running" == docker_compose.containers.get("reverseproxy").status


def test_unknown_virtual_host_is_still_503(docker_compose, nginxproxy):
@pytest.mark.incremental
def test_unknown_virtual_host_is_still_503(nginxproxy):
r = nginxproxy.get("http://foo.nginx-proxy/")
assert r.status_code == 503


def test_http_web_is_now_200(docker_compose, nginxproxy):
@pytest.mark.incremental
def test_http_web_is_now_200(nginxproxy):
r = nginxproxy.get("http://web.nginx-proxy/port", allow_redirects=False)
assert r.status_code == 200
assert "answer from port 81\n" == r.text


@pytest.mark.incremental
def test_https_web_is_now_broken_since_there_is_no_cert(nginxproxy):
with pytest.raises(ConnectionError):
nginxproxy.get("https://web.nginx-proxy/port")

0 comments on commit 18e7885

Please sign in to comment.