From 0d2bc381791bf15746e363b8dcf9acc5a28fdd6c Mon Sep 17 00:00:00 2001 From: Mike Dillon Date: Fri, 9 Oct 2015 23:11:03 -0700 Subject: [PATCH] Run curl commands from a sibling container --- test/docker.bats | 2 +- test/test_helpers.bash | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/docker.bats b/test/docker.bats index 44d31b9..d5fde7c 100644 --- a/test/docker.bats +++ b/test/docker.bats @@ -62,7 +62,7 @@ load test_helpers -v /etc/nginx/certs/ \ nginx:latest assert_success - run retry 5 1s curl --silent --fail --head http://$(docker_ip bats-nginx)/ + run retry 5 1s docker run --rm appropriate/curl --silent --fail --head http://$(docker_ip bats-nginx)/ assert_output -l 0 $'HTTP/1.1 200 OK\r' # WHEN docker-gen runs on our docker host diff --git a/test/test_helpers.bash b/test/test_helpers.bash index 9063736..d4f0842 100644 --- a/test/test_helpers.bash +++ b/test/test_helpers.bash @@ -1,7 +1,7 @@ # Test if requirements are met ( type docker &>/dev/null || ( echo "docker is not available"; exit 1 ) - type curl &>/dev/null || ( echo "curl is not available"; exit 1 ) + #type curl &>/dev/null || ( echo "curl is not available"; exit 1 ) )>&2 @@ -67,7 +67,7 @@ function curl_container { local -r container=$1 local -r path=$2 shift 2 - curl --silent \ + docker run --rm appropriate/curl --silent \ --connect-timeout 5 \ --max-time 20 \ "$@" \ @@ -122,7 +122,7 @@ function prepare_web_container { # THEN querying directly port works for port in $ports; do - run retry 5 1s curl --silent --fail http://$(docker_ip $container_name):$port/data + run retry 5 1s docker run --rm appropriate/curl --silent --fail http://$(docker_ip $container_name):$port/data assert_output "answer from port $port" done } \ No newline at end of file