test: separate containers (contd)

This commit is contained in:
Nicolas Duchon 2024-12-22 11:13:49 +01:00
parent 209192e778
commit 9fd66de39d
3 changed files with 17 additions and 4 deletions

View file

@ -1,3 +1,7 @@
import os
import pytest
def test_arbitrary_headers_are_passed_on(docker_compose, nginxproxy):
r = nginxproxy.get("http://web.nginx-proxy.tld/headers", headers={'Foo': 'Bar'})
assert r.status_code == 200
@ -91,6 +95,10 @@ def test_httpoxy_safe(docker_compose, nginxproxy):
assert "Proxy:" not in r.text
@pytest.mark.xfail(
condition = os.environ.get("COMPOSE_PROFILES") == "separateContainers",
reason = "This test is expected to fail when using separate containers",
)
def test_no_host_server_tokens_off(docker_compose, nginxproxy):
ip = nginxproxy.get_ip()
r = nginxproxy.get(f"http://{ip}/headers")

View file

@ -1,3 +1,4 @@
import os
import pytest
@ -94,6 +95,10 @@ def test_httpoxy_safe(docker_compose, nginxproxy):
assert "Proxy:" not in r.text
@pytest.mark.xfail(
condition = os.environ.get("COMPOSE_PROFILES") == "separateContainers",
reason = "This test is expected to fail when using separate containers",
)
@pytest.mark.filterwarnings('ignore::urllib3.exceptions.InsecureRequestWarning')
def test_no_host_server_tokens_off(docker_compose, nginxproxy):
ip = nginxproxy.get_ip()

View file

@ -17,10 +17,10 @@ services:
volumes:
- &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro
networks: &nginxProxyNetworks
- net1
- net2
- net3a
- net3b
net1:
net2:
net3a:
net3b:
nginx-proxy-dockergen:
profiles: