From 919816dbbf142dd91fcecfd04a93866f98cc1581 Mon Sep 17 00:00:00 2001 From: mark Date: Mon, 28 Sep 2020 08:04:17 +0200 Subject: [PATCH 1/2] Changed to 'df' to support user namespaces --- tests/1_host_configuration.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/1_host_configuration.sh b/tests/1_host_configuration.sh index 30dfaac..3ab5ef2 100644 --- a/tests/1_host_configuration.sh +++ b/tests/1_host_configuration.sh @@ -73,8 +73,9 @@ check_1_2_1() { starttestjson "$id_1_2_1" "$desc_1_2_1" totalChecks=$((totalChecks + 1)) - - if mountpoint -q -- "$(docker info -f '{{ .DockerRootDir }}')" >/dev/null 2>&1; then + local system_partition=$(df / --output=source 2> /dev/null | sed -n 2p) + local docker_partition=$(df "$(docker info -f '{{ .DockerRootDir }}')" --output=source 2> /dev/null | sed -n 2p) + if [ "$system_partition" != "$docker_partition" ] && [ ! -z "$docker_partition" ] ; then pass "$check_1_2_1" resulttestjson "PASS" currentScore=$((currentScore + 1)) From d85c73316a424bdde251769eb3662d51cd616d4d Mon Sep 17 00:00:00 2001 From: mark Date: Tue, 29 Sep 2020 12:41:25 +0200 Subject: [PATCH 2/2] Updated mountpoint check to support user namespace --- tests/1_host_configuration.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/1_host_configuration.sh b/tests/1_host_configuration.sh index 3ab5ef2..3a2e843 100644 --- a/tests/1_host_configuration.sh +++ b/tests/1_host_configuration.sh @@ -73,9 +73,12 @@ check_1_2_1() { starttestjson "$id_1_2_1" "$desc_1_2_1" totalChecks=$((totalChecks + 1)) - local system_partition=$(df / --output=source 2> /dev/null | sed -n 2p) - local docker_partition=$(df "$(docker info -f '{{ .DockerRootDir }}')" --output=source 2> /dev/null | sed -n 2p) - if [ "$system_partition" != "$docker_partition" ] && [ ! -z "$docker_partition" ] ; then + docker_root_dir=$(docker info -f '{{ .DockerRootDir }}') + if docker info | grep -q userns ; then + docker_root_dir=$(readlink -f "$docker_root_dir/..") + fi + + if mountpoint -q -- "$docker_root_dir" >/dev/null 2>&1; then pass "$check_1_2_1" resulttestjson "PASS" currentScore=$((currentScore + 1))