From 17ee45ba94f796afdd0b213e134fe70e9cc00736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sj=C3=B6gren?= Date: Thu, 23 Mar 2017 15:28:06 +0100 Subject: [PATCH] test tls get_docker_configuration_file_args MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Sjögren --- tests/3_docker_daemon_configuration_files.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/3_docker_daemon_configuration_files.sh b/tests/3_docker_daemon_configuration_files.sh index 4177daf..fb5e2ac 100644 --- a/tests/3_docker_daemon_configuration_files.sh +++ b/tests/3_docker_daemon_configuration_files.sh @@ -139,7 +139,7 @@ fi # 3.9 check_3_9="3.9 - Verify that TLS CA certificate file ownership is set to root:root" -if get_docker_configuration_file_args 'tlscacert' 2>/dev/null 1>&2; then +if ! [ -z $(get_docker_configuration_file_args 'tlscacert') ]; then tlscacert=$(get_docker_configuration_file_args 'tlscacert') else tlscacert=$(get_docker_effective_command_line_args '--tlscacert' | sed -n 's/.*tlscacert=\([^s]\)/\1/p' | sed 's/--/ --/g' | cut -d " " -f 1) @@ -158,7 +158,7 @@ fi # 3.10 check_3_10="3.10 - Verify that TLS CA certificate file permissions are set to 444 or more restrictive" -if get_docker_configuration_file_args 'tlscacert' 2>/dev/null 1>&2; then +if ! [ -z $(get_docker_configuration_file_args 'tlscacert') ]; then tlscacert=$(get_docker_configuration_file_args 'tlscacert') else tlscacert=$(get_docker_effective_command_line_args '--tlscacert' | sed -n 's/.*tlscacert=\([^s]\)/\1/p' | sed 's/--/ --/g' | cut -d " " -f 1) @@ -177,7 +177,7 @@ fi # 3.11 check_3_11="3.11 - Verify that Docker server certificate file ownership is set to root:root" -if get_docker_configuration_file_args 'tlscert' 2>/dev/null 1>&2; then +if ! [ -z $(get_docker_configuration_file_args 'tlscert') ]; then tlscert=$(get_docker_configuration_file_args 'tlscert') else tlscert=$(get_docker_effective_command_line_args '--tlscert' | sed -n 's/.*tlscert=\([^s]\)/\1/p' | sed 's/--/ --/g' | cut -d " " -f 1) @@ -196,7 +196,7 @@ fi # 3.12 check_3_12="3.12 - Verify that Docker server certificate file permissions are set to 444 or more restrictive" -if get_docker_configuration_file_args 'tlscert' 2>/dev/null 1>&2; then +if ! [ -z $(get_docker_configuration_file_args 'tlscert') ]; then tlscert=$(get_docker_configuration_file_args 'tlscert') else tlscert=$(get_docker_effective_command_line_args '--tlscert' | sed -n 's/.*tlscert=\([^s]\)/\1/p' | sed 's/--/ --/g' | cut -d " " -f 1) @@ -215,7 +215,7 @@ fi # 3.13 check_3_13="3.13 - Verify that Docker server key file ownership is set to root:root" -if get_docker_configuration_file_args 'tlskey' 2>/dev/null 1>&2; then +if ! [ -z $(get_docker_configuration_file_args 'tlskey') ]; then tlskey=$(get_docker_configuration_file_args 'tlskey') else tlskey=$(get_docker_effective_command_line_args '--tlskey' | sed -n 's/.*tlskey=\([^s]\)/\1/p' | sed 's/--/ --/g' | cut -d " " -f 1) @@ -234,7 +234,7 @@ fi # 3.14 check_3_14="3.14 - Verify that Docker server key file permissions are set to 400 or more restrictive" -if get_docker_configuration_file_args 'tlskey' 2>/dev/null 1>&2; then +if ! [ -z $(get_docker_configuration_file_args 'tlskey') ]; then tlskey=$(get_docker_configuration_file_args 'tlskey') else tlskey=$(get_docker_effective_command_line_args '--tlskey' | sed -n 's/.*tlskey=\([^s]\)/\1/p' | sed 's/--/ --/g' | cut -d " " -f 1)