diff --git a/tests/5_container_runtime.sh b/tests/5_container_runtime.sh index 7c6ff7a..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 @@ -127,7 +128,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