Skip to content

Commit d85c733

Browse files
committed
Updated mountpoint check to support user namespace
1 parent 919816d commit d85c733

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/1_host_configuration.sh

+6-3
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,12 @@ check_1_2_1() {
7373
starttestjson "$id_1_2_1" "$desc_1_2_1"
7474

7575
totalChecks=$((totalChecks + 1))
76-
local system_partition=$(df / --output=source 2> /dev/null | sed -n 2p)
77-
local docker_partition=$(df "$(docker info -f '{{ .DockerRootDir }}')" --output=source 2> /dev/null | sed -n 2p)
78-
if [ "$system_partition" != "$docker_partition" ] && [ ! -z "$docker_partition" ] ; then
76+
docker_root_dir=$(docker info -f '{{ .DockerRootDir }}')
77+
if docker info | grep -q userns ; then
78+
docker_root_dir=$(readlink -f "$docker_root_dir/..")
79+
fi
80+
81+
if mountpoint -q -- "$docker_root_dir" >/dev/null 2>&1; then
7982
pass "$check_1_2_1"
8083
resulttestjson "PASS"
8184
currentScore=$((currentScore + 1))

0 commit comments

Comments
 (0)