From d7926a0f311eecfe4acaf1b8a6edc6176744d409 Mon Sep 17 00:00:00 2001 From: Csaba Palfi Date: Mon, 17 Aug 2015 17:29:42 +0100 Subject: [PATCH 1/2] make process count check a bit easier to read Signed-off-by: Csaba Palfi --- tests/5_container_runtime.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/5_container_runtime.sh b/tests/5_container_runtime.sh index 9fa936b..4fcc29e 100644 --- a/tests/5_container_runtime.sh +++ b/tests/5_container_runtime.sh @@ -62,8 +62,8 @@ else fail=0 printcheck=0 for c in $containers; do - processes=$(docker exec "$c" ps -el 2>/dev/null | wc -l | awk '{print $1}') - if [ "$processes" -gt 5 ]; then + processes=$(docker exec "$c" ps -el 2>/dev/null | tail -n +2 | grep -v "ps -el" | wc -l | tr -d ' ') + if [ "$processes" -gt 1 ]; then # If it's the first container, fail the test if [ $fail -eq 0 ]; then warn "$check_5_3" From 831a373a61b726ea2267f31a2d5e861457f71411 Mon Sep 17 00:00:00 2001 From: Csaba Palfi Date: Mon, 17 Aug 2015 17:41:47 +0100 Subject: [PATCH 2/2] make process count check even simpler Signed-off-by: Csaba Palfi --- tests/5_container_runtime.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/5_container_runtime.sh b/tests/5_container_runtime.sh index 4fcc29e..cf24d72 100644 --- a/tests/5_container_runtime.sh +++ b/tests/5_container_runtime.sh @@ -62,7 +62,7 @@ else fail=0 printcheck=0 for c in $containers; do - processes=$(docker exec "$c" ps -el 2>/dev/null | tail -n +2 | grep -v "ps -el" | wc -l | tr -d ' ') + processes=$(docker exec "$c" ps -el 2>/dev/null | tail -n +2 | grep -c -v "ps -el") if [ "$processes" -gt 1 ]; then # If it's the first container, fail the test if [ $fail -eq 0 ]; then