1
0
Fork 0
mirror of https://github.com/nginx-proxy/nginx-proxy synced 2024-05-19 05:56:07 +02:00

test: fix failing tests

This commit is contained in:
Nicolas Duchon 2023-12-11 15:06:29 +01:00
parent 060f09cfce
commit c4cf0af373
5 changed files with 9 additions and 4 deletions

View File

@ -22,6 +22,7 @@ def web1(docker_compose):
}, },
ports={"81/tcp": None} ports={"81/tcp": None}
) )
docker_compose.networks.get("test_default").connect(container)
sleep(2) # give it some time to initialize and for docker-gen to detect it sleep(2) # give it some time to initialize and for docker-gen to detect it
yield container yield container
try: try:
@ -46,6 +47,7 @@ def web2(docker_compose):
}, },
ports={"82/tcp": None} ports={"82/tcp": None}
) )
docker_compose.networks.get("test_default").connect(container)
sleep(2) # give it some time to initialize and for docker-gen to detect it sleep(2) # give it some time to initialize and for docker-gen to detect it
yield container yield container
try: try:

View File

@ -24,7 +24,7 @@ services:
environment: environment:
WEB_PORTS: 83 WEB_PORTS: 83
VIRTUAL_HOST: web.nginx-proxy.tld VIRTUAL_HOST: web.nginx-proxy.tld
net: "none" network_mode: "none"
sut: sut:
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test

View File

@ -8,7 +8,7 @@ services:
environment: environment:
WEB_PORTS: 81 WEB_PORTS: 81
VIRTUAL_HOST: web.nginx-proxy.tld VIRTUAL_HOST: web.nginx-proxy.tld
net: "none" network_mode: "none"
sut: sut:
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test

View File

@ -3,6 +3,7 @@ import subprocess
import backoff import backoff
import docker import docker
import pprint
import pytest import pytest
docker_client = docker.from_env() docker_client = docker.from_env()
@ -60,7 +61,8 @@ def require_openssl(required_version):
@require_openssl("1.0.2") @require_openssl("1.0.2")
def negotiate_cipher(sut_container, additional_params='', grep='Cipher is'): def negotiate_cipher(sut_container, additional_params='', grep='Cipher is'):
host = f"{sut_container.attrs['NetworkSettings']['IPAddress']}:443" sut_container.reload()
host = f"{sut_container.attrs['NetworkSettings']['Networks']['test_ssl_default']['IPAddress']}:443"
try: try:
# Enforce TLS 1.2 as newer versions don't support custom dhparam or ciphersuite preference. # Enforce TLS 1.2 as newer versions don't support custom dhparam or ciphersuite preference.
@ -77,7 +79,7 @@ def negotiate_cipher(sut_container, additional_params='', grep='Cipher is'):
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
# Output a more helpful error, the original exception in this case isn't that helpful. # Output a more helpful error, the original exception in this case isn't that helpful.
# `from None` to ignore undesired output from exception chaining. # `from None` to ignore undesired output from exception chaining.
raise Exception("Failed to process CLI request:\n" + e.stderr) from None raise Exception(f"Failed to process CLI request openssl s_client -connect {host} -tls1_2 {additional_params}:\n" + e.stderr) from None
# The default `dh_bits` can vary due to configuration. # The default `dh_bits` can vary due to configuration.

View File

@ -39,6 +39,7 @@ def web4(docker_compose):
}, },
ports={"84/tcp": None} ports={"84/tcp": None}
) )
docker_compose.networks.get("test_virtual-path_default").connect(container)
sleep(2) # give it some time to initialize and for docker-gen to detect it sleep(2) # give it some time to initialize and for docker-gen to detect it
yield container yield container
try: try: