diff --git a/test/stress_tests/README.md b/test/stress_tests/README.md deleted file mode 100644 index ca20cc1..0000000 --- a/test/stress_tests/README.md +++ /dev/null @@ -1 +0,0 @@ -This directory contains tests that showcase scenarios known to break the expected behavior of nginx-proxy. \ No newline at end of file diff --git a/test/test_acme_http_challenge_location/acme_root/.well-known/acme-challenge/test-filename b/test/test_acme-http-challenge-location/acme_root/.well-known/acme-challenge/test-filename similarity index 100% rename from test/test_acme_http_challenge_location/acme_root/.well-known/acme-challenge/test-filename rename to test/test_acme-http-challenge-location/acme_root/.well-known/acme-challenge/test-filename diff --git a/test/test_acme_http_challenge_location/certs/nginx-proxy.tld.crt b/test/test_acme-http-challenge-location/certs/nginx-proxy.tld.crt similarity index 100% rename from test/test_acme_http_challenge_location/certs/nginx-proxy.tld.crt rename to test/test_acme-http-challenge-location/certs/nginx-proxy.tld.crt diff --git a/test/test_acme_http_challenge_location/certs/nginx-proxy.tld.key b/test/test_acme-http-challenge-location/certs/nginx-proxy.tld.key similarity index 100% rename from test/test_acme_http_challenge_location/certs/nginx-proxy.tld.key rename to test/test_acme-http-challenge-location/certs/nginx-proxy.tld.key diff --git a/test/test_acme_http_challenge_location/test_acme_challenge_location_disabled.py b/test/test_acme-http-challenge-location/test_acme-http-challenge-location-disabled.py similarity index 100% rename from test/test_acme_http_challenge_location/test_acme_challenge_location_disabled.py rename to test/test_acme-http-challenge-location/test_acme-http-challenge-location-disabled.py diff --git a/test/test_acme_http_challenge_location/test_acme_challenge_location_disabled.yml b/test/test_acme-http-challenge-location/test_acme-http-challenge-location-disabled.yml similarity index 100% rename from test/test_acme_http_challenge_location/test_acme_challenge_location_disabled.yml rename to test/test_acme-http-challenge-location/test_acme-http-challenge-location-disabled.yml diff --git a/test/test_acme_http_challenge_location/test_acme_challenge_location_enabled_is_default.py b/test/test_acme-http-challenge-location/test_acme-http-challenge-location-enabled-is-default.py similarity index 100% rename from test/test_acme_http_challenge_location/test_acme_challenge_location_enabled_is_default.py rename to test/test_acme-http-challenge-location/test_acme-http-challenge-location-enabled-is-default.py diff --git a/test/test_acme_http_challenge_location/test_acme_challenge_location_enabled_is_default.yml b/test/test_acme-http-challenge-location/test_acme-http-challenge-location-enabled-is-default.yml similarity index 100% rename from test/test_acme_http_challenge_location/test_acme_challenge_location_enabled_is_default.yml rename to test/test_acme-http-challenge-location/test_acme-http-challenge-location-enabled-is-default.yml diff --git a/test/test_acme_http_challenge_location/test_acme_challenge_location_legacy.py b/test/test_acme-http-challenge-location/test_acme-http-challenge-location-legacy.py similarity index 100% rename from test/test_acme_http_challenge_location/test_acme_challenge_location_legacy.py rename to test/test_acme-http-challenge-location/test_acme-http-challenge-location-legacy.py diff --git a/test/test_acme_http_challenge_location/test_acme_challenge_location_legacy.yml b/test/test_acme-http-challenge-location/test_acme-http-challenge-location-legacy.yml similarity index 100% rename from test/test_acme_http_challenge_location/test_acme_challenge_location_legacy.yml rename to test/test_acme-http-challenge-location/test_acme-http-challenge-location-legacy.yml diff --git a/test/test_build.py b/test/test_build/test_build.py similarity index 90% rename from test/test_build.py rename to test/test_build/test_build.py index 28239e5..3931fcd 100644 --- a/test/test_build.py +++ b/test/test_build/test_build.py @@ -1,8 +1,8 @@ """ Test that nginx-proxy-tester can build successfully """ +import pathlib import re -import os import docker import pytest @@ -13,12 +13,13 @@ client = docker.from_env() @pytest.fixture(scope = "session") def docker_build(request): # Define Dockerfile path - dockerfile_path = os.path.join(os.path.dirname(__file__), "requirements/") + current_file_path = pathlib.Path(__file__) + dockerfile_path = current_file_path.parent.parent.joinpath("requirements") dockerfile_name = "Dockerfile-nginx-proxy-tester" # Build the Docker image image, logs = client.images.build( - path = dockerfile_path, + path = dockerfile_path.as_posix(), dockerfile = dockerfile_name, rm = True, # Remove intermediate containers tag = "nginx-proxy-tester-ci", # Tag for the built image diff --git a/test/test_debug_endpoint/test_global.py b/test/test_debug-endpoint/test_global.py similarity index 100% rename from test/test_debug_endpoint/test_global.py rename to test/test_debug-endpoint/test_global.py diff --git a/test/test_debug_endpoint/test_global.yml b/test/test_debug-endpoint/test_global.yml similarity index 100% rename from test/test_debug_endpoint/test_global.yml rename to test/test_debug-endpoint/test_global.yml diff --git a/test/test_debug_endpoint/test_per_container.py b/test/test_debug-endpoint/test_per-container.py similarity index 100% rename from test/test_debug_endpoint/test_per_container.py rename to test/test_debug-endpoint/test_per-container.py diff --git a/test/test_debug_endpoint/test_per_container.yml b/test/test_debug-endpoint/test_per-container.yml similarity index 100% rename from test/test_debug_endpoint/test_per_container.yml rename to test/test_debug-endpoint/test_per-container.yml diff --git a/test/test_default-host.py b/test/test_default-host/test_default-host.py similarity index 100% rename from test/test_default-host.py rename to test/test_default-host/test_default-host.py diff --git a/test/test_default-host.yml b/test/test_default-host/test_default-host.yml similarity index 100% rename from test/test_default-host.yml rename to test/test_default-host/test_default-host.yml diff --git a/test/test_DOCKER_HOST_unix_socket.py b/test/test_docker-unix-socket/test_docker-unix-socket.py similarity index 100% rename from test/test_DOCKER_HOST_unix_socket.py rename to test/test_docker-unix-socket/test_docker-unix-socket.py diff --git a/test/test_DOCKER_HOST_unix_socket.yml b/test/test_docker-unix-socket/test_docker-unix-socket.yml similarity index 100% rename from test/test_DOCKER_HOST_unix_socket.yml rename to test/test_docker-unix-socket/test_docker-unix-socket.yml diff --git a/test/test_enable_http_on_missing_cert.py b/test/test_enable-http-on-missing-cert/test_enable-http-on-missing-cert.py similarity index 100% rename from test/test_enable_http_on_missing_cert.py rename to test/test_enable-http-on-missing-cert/test_enable-http-on-missing-cert.py diff --git a/test/test_enable_http_on_missing_cert.yml b/test/test_enable-http-on-missing-cert/test_enable-http-on-missing-cert.yml similarity index 100% rename from test/test_enable_http_on_missing_cert.yml rename to test/test_enable-http-on-missing-cert/test_enable-http-on-missing-cert.yml diff --git a/test/test_events.py b/test/test_events/test_events.py similarity index 94% rename from test/test_events.py rename to test/test_events/test_events.py index 9b99e93..72821d8 100644 --- a/test/test_events.py +++ b/test/test_events/test_events.py @@ -22,7 +22,7 @@ def web1(docker_compose): }, ports={"81/tcp": None} ) - docker_compose.networks.get("test_default").connect(container) + docker_compose.networks.get("test_events-net").connect(container) sleep(2) # give it some time to initialize and for docker-gen to detect it yield container try: @@ -47,7 +47,7 @@ def web2(docker_compose): }, ports={"82/tcp": None} ) - docker_compose.networks.get("test_default").connect(container) + docker_compose.networks.get("test_events-net").connect(container) sleep(2) # give it some time to initialize and for docker-gen to detect it yield container try: diff --git a/test/test_events.yml b/test/test_events/test_events.yml similarity index 72% rename from test/test_events.yml rename to test/test_events/test_events.yml index e0d0fbb..b8a6274 100644 --- a/test/test_events.yml +++ b/test/test_events/test_events.yml @@ -1,3 +1,7 @@ +networks: + default: + name: test_events-net + services: nginxproxy: image: nginxproxy/nginx-proxy:test diff --git a/test/test_fallback.data/custom-fallback.conf b/test/test_fallback/test_fallback.data/custom-fallback.conf similarity index 100% rename from test/test_fallback.data/custom-fallback.conf rename to test/test_fallback/test_fallback.data/custom-fallback.conf diff --git a/test/test_fallback.data/custom-fallback.yml b/test/test_fallback/test_fallback.data/custom-fallback.yml similarity index 100% rename from test/test_fallback.data/custom-fallback.yml rename to test/test_fallback/test_fallback.data/custom-fallback.yml diff --git a/test/test_fallback.data/nodefault.certs/http-only.nginx-proxy.test.crt b/test/test_fallback/test_fallback.data/nodefault.certs/http-only.nginx-proxy.test.crt similarity index 100% rename from test/test_fallback.data/nodefault.certs/http-only.nginx-proxy.test.crt rename to test/test_fallback/test_fallback.data/nodefault.certs/http-only.nginx-proxy.test.crt diff --git a/test/test_fallback.data/nodefault.certs/http-only.nginx-proxy.test.key b/test/test_fallback/test_fallback.data/nodefault.certs/http-only.nginx-proxy.test.key similarity index 100% rename from test/test_fallback.data/nodefault.certs/http-only.nginx-proxy.test.key rename to test/test_fallback/test_fallback.data/nodefault.certs/http-only.nginx-proxy.test.key diff --git a/test/test_fallback.data/nodefault.certs/https-and-http.nginx-proxy.test.crt b/test/test_fallback/test_fallback.data/nodefault.certs/https-and-http.nginx-proxy.test.crt similarity index 100% rename from test/test_fallback.data/nodefault.certs/https-and-http.nginx-proxy.test.crt rename to test/test_fallback/test_fallback.data/nodefault.certs/https-and-http.nginx-proxy.test.crt diff --git a/test/test_fallback.data/nodefault.certs/https-and-http.nginx-proxy.test.key b/test/test_fallback/test_fallback.data/nodefault.certs/https-and-http.nginx-proxy.test.key similarity index 100% rename from test/test_fallback.data/nodefault.certs/https-and-http.nginx-proxy.test.key rename to test/test_fallback/test_fallback.data/nodefault.certs/https-and-http.nginx-proxy.test.key diff --git a/test/test_fallback.data/nodefault.certs/https-only.nginx-proxy.test.crt b/test/test_fallback/test_fallback.data/nodefault.certs/https-only.nginx-proxy.test.crt similarity index 100% rename from test/test_fallback.data/nodefault.certs/https-only.nginx-proxy.test.crt rename to test/test_fallback/test_fallback.data/nodefault.certs/https-only.nginx-proxy.test.crt diff --git a/test/test_fallback.data/nodefault.certs/https-only.nginx-proxy.test.key b/test/test_fallback/test_fallback.data/nodefault.certs/https-only.nginx-proxy.test.key similarity index 100% rename from test/test_fallback.data/nodefault.certs/https-only.nginx-proxy.test.key rename to test/test_fallback/test_fallback.data/nodefault.certs/https-only.nginx-proxy.test.key diff --git a/test/test_fallback.data/nodefault.yml b/test/test_fallback/test_fallback.data/nodefault.yml similarity index 100% rename from test/test_fallback.data/nodefault.yml rename to test/test_fallback/test_fallback.data/nodefault.yml diff --git a/test/test_fallback.data/nohttp-on-app.yml b/test/test_fallback/test_fallback.data/nohttp-on-app.yml similarity index 100% rename from test/test_fallback.data/nohttp-on-app.yml rename to test/test_fallback/test_fallback.data/nohttp-on-app.yml diff --git a/test/test_fallback.data/nohttp-with-missing-cert.yml b/test/test_fallback/test_fallback.data/nohttp-with-missing-cert.yml similarity index 100% rename from test/test_fallback.data/nohttp-with-missing-cert.yml rename to test/test_fallback/test_fallback.data/nohttp-with-missing-cert.yml diff --git a/test/test_fallback.data/nohttp.yml b/test/test_fallback/test_fallback.data/nohttp.yml similarity index 100% rename from test/test_fallback.data/nohttp.yml rename to test/test_fallback/test_fallback.data/nohttp.yml diff --git a/test/test_fallback.data/nohttps-on-app.yml b/test/test_fallback/test_fallback.data/nohttps-on-app.yml similarity index 100% rename from test/test_fallback.data/nohttps-on-app.yml rename to test/test_fallback/test_fallback.data/nohttps-on-app.yml diff --git a/test/test_fallback.data/nohttps.yml b/test/test_fallback/test_fallback.data/nohttps.yml similarity index 100% rename from test/test_fallback.data/nohttps.yml rename to test/test_fallback/test_fallback.data/nohttps.yml diff --git a/test/test_fallback.data/untrusteddefault.yml b/test/test_fallback/test_fallback.data/untrusteddefault.yml similarity index 100% rename from test/test_fallback.data/untrusteddefault.yml rename to test/test_fallback/test_fallback.data/untrusteddefault.yml diff --git a/test/test_fallback.data/withdefault.certs/default.crt b/test/test_fallback/test_fallback.data/withdefault.certs/default.crt similarity index 100% rename from test/test_fallback.data/withdefault.certs/default.crt rename to test/test_fallback/test_fallback.data/withdefault.certs/default.crt diff --git a/test/test_fallback.data/withdefault.certs/default.key b/test/test_fallback/test_fallback.data/withdefault.certs/default.key similarity index 100% rename from test/test_fallback.data/withdefault.certs/default.key rename to test/test_fallback/test_fallback.data/withdefault.certs/default.key diff --git a/test/test_fallback.data/withdefault.certs/http-only.nginx-proxy.test.crt b/test/test_fallback/test_fallback.data/withdefault.certs/http-only.nginx-proxy.test.crt similarity index 100% rename from test/test_fallback.data/withdefault.certs/http-only.nginx-proxy.test.crt rename to test/test_fallback/test_fallback.data/withdefault.certs/http-only.nginx-proxy.test.crt diff --git a/test/test_fallback.data/withdefault.certs/http-only.nginx-proxy.test.key b/test/test_fallback/test_fallback.data/withdefault.certs/http-only.nginx-proxy.test.key similarity index 100% rename from test/test_fallback.data/withdefault.certs/http-only.nginx-proxy.test.key rename to test/test_fallback/test_fallback.data/withdefault.certs/http-only.nginx-proxy.test.key diff --git a/test/test_fallback.data/withdefault.certs/https-and-http.nginx-proxy.test.crt b/test/test_fallback/test_fallback.data/withdefault.certs/https-and-http.nginx-proxy.test.crt similarity index 100% rename from test/test_fallback.data/withdefault.certs/https-and-http.nginx-proxy.test.crt rename to test/test_fallback/test_fallback.data/withdefault.certs/https-and-http.nginx-proxy.test.crt diff --git a/test/test_fallback.data/withdefault.certs/https-and-http.nginx-proxy.test.key b/test/test_fallback/test_fallback.data/withdefault.certs/https-and-http.nginx-proxy.test.key similarity index 100% rename from test/test_fallback.data/withdefault.certs/https-and-http.nginx-proxy.test.key rename to test/test_fallback/test_fallback.data/withdefault.certs/https-and-http.nginx-proxy.test.key diff --git a/test/test_fallback.data/withdefault.certs/https-only.nginx-proxy.test.crt b/test/test_fallback/test_fallback.data/withdefault.certs/https-only.nginx-proxy.test.crt similarity index 100% rename from test/test_fallback.data/withdefault.certs/https-only.nginx-proxy.test.crt rename to test/test_fallback/test_fallback.data/withdefault.certs/https-only.nginx-proxy.test.crt diff --git a/test/test_fallback.data/withdefault.certs/https-only.nginx-proxy.test.key b/test/test_fallback/test_fallback.data/withdefault.certs/https-only.nginx-proxy.test.key similarity index 100% rename from test/test_fallback.data/withdefault.certs/https-only.nginx-proxy.test.key rename to test/test_fallback/test_fallback.data/withdefault.certs/https-only.nginx-proxy.test.key diff --git a/test/test_fallback.data/withdefault.yml b/test/test_fallback/test_fallback.data/withdefault.yml similarity index 100% rename from test/test_fallback.data/withdefault.yml rename to test/test_fallback/test_fallback.data/withdefault.yml diff --git a/test/test_fallback.py b/test/test_fallback/test_fallback.py similarity index 100% rename from test/test_fallback.py rename to test/test_fallback/test_fallback.py diff --git a/test/test_htpasswd/test_htpasswd_regex_virtual_host.py b/test/test_htpasswd/test_htpasswd-regex-virtual-host.py similarity index 100% rename from test/test_htpasswd/test_htpasswd_regex_virtual_host.py rename to test/test_htpasswd/test_htpasswd-regex-virtual-host.py diff --git a/test/test_htpasswd/test_htpasswd_regex_virtual_host.yml b/test/test_htpasswd/test_htpasswd-regex-virtual-host.yml similarity index 100% rename from test/test_htpasswd/test_htpasswd_regex_virtual_host.yml rename to test/test_htpasswd/test_htpasswd-regex-virtual-host.yml diff --git a/test/test_htpasswd/test_htpasswd_virtual_host.py b/test/test_htpasswd/test_htpasswd-virtual-host.py similarity index 100% rename from test/test_htpasswd/test_htpasswd_virtual_host.py rename to test/test_htpasswd/test_htpasswd-virtual-host.py diff --git a/test/test_htpasswd/test_htpasswd_virtual_host.yml b/test/test_htpasswd/test_htpasswd-virtual-host.yml similarity index 100% rename from test/test_htpasswd/test_htpasswd_virtual_host.yml rename to test/test_htpasswd/test_htpasswd-virtual-host.yml diff --git a/test/test_htpasswd/test_htpasswd_virtual_path.py b/test/test_htpasswd/test_htpasswd-virtual-path.py similarity index 100% rename from test/test_htpasswd/test_htpasswd_virtual_path.py rename to test/test_htpasswd/test_htpasswd-virtual-path.py diff --git a/test/test_htpasswd/test_htpasswd_virtual_path.yml b/test/test_htpasswd/test_htpasswd-virtual-path.yml similarity index 100% rename from test/test_htpasswd/test_htpasswd_virtual_path.yml rename to test/test_htpasswd/test_htpasswd-virtual-path.yml diff --git a/test/test_http_port.py b/test/test_http-port/test_http-port.py similarity index 100% rename from test/test_http_port.py rename to test/test_http-port/test_http-port.py diff --git a/test/test_http_port.yml b/test/test_http-port/test_http-port.yml similarity index 100% rename from test/test_http_port.yml rename to test/test_http-port/test_http-port.yml diff --git a/test/test_http2/test_http2_global_disabled.py b/test/test_http2/test_http2-global-disabled.py similarity index 100% rename from test/test_http2/test_http2_global_disabled.py rename to test/test_http2/test_http2-global-disabled.py diff --git a/test/test_http2/test_http2_global_disabled.yml b/test/test_http2/test_http2-global-disabled.yml similarity index 100% rename from test/test_http2/test_http2_global_disabled.yml rename to test/test_http2/test_http2-global-disabled.yml diff --git a/test/test_http3/test_http3_global_disabled.py b/test/test_http3/test_http3-global-disabled.py similarity index 100% rename from test/test_http3/test_http3_global_disabled.py rename to test/test_http3/test_http3-global-disabled.py diff --git a/test/test_http3/test_http3_global_disabled.yml b/test/test_http3/test_http3-global-disabled.yml similarity index 100% rename from test/test_http3/test_http3_global_disabled.yml rename to test/test_http3/test_http3-global-disabled.yml diff --git a/test/test_http3/test_http3_global_enabled.py b/test/test_http3/test_http3-global-enabled.py similarity index 100% rename from test/test_http3/test_http3_global_enabled.py rename to test/test_http3/test_http3-global-enabled.py diff --git a/test/test_http3/test_http3_global_enabled.yml b/test/test_http3/test_http3-global-enabled.yml similarity index 100% rename from test/test_http3/test_http3_global_enabled.yml rename to test/test_http3/test_http3-global-enabled.yml diff --git a/test/test_http3/test_http3_vhost.py b/test/test_http3/test_http3-vhost.py similarity index 100% rename from test/test_http3/test_http3_vhost.py rename to test/test_http3/test_http3-vhost.py diff --git a/test/test_http3/test_http3_vhost.yml b/test/test_http3/test_http3-vhost.yml similarity index 100% rename from test/test_http3/test_http3_vhost.yml rename to test/test_http3/test_http3-vhost.yml diff --git a/test/test_ipv6/test_ipv6_prefer_ipv4_network.py b/test/test_ipv6/test_ipv6-prefer-ipv4-network.py similarity index 100% rename from test/test_ipv6/test_ipv6_prefer_ipv4_network.py rename to test/test_ipv6/test_ipv6-prefer-ipv4-network.py diff --git a/test/test_ipv6/test_ipv6_prefer_ipv4_network.yml b/test/test_ipv6/test_ipv6-prefer-ipv4-network.yml similarity index 100% rename from test/test_ipv6/test_ipv6_prefer_ipv4_network.yml rename to test/test_ipv6/test_ipv6-prefer-ipv4-network.yml diff --git a/test/test_ipv6/test_ipv6_prefer_ipv6_network.py b/test/test_ipv6/test_ipv6-prefer-ipv6-network.py similarity index 100% rename from test/test_ipv6/test_ipv6_prefer_ipv6_network.py rename to test/test_ipv6/test_ipv6-prefer-ipv6-network.py diff --git a/test/test_ipv6/test_ipv6_prefer_ipv6_network.yml b/test/test_ipv6/test_ipv6-prefer-ipv6-network.yml similarity index 100% rename from test/test_ipv6/test_ipv6_prefer_ipv6_network.yml rename to test/test_ipv6/test_ipv6-prefer-ipv6-network.yml diff --git a/test/test_keepalive.py b/test/test_keepalive/test_keepalive.py similarity index 100% rename from test/test_keepalive.py rename to test/test_keepalive/test_keepalive.py diff --git a/test/test_keepalive.yml b/test/test_keepalive/test_keepalive.yml similarity index 100% rename from test/test_keepalive.yml rename to test/test_keepalive/test_keepalive.yml diff --git a/test/test_loadbalancing.py b/test/test_loadbalancing/test_loadbalancing.py similarity index 97% rename from test/test_loadbalancing.py rename to test/test_loadbalancing/test_loadbalancing.py index e9e21ed..08f8537 100644 --- a/test/test_loadbalancing.py +++ b/test/test_loadbalancing/test_loadbalancing.py @@ -1,16 +1,16 @@ -import re - - -def test_loadbalance_hash(docker_compose, nginxproxy): - conf = nginxproxy.get_conf().decode('ASCII') - r1 = nginxproxy.get("http://loadbalance-enabled.nginx-proxy.tld") - r2 = nginxproxy.get("http://loadbalance-enabled.nginx-proxy.tld") - assert re.search(r"hash \$remote_addr\;", conf) - assert r1.status_code == 200 - assert r2.text == r1.text - -def test_loadbalance_roundrobin(docker_compose, nginxproxy): - r1 = nginxproxy.get("http://loadbalance-disabled.nginx-proxy.tld") - r2 = nginxproxy.get("http://loadbalance-disabled.nginx-proxy.tld") - assert r1.status_code == 200 - assert r2.text != r1.text +import re + + +def test_loadbalance_hash(docker_compose, nginxproxy): + conf = nginxproxy.get_conf().decode('ASCII') + r1 = nginxproxy.get("http://loadbalance-enabled.nginx-proxy.tld") + r2 = nginxproxy.get("http://loadbalance-enabled.nginx-proxy.tld") + assert re.search(r"hash \$remote_addr\;", conf) + assert r1.status_code == 200 + assert r2.text == r1.text + +def test_loadbalance_roundrobin(docker_compose, nginxproxy): + r1 = nginxproxy.get("http://loadbalance-disabled.nginx-proxy.tld") + r2 = nginxproxy.get("http://loadbalance-disabled.nginx-proxy.tld") + assert r1.status_code == 200 + assert r2.text != r1.text diff --git a/test/test_loadbalancing.yml b/test/test_loadbalancing/test_loadbalancing.yml similarity index 95% rename from test/test_loadbalancing.yml rename to test/test_loadbalancing/test_loadbalancing.yml index b8f42eb..46a9916 100644 --- a/test/test_loadbalancing.yml +++ b/test/test_loadbalancing/test_loadbalancing.yml @@ -1,27 +1,27 @@ -services: - loadbalance-hash: - image: web - expose: - - "81" - environment: - WEB_PORTS: 81 - VIRTUAL_HOST: loadbalance-enabled.nginx-proxy.tld - labels: - com.github.nginx-proxy.nginx-proxy.loadbalance: "hash $$remote_addr;" - deploy: - replicas: 2 - - loadbalance-roundrobin: - image: web - expose: - - "82" - environment: - WEB_PORTS: 82 - VIRTUAL_HOST: loadbalance-disabled.nginx-proxy.tld - deploy: - replicas: 2 - - sut: - image: nginxproxy/nginx-proxy:test - volumes: - - /var/run/docker.sock:/tmp/docker.sock:ro +services: + loadbalance-hash: + image: web + expose: + - "81" + environment: + WEB_PORTS: 81 + VIRTUAL_HOST: loadbalance-enabled.nginx-proxy.tld + labels: + com.github.nginx-proxy.nginx-proxy.loadbalance: "hash $$remote_addr;" + deploy: + replicas: 2 + + loadbalance-roundrobin: + image: web + expose: + - "82" + environment: + WEB_PORTS: 82 + VIRTUAL_HOST: loadbalance-disabled.nginx-proxy.tld + deploy: + replicas: 2 + + sut: + image: nginxproxy/nginx-proxy:test + volumes: + - /var/run/docker.sock:/tmp/docker.sock:ro diff --git a/test/test_location-override.py b/test/test_location-override/test_location-override.py similarity index 100% rename from test/test_location-override.py rename to test/test_location-override/test_location-override.py diff --git a/test/test_location-override.yml b/test/test_location-override/test_location-override.yml similarity index 94% rename from test/test_location-override.yml rename to test/test_location-override/test_location-override.yml index f36b206..c7a0812 100644 --- a/test/test_location-override.yml +++ b/test/test_location-override/test_location-override.yml @@ -3,7 +3,7 @@ services: image: nginxproxy/nginx-proxy:test volumes: - /var/run/docker.sock:/tmp/docker.sock:ro - - ./test_location-override.vhost.d:/etc/nginx/vhost.d:ro + - ./vhost.d:/etc/nginx/vhost.d:ro explicit-root: image: web diff --git a/test/test_location-override.vhost.d/explicit-nonroot.nginx-proxy.test_8d960560c82f4e6c8b1b0f03eb30a1afd00e5696_location_override b/test/test_location-override/vhost.d/explicit-nonroot.nginx-proxy.test_8d960560c82f4e6c8b1b0f03eb30a1afd00e5696_location_override similarity index 100% rename from test/test_location-override.vhost.d/explicit-nonroot.nginx-proxy.test_8d960560c82f4e6c8b1b0f03eb30a1afd00e5696_location_override rename to test/test_location-override/vhost.d/explicit-nonroot.nginx-proxy.test_8d960560c82f4e6c8b1b0f03eb30a1afd00e5696_location_override diff --git a/test/test_location-override.vhost.d/explicit-root-hash-and-nohash.nginx-proxy.test_42099b4af021e53fd8fd4e056c2568d7c2e3ffa8_location_override b/test/test_location-override/vhost.d/explicit-root-hash-and-nohash.nginx-proxy.test_42099b4af021e53fd8fd4e056c2568d7c2e3ffa8_location_override similarity index 100% rename from test/test_location-override.vhost.d/explicit-root-hash-and-nohash.nginx-proxy.test_42099b4af021e53fd8fd4e056c2568d7c2e3ffa8_location_override rename to test/test_location-override/vhost.d/explicit-root-hash-and-nohash.nginx-proxy.test_42099b4af021e53fd8fd4e056c2568d7c2e3ffa8_location_override diff --git a/test/test_location-override.vhost.d/explicit-root-hash-and-nohash.nginx-proxy.test_location_override b/test/test_location-override/vhost.d/explicit-root-hash-and-nohash.nginx-proxy.test_location_override similarity index 100% rename from test/test_location-override.vhost.d/explicit-root-hash-and-nohash.nginx-proxy.test_location_override rename to test/test_location-override/vhost.d/explicit-root-hash-and-nohash.nginx-proxy.test_location_override diff --git a/test/test_location-override.vhost.d/explicit-root-hash.nginx-proxy.test_42099b4af021e53fd8fd4e056c2568d7c2e3ffa8_location_override b/test/test_location-override/vhost.d/explicit-root-hash.nginx-proxy.test_42099b4af021e53fd8fd4e056c2568d7c2e3ffa8_location_override similarity index 100% rename from test/test_location-override.vhost.d/explicit-root-hash.nginx-proxy.test_42099b4af021e53fd8fd4e056c2568d7c2e3ffa8_location_override rename to test/test_location-override/vhost.d/explicit-root-hash.nginx-proxy.test_42099b4af021e53fd8fd4e056c2568d7c2e3ffa8_location_override diff --git a/test/test_location-override.vhost.d/explicit-root-nohash.nginx-proxy.test_location_override b/test/test_location-override/vhost.d/explicit-root-nohash.nginx-proxy.test_location_override similarity index 100% rename from test/test_location-override.vhost.d/explicit-root-nohash.nginx-proxy.test_location_override rename to test/test_location-override/vhost.d/explicit-root-nohash.nginx-proxy.test_location_override diff --git a/test/test_location-override.vhost.d/implicit-root-hash-and-nohash.nginx-proxy.test_42099b4af021e53fd8fd4e056c2568d7c2e3ffa8_location_override b/test/test_location-override/vhost.d/implicit-root-hash-and-nohash.nginx-proxy.test_42099b4af021e53fd8fd4e056c2568d7c2e3ffa8_location_override similarity index 100% rename from test/test_location-override.vhost.d/implicit-root-hash-and-nohash.nginx-proxy.test_42099b4af021e53fd8fd4e056c2568d7c2e3ffa8_location_override rename to test/test_location-override/vhost.d/implicit-root-hash-and-nohash.nginx-proxy.test_42099b4af021e53fd8fd4e056c2568d7c2e3ffa8_location_override diff --git a/test/test_location-override.vhost.d/implicit-root-hash-and-nohash.nginx-proxy.test_location_override b/test/test_location-override/vhost.d/implicit-root-hash-and-nohash.nginx-proxy.test_location_override similarity index 100% rename from test/test_location-override.vhost.d/implicit-root-hash-and-nohash.nginx-proxy.test_location_override rename to test/test_location-override/vhost.d/implicit-root-hash-and-nohash.nginx-proxy.test_location_override diff --git a/test/test_location-override.vhost.d/implicit-root-hash.nginx-proxy.test_42099b4af021e53fd8fd4e056c2568d7c2e3ffa8_location_override b/test/test_location-override/vhost.d/implicit-root-hash.nginx-proxy.test_42099b4af021e53fd8fd4e056c2568d7c2e3ffa8_location_override similarity index 100% rename from test/test_location-override.vhost.d/implicit-root-hash.nginx-proxy.test_42099b4af021e53fd8fd4e056c2568d7c2e3ffa8_location_override rename to test/test_location-override/vhost.d/implicit-root-hash.nginx-proxy.test_42099b4af021e53fd8fd4e056c2568d7c2e3ffa8_location_override diff --git a/test/test_location-override.vhost.d/implicit-root-nohash.nginx-proxy.test_location_override b/test/test_location-override/vhost.d/implicit-root-nohash.nginx-proxy.test_location_override similarity index 100% rename from test/test_location-override.vhost.d/implicit-root-nohash.nginx-proxy.test_location_override rename to test/test_location-override/vhost.d/implicit-root-nohash.nginx-proxy.test_location_override diff --git a/test/test_logs/test_log_disabled.py b/test/test_logs/test_log-disabled.py similarity index 100% rename from test/test_logs/test_log_disabled.py rename to test/test_logs/test_log-disabled.py diff --git a/test/test_logs/test_log_disabled.yml b/test/test_logs/test_log-disabled.yml similarity index 100% rename from test/test_logs/test_log_disabled.yml rename to test/test_logs/test_log-disabled.yml diff --git a/test/test_logs/test_log_format.py b/test/test_logs/test_log-format.py similarity index 100% rename from test/test_logs/test_log_format.py rename to test/test_logs/test_log-format.py diff --git a/test/test_logs/test_log_format.yml b/test/test_logs/test_log-format.yml similarity index 100% rename from test/test_logs/test_log_format.yml rename to test/test_logs/test_log-format.yml diff --git a/test/test_logs/test_log_json_format.py b/test/test_logs/test_log-json-format.py similarity index 100% rename from test/test_logs/test_log_json_format.py rename to test/test_logs/test_log-json-format.py diff --git a/test/test_logs/test_log_json_format.yml b/test/test_logs/test_log-json-format.yml similarity index 100% rename from test/test_logs/test_log_json_format.yml rename to test/test_logs/test_log-json-format.yml diff --git a/test/test_logs/test_log_json.py b/test/test_logs/test_log-json.py similarity index 100% rename from test/test_logs/test_log_json.py rename to test/test_logs/test_log-json.py diff --git a/test/test_logs/test_log_json.yml b/test/test_logs/test_log-json.yml similarity index 100% rename from test/test_logs/test_log_json.yml rename to test/test_logs/test_log-json.yml diff --git a/test/test_multiple-hosts.py b/test/test_multiple-hosts/test_multiple-hosts.py similarity index 100% rename from test/test_multiple-hosts.py rename to test/test_multiple-hosts/test_multiple-hosts.py diff --git a/test/test_multiple-hosts.yml b/test/test_multiple-hosts/test_multiple-hosts.yml similarity index 100% rename from test/test_multiple-hosts.yml rename to test/test_multiple-hosts/test_multiple-hosts.yml diff --git a/test/test_multiple-networks.py b/test/test_multiple-networks/test_multiple-networks.py similarity index 100% rename from test/test_multiple-networks.py rename to test/test_multiple-networks/test_multiple-networks.py diff --git a/test/test_multiple-networks.yml b/test/test_multiple-networks/test_multiple-networks.yml similarity index 100% rename from test/test_multiple-networks.yml rename to test/test_multiple-networks/test_multiple-networks.yml diff --git a/test/test_nominal.py b/test/test_nominal/test_nominal.py similarity index 100% rename from test/test_nominal.py rename to test/test_nominal/test_nominal.py diff --git a/test/test_nominal.yml b/test/test_nominal/test_nominal.yml similarity index 100% rename from test/test_nominal.yml rename to test/test_nominal/test_nominal.yml diff --git a/test/test_ports/test_VIRTUAL_PORT-single-different-from-single-port.py b/test/test_ports/test_virtual-port-single-different-from-single-port.py similarity index 100% rename from test/test_ports/test_VIRTUAL_PORT-single-different-from-single-port.py rename to test/test_ports/test_virtual-port-single-different-from-single-port.py diff --git a/test/test_ports/test_VIRTUAL_PORT-single-different-from-single-port.yml b/test/test_ports/test_virtual-port-single-different-from-single-port.yml similarity index 100% rename from test/test_ports/test_VIRTUAL_PORT-single-different-from-single-port.yml rename to test/test_ports/test_virtual-port-single-different-from-single-port.yml diff --git a/test/test_ports/test_VIRTUAL_PORT.py b/test/test_ports/test_virtual-port.py similarity index 100% rename from test/test_ports/test_VIRTUAL_PORT.py rename to test/test_ports/test_virtual-port.py diff --git a/test/test_ports/test_VIRTUAL_PORT.yml b/test/test_ports/test_virtual-port.yml similarity index 100% rename from test/test_ports/test_VIRTUAL_PORT.yml rename to test/test_ports/test_virtual-port.yml diff --git a/test/test_raw-ip-vhost.py b/test/test_raw-ip-vhost/test_raw-ip-vhost.py similarity index 100% rename from test/test_raw-ip-vhost.py rename to test/test_raw-ip-vhost/test_raw-ip-vhost.py diff --git a/test/test_raw-ip-vhost.yml b/test/test_raw-ip-vhost/test_raw-ip-vhost.yml similarity index 100% rename from test/test_raw-ip-vhost.yml rename to test/test_raw-ip-vhost/test_raw-ip-vhost.yml diff --git a/test/test_ssl/test_cert_selection.py b/test/test_ssl/test_cert-selection.py similarity index 100% rename from test/test_ssl/test_cert_selection.py rename to test/test_ssl/test_cert-selection.py diff --git a/test/test_ssl/test_cert_selection.yml b/test/test_ssl/test_cert-selection.yml similarity index 100% rename from test/test_ssl/test_cert_selection.yml rename to test/test_ssl/test_cert-selection.yml diff --git a/test/test_ssl/test_https_port.py b/test/test_ssl/test_https-port.py similarity index 100% rename from test/test_ssl/test_https_port.py rename to test/test_ssl/test_https-port.py diff --git a/test/test_ssl/test_https_port.yml b/test/test_ssl/test_https-port.yml similarity index 100% rename from test/test_ssl/test_https_port.yml rename to test/test_ssl/test_https-port.yml diff --git a/test/test_ssl/test_virtual_path.py b/test/test_ssl/test_virtual-path.py similarity index 100% rename from test/test_ssl/test_virtual_path.py rename to test/test_ssl/test_virtual-path.py diff --git a/test/test_ssl/test_virtual_path.yml b/test/test_ssl/test_virtual-path.yml similarity index 100% rename from test/test_ssl/test_virtual_path.yml rename to test/test_ssl/test_virtual-path.yml diff --git a/test/stress_tests/test_unreachable_network/README.md b/test/test_unreachable-network/README.md similarity index 100% rename from test/stress_tests/test_unreachable_network/README.md rename to test/test_unreachable-network/README.md diff --git a/test/stress_tests/test_unreachable_network/test_unreachable_net.py b/test/test_unreachable-network/test_unreachable-network.py similarity index 100% rename from test/stress_tests/test_unreachable_network/test_unreachable_net.py rename to test/test_unreachable-network/test_unreachable-network.py diff --git a/test/stress_tests/test_unreachable_network/docker-compose.yml b/test/test_unreachable-network/test_unreachable-network.yml similarity index 100% rename from test/stress_tests/test_unreachable_network/docker-compose.yml rename to test/test_unreachable-network/test_unreachable-network.yml diff --git a/test/test_vhost-empty-string.py b/test/test_vhost-empty-string/test_vhost-empty-string.py similarity index 100% rename from test/test_vhost-empty-string.py rename to test/test_vhost-empty-string/test_vhost-empty-string.py diff --git a/test/test_vhost-empty-string.yml b/test/test_vhost-empty-string/test_vhost-empty-string.yml similarity index 100% rename from test/test_vhost-empty-string.yml rename to test/test_vhost-empty-string/test_vhost-empty-string.yml diff --git a/test/test_vhost-in-multiple-networks.py b/test/test_vhost-in-multiple-networks/test_vhost-in-multiple-networks.py similarity index 100% rename from test/test_vhost-in-multiple-networks.py rename to test/test_vhost-in-multiple-networks/test_vhost-in-multiple-networks.py diff --git a/test/test_vhost-in-multiple-networks.yml b/test/test_vhost-in-multiple-networks/test_vhost-in-multiple-networks.yml similarity index 100% rename from test/test_vhost-in-multiple-networks.yml rename to test/test_vhost-in-multiple-networks/test_vhost-in-multiple-networks.yml diff --git a/test/test_virtual-path/test_custom_conf.py b/test/test_virtual-path/test_custom-conf.py similarity index 100% rename from test/test_virtual-path/test_custom_conf.py rename to test/test_virtual-path/test_custom-conf.py diff --git a/test/test_virtual-path/test_custom_conf.yml b/test/test_virtual-path/test_custom-conf.yml similarity index 100% rename from test/test_virtual-path/test_custom_conf.yml rename to test/test_virtual-path/test_custom-conf.yml diff --git a/test/test_virtual-path/test_location_precedence.py b/test/test_virtual-path/test_location-precedence.py similarity index 100% rename from test/test_virtual-path/test_location_precedence.py rename to test/test_virtual-path/test_location-precedence.py diff --git a/test/test_virtual-path/test_location_precedence.yml b/test/test_virtual-path/test_location-precedence.yml similarity index 100% rename from test/test_virtual-path/test_location_precedence.yml rename to test/test_virtual-path/test_location-precedence.yml diff --git a/test/test_virtual-path/test_virtual_paths.py b/test/test_virtual-path/test_virtual-paths.py similarity index 95% rename from test/test_virtual-path/test_virtual_paths.py rename to test/test_virtual-path/test_virtual-paths.py index e615d80..4ba42aa 100644 --- a/test/test_virtual-path/test_virtual_paths.py +++ b/test/test_virtual-path/test_virtual-paths.py @@ -40,7 +40,7 @@ def web4(docker_compose): }, ports={"84/tcp": None} ) - docker_compose.networks.get("test_virtual-path_default").connect(container) + docker_compose.networks.get("test_virtual-path-net").connect(container) sleep(2) # give it some time to initialize and for docker-gen to detect it yield container try: diff --git a/test/test_virtual-path/test_virtual_paths.yml b/test/test_virtual-path/test_virtual-paths.yml similarity index 93% rename from test/test_virtual-path/test_virtual_paths.yml rename to test/test_virtual-path/test_virtual-paths.yml index 6e51b02..00e7fbe 100644 --- a/test/test_virtual-path/test_virtual_paths.yml +++ b/test/test_virtual-path/test_virtual-paths.yml @@ -1,3 +1,7 @@ +networks: + default: + name: "test_virtual-path-net" + services: foo: image: web diff --git a/test/test_wildcard_host.py b/test/test_wildcard-host/test_wildcard-host.py similarity index 100% rename from test/test_wildcard_host.py rename to test/test_wildcard-host/test_wildcard-host.py diff --git a/test/test_wildcard_host.yml b/test/test_wildcard-host/test_wildcard-host.yml similarity index 100% rename from test/test_wildcard_host.yml rename to test/test_wildcard-host/test_wildcard-host.yml