From 3616f15cba48cca3d4cc08d299a3d0f35d157e86 Mon Sep 17 00:00:00 2001 From: "Zvi \"Viz\" Effron" Date: Mon, 15 Jun 2015 11:26:13 -0700 Subject: [PATCH] Fix test 5.14 to not always pass when multiple ports are published. Signed-off-by: Zvi "Viz" Effron --- tests/5_container_runtime.sh | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/5_container_runtime.sh b/tests/5_container_runtime.sh index 7133b9e..35c41b5 100644 --- a/tests/5_container_runtime.sh +++ b/tests/5_container_runtime.sh @@ -319,17 +319,18 @@ else fail=0 for c in $containers; do - ip=$(docker port "$c" | awk '{print $3}' | cut -d ':' -f1) - if [ "$ip" = "0.0.0.0" ]; then - # If it's the first container, fail the test - if [ $fail -eq 0 ]; then - warn "$check_5_14" - warn " * Port being bound to wildcard IP: $ip in $c" - fail=1 - else - warn " * Port being bound to wildcard IP: $ip in $c" + for ip in $(docker port "$c" | awk '{print $3}' | cut -d ':' -f1); do + if [ "$ip" = "0.0.0.0" ]; then + # If it's the first container, fail the test + if [ $fail -eq 0 ]; then + warn "$check_5_14" + warn " * Port being bound to wildcard IP: $ip in $c" + fail=1 + else + warn " * Port being bound to wildcard IP: $ip in $c" + fi fi - fi + done done # We went through all the containers and found no ports bound to 0.0.0.0 if [ $fail -eq 0 ]; then