From 643beee453c3ec4014f563c58fa417b073caf433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sj=C3=B6gren?= Date: Sat, 30 May 2015 13:03:01 +0200 Subject: [PATCH] fail=1 when Docker exec fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Sjögren --- tests/5_container_runtime.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/5_container_runtime.sh b/tests/5_container_runtime.sh index 3cd9495..7ec7e4d 100644 --- a/tests/5_container_runtime.sh +++ b/tests/5_container_runtime.sh @@ -61,6 +61,13 @@ else fail=0 for c in $containers; do + exec_check=`docker exec $c ps -el 2>/dev/null` + if [ $? -eq 255 ]; then + warn "$check_5_3" + warn " * Docker exec fails: $c" + fail=1 + fi + processes=`docker exec $c ps -el 2>/dev/null | wc -l | awk '{print $1}'` if [ $processes -gt 5 ]; then # If it's the first container, fail the test @@ -165,8 +172,14 @@ else fail=0 for c in $containers; do - processes=`docker exec $c ps -el 2>/dev/null | grep sshd | wc -l | awk '{print $1}'` + exec_check=`docker exec $c ps -el 2>/dev/null` + if [ $? -eq 255 ]; then + warn "$check_5_7" + warn " * Docker exec failed: $c" + fail=1 + fi + processes=`docker exec $c ps -el 2>/dev/null | grep sshd | wc -l | awk '{print $1}'` if [ $processes -gt 1 ]; then # If it's the first container, fail the test if [ $fail -eq 0 ]; then