From 3785649eb60f2f6fc6f793ae66edc15737b2a539 Mon Sep 17 00:00:00 2001 From: Gilles Filippini Date: Fri, 28 May 2021 00:03:43 +0200 Subject: [PATCH] test: VIRTUAL_PORT != single exposed port --- ...TUAL_PORT-single-different-from-single-port.py | 8 ++++++++ ...UAL_PORT-single-different-from-single-port.yml | 15 +++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 test/test_multiple-ports/test_VIRTUAL_PORT-single-different-from-single-port.py create mode 100644 test/test_multiple-ports/test_VIRTUAL_PORT-single-different-from-single-port.yml diff --git a/test/test_multiple-ports/test_VIRTUAL_PORT-single-different-from-single-port.py b/test/test_multiple-ports/test_VIRTUAL_PORT-single-different-from-single-port.py new file mode 100644 index 0000000..4008166 --- /dev/null +++ b/test/test_multiple-ports/test_VIRTUAL_PORT-single-different-from-single-port.py @@ -0,0 +1,8 @@ +import pytest +import re + + +def test_answer_is_served_from_virtual_port_which_is_ureachable(docker_compose, nginxproxy): + r = nginxproxy.get("http://web.nginx-proxy.tld/port") + assert r.status_code == 502 + assert re.search(r"\n\s+server \d+\.\d+\.\d+\.\d+:90;\n", nginxproxy.get_conf().decode('ASCII')) diff --git a/test/test_multiple-ports/test_VIRTUAL_PORT-single-different-from-single-port.yml b/test/test_multiple-ports/test_VIRTUAL_PORT-single-different-from-single-port.yml new file mode 100644 index 0000000..e28a481 --- /dev/null +++ b/test/test_multiple-ports/test_VIRTUAL_PORT-single-different-from-single-port.yml @@ -0,0 +1,15 @@ +web: + image: web + expose: + - "81" + environment: + WEB_PORTS: "81" + VIRTUAL_HOST: "web.nginx-proxy.tld" + VIRTUAL_PORT: "90" + + +sut: + image: nginxproxy/nginx-proxy:test + volumes: + - /var/run/docker.sock:/tmp/docker.sock:ro + - ../lib/ssl/dhparam.pem:/etc/nginx/dhparam/dhparam.pem:ro