1
0
mirror of https://github.com/thib8956/nginx-proxy synced 2025-02-24 01:38:15 +00:00
nginx-proxy/test/test_server-down/test_load-balancing.py
Gilles Filippini a637b399b8 test: add test_server-down/test_load-balancing
Check that when multiple containers have the same WIRTUAL_HOST and one of
them is unreachable, the resulting `upstream` block has no
`server 127.0.0.1 down;` entry.
2021-06-21 00:48:21 +02:00

9 lines
354 B
Python

import pytest
def test_web_has_no_server_down(docker_compose, nginxproxy):
conf = nginxproxy.get_conf().decode('ASCII')
r = nginxproxy.get("http://web.nginx-proxy.tld/port")
assert r.status_code == 200
assert (r.text == "answer from port 81\n") or (r.text == "answer from port 82\n")
assert conf.count("server 127.0.0.1 down;") == 0