From e78f1b8045df7a5d13235f2b3cc2884896f1e5d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sj=C3=B6gren?= Date: Fri, 10 Feb 2017 15:35:06 +0100 Subject: [PATCH 1/2] replace contains with grep 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/5_container_runtime.sh b/tests/5_container_runtime.sh index 7c6ff7a..a9f5309 100644 --- a/tests/5_container_runtime.sh +++ b/tests/5_container_runtime.sh @@ -127,7 +127,9 @@ else # Go over each directory in sensitive dir and see if they exist in the volumes for v in $sensitive_dirs; do sensitive=0 - contains "$volumes" "$v" && sensitive=1 + if echo "$volumes" | grep -e "{.*\s$v\s.*true\s}" 2>/tmp/null 1>&2; then + sensitive=1 + fi if [ $sensitive -eq 1 ]; then # If it's the first container, fail the test if [ $fail -eq 0 ]; then From bd236b1ac0d86585e372abfad88d9c9c95771ef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sj=C3=B6gren?= Date: Mon, 13 Feb 2017 11:36:16 +0100 Subject: [PATCH 2/2] add host / as sensitive 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/5_container_runtime.sh b/tests/5_container_runtime.sh index a9f5309..da24030 100644 --- a/tests/5_container_runtime.sh +++ b/tests/5_container_runtime.sh @@ -110,7 +110,8 @@ else # List of sensitive directories to test for. Script uses new-lines as a separator. # Note the lack of identation. It needs it for the substring comparison. - sensitive_dirs='/boot + sensitive_dirs='/ +/boot /dev /etc /lib