mirror of
https://github.com/thib8956/nginx-proxy
synced 2025-07-01 22:35:45 +00:00
Update to docker-gen 0.7.0
Since [1] some timings seem to have changed. This caused the unit tests
to fail intermittently, from my testings especially on Ubuntu systems
(much less often on e.g. Arch).
This commit adds the `dockergen_wait_for_event` helper-function to try
and wait for the configuration to be generated by docker-gen before
continuing on with the actual tests themselves.
Additionally, at the end of every test file, all containers spun up by
the bats-tests will be stopped. This required adding the `bats-type`
label to every container started during the bats-tests.
The stopping of the containers reduces the amount of events docker-gen
has to process, thus resulting in lower wait times for the generation to
happen.
[1]: 50435652b1
This commit is contained in:
@ -13,6 +13,11 @@ function docker_ip {
|
||||
docker inspect --format '{{ .NetworkSettings.IPAddress }}' $1
|
||||
}
|
||||
|
||||
# get the ip of docker container $1
|
||||
function docker_id {
|
||||
docker inspect --format '{{ .ID }}' $1
|
||||
}
|
||||
|
||||
# get the running state of container $1
|
||||
# → true/false
|
||||
# fails if the container does not exist
|
||||
@ -52,9 +57,10 @@ function docker_tcp {
|
||||
local container_name="$1"
|
||||
docker_clean $container_name
|
||||
docker run -d \
|
||||
--label bats-type="socat" \
|
||||
--name $container_name \
|
||||
--expose 2375 \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
rancher/socat-docker
|
||||
docker run --link "$container_name:docker" docker:1.9 version
|
||||
docker run --label bats-type="docker" --link "$container_name:docker" docker:1.9 version
|
||||
}
|
||||
|
Reference in New Issue
Block a user