From c15dc6c5680bd98bdfbd81b81ddb501428c325e1 Mon Sep 17 00:00:00 2001 From: Andreas Stieger Date: Fri, 24 Feb 2017 10:08:25 +0100 Subject: [PATCH 1/4] 2.17: netstat non-numeric output may not interpreted correctly The port may be aliased in /etc/services Fixes #224 - no. 1 Signed-off-by: Andreas Stieger --- tests/2_docker_daemon_configuration.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/2_docker_daemon_configuration.sh b/tests/2_docker_daemon_configuration.sh index cdd39cd..eb8f22b 100644 --- a/tests/2_docker_daemon_configuration.sh +++ b/tests/2_docker_daemon_configuration.sh @@ -161,7 +161,7 @@ fi # 2.17 check_2_17="2.17 - Bind swarm services to a specific host interface" if docker info 2>/dev/null | grep -e "Swarm:*\sactive\s*" >/dev/null 2>&1; then - netstat -lt | grep -e '\[::]:2377' -e '*:2377' -e '0.0.0.0:2377' >/dev/null 2>&1 + netstat -lnt | grep -e '\[::]:2377' -e '*:2377' -e '0.0.0.0:2377' >/dev/null 2>&1 if [ $? -eq 1 ]; then pass "$check_2_17" else From 7c66b6373a39d96b4eb5a17a861f74ac3ae067ed Mon Sep 17 00:00:00 2001 From: Andreas Stieger Date: Fri, 24 Feb 2017 10:17:33 +0100 Subject: [PATCH 2/4] 2.17: grep -e recognizes IPv4 separator any character - escape Fixes #224 - no. 2 Signed-off-by: Andreas Stieger --- tests/2_docker_daemon_configuration.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/2_docker_daemon_configuration.sh b/tests/2_docker_daemon_configuration.sh index eb8f22b..94b8f7b 100644 --- a/tests/2_docker_daemon_configuration.sh +++ b/tests/2_docker_daemon_configuration.sh @@ -161,7 +161,7 @@ fi # 2.17 check_2_17="2.17 - Bind swarm services to a specific host interface" if docker info 2>/dev/null | grep -e "Swarm:*\sactive\s*" >/dev/null 2>&1; then - netstat -lnt | grep -e '\[::]:2377' -e '*:2377' -e '0.0.0.0:2377' >/dev/null 2>&1 + netstat -lnt | grep -e '\[::]:2377' -e '*:2377' -e '0\.0\.0\.0:2377' >/dev/null 2>&1 if [ $? -eq 1 ]; then pass "$check_2_17" else From 421c6dd86656298508724e331395e4821903437f Mon Sep 17 00:00:00 2001 From: Andreas Stieger Date: Fri, 24 Feb 2017 13:18:07 +0100 Subject: [PATCH 3/4] 2.17: may incorrectly match 5 digit port numbers Fixes #224 - no. 3 Signed-off-by: Andreas Stieger --- tests/2_docker_daemon_configuration.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/2_docker_daemon_configuration.sh b/tests/2_docker_daemon_configuration.sh index 94b8f7b..cdf719a 100644 --- a/tests/2_docker_daemon_configuration.sh +++ b/tests/2_docker_daemon_configuration.sh @@ -161,7 +161,7 @@ fi # 2.17 check_2_17="2.17 - Bind swarm services to a specific host interface" if docker info 2>/dev/null | grep -e "Swarm:*\sactive\s*" >/dev/null 2>&1; then - netstat -lnt | grep -e '\[::]:2377' -e '*:2377' -e '0\.0\.0\.0:2377' >/dev/null 2>&1 + netstat -lnt | grep -e '\[::]:2377 ' -e '*:2377 ' -e ' 0\.0\.0\.0:2377 ' >/dev/null 2>&1 if [ $? -eq 1 ]; then pass "$check_2_17" else From c30a43c1fd792cd988cbef786ac3428de35cc36c Mon Sep 17 00:00:00 2001 From: Andreas Stieger Date: Fri, 24 Feb 2017 13:19:03 +0100 Subject: [PATCH 4/4] 2.17: account for :::2377 netstat output Fixes #224 - no. 4 Signed-off-by: Andreas Stieger --- tests/2_docker_daemon_configuration.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/2_docker_daemon_configuration.sh b/tests/2_docker_daemon_configuration.sh index cdf719a..fe3a9a7 100644 --- a/tests/2_docker_daemon_configuration.sh +++ b/tests/2_docker_daemon_configuration.sh @@ -161,7 +161,7 @@ fi # 2.17 check_2_17="2.17 - Bind swarm services to a specific host interface" if docker info 2>/dev/null | grep -e "Swarm:*\sactive\s*" >/dev/null 2>&1; then - netstat -lnt | grep -e '\[::]:2377 ' -e '*:2377 ' -e ' 0\.0\.0\.0:2377 ' >/dev/null 2>&1 + netstat -lnt | grep -e '\[::]:2377 ' -e ':::2377' -e '*:2377 ' -e ' 0\.0\.0\.0:2377 ' >/dev/null 2>&1 if [ $? -eq 1 ]; then pass "$check_2_17" else