mirror of
https://github.com/thib8956/nginx-proxy
synced 2024-11-22 03:46:29 +00:00
Tweak test for reliability on Travis-CI
This commit is contained in:
parent
c219822cd8
commit
dffc0c47cf
@ -20,14 +20,12 @@ function setup {
|
||||
&& wait_for_nginxproxy_container_to_start $SUT_CONTAINER \
|
||||
&& docker logs $SUT_CONTAINER
|
||||
|
||||
DEFAULT_HASH=$(docker exec $SUT_CONTAINER md5sum /etc/nginx/dhparam/dhparam.pem | cut -d" " -f1)
|
||||
|
||||
assert_success
|
||||
docker_wait_for_log $SUT_CONTAINER 9 "Watching docker events"
|
||||
docker_wait_for_log $SUT_CONTAINER 9 "Generating DH parameters"
|
||||
|
||||
# THEN
|
||||
run docker exec $SUT_CONTAINER ps aux
|
||||
assert_output -p "openssl"
|
||||
|
||||
DEFAULT_HASH=$(docker exec $SUT_CONTAINER md5sum /etc/nginx/dhparam/dhparam.pem | cut -d" " -f1)
|
||||
docker_wait_for_log $SUT_CONTAINER 240 "dhparam generation complete, reloading nginx"
|
||||
|
||||
run docker exec $SUT_CONTAINER md5sum /etc/nginx/dhparam/dhparam.pem
|
||||
@ -42,6 +40,13 @@ function setup {
|
||||
if [ ! -d $TMP_DIR ]; then
|
||||
mkdir $TMP_DIR
|
||||
fi
|
||||
|
||||
# If the previous test crashed, a dhparam is left that only root can delete, so we
|
||||
# delete it from within a container as root
|
||||
if [ -f $TMP_DIR/dhparam.pem ]; then
|
||||
docker run --rm -v $TMP_DIR:/opt busybox rm /opt/dhparam.pem
|
||||
fi
|
||||
|
||||
cp $DIR/../dhparam.pem.default $TMP_DIR/dhparam.pem
|
||||
|
||||
# WHEN
|
||||
@ -55,14 +60,9 @@ function setup {
|
||||
&& wait_for_nginxproxy_container_to_start $SUT_CONTAINER \
|
||||
&& docker logs $SUT_CONTAINER
|
||||
|
||||
docker logs $SUT_CONTAINER
|
||||
|
||||
assert_success
|
||||
docker_wait_for_log $SUT_CONTAINER 9 "Watching docker events"
|
||||
|
||||
# THEN
|
||||
run docker exec $SUT_CONTAINER ps aux
|
||||
assert_output -p "openssl"
|
||||
assert_success
|
||||
docker_wait_for_log $SUT_CONTAINER 9 "Generating DH parameters"
|
||||
|
||||
docker exec $SUT_CONTAINER rm -rf /etc/nginx/dhparam/*
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user