From 95e6ac8253084046dfee1a92aeb8632026358794 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sj=C3=B6gren?= Date: Mon, 23 Jan 2017 13:13:48 +0100 Subject: [PATCH] #182 checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Sjögren --- tests/2_docker_daemon_configuration.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/2_docker_daemon_configuration.sh b/tests/2_docker_daemon_configuration.sh index 3bdd440..b9f1245 100644 --- a/tests/2_docker_daemon_configuration.sh +++ b/tests/2_docker_daemon_configuration.sh @@ -148,7 +148,11 @@ get_docker_effective_command_line_args '--live-restore' 2>/dev/null | grep "live if [ $? -eq 0 ]; then pass "$check_2_14" else - warn "$check_2_14" + if docker info 2>/dev/null | grep -e "Swarm:\s*active\s*" >/dev/null 2>&1; then + pass "$check_2_14 (Incompatible with swarm mode)" + else + warn "$check_2_14" + fi fi # 2.15 @@ -162,11 +166,15 @@ fi # 2.16 check_2_16="2.16 - Control the number of manager nodes in a swarm" -docker node ls 2>/dev/null | grep "Leader" >/dev/null 2>&1 -if [ $? -eq 1 ]; then - pass "$check_2_16" +if docker info 2>/dev/null | grep -e "Swarm:\s*active\s*" >/dev/null 2>&1; then + managernodes=$(docker node ls | grep "Leader" | wc -l) + if [ $managernodes -le 1 ]; then + pass "$check_2_16" + else + warn "$check_2_16" + fi else - warn "$check_2_16" + pass "$check_2_16 (Swarm mode not enabled)" fi # 2.17