mirror of
https://github.com/thib8956/nginx-proxy
synced 2025-02-24 09:48:14 +00:00
test: fix failing tests
This commit is contained in:
parent
060f09cfce
commit
c4cf0af373
@ -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:
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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.
|
||||||
|
@ -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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user