Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
a87e4d01
Commit
a87e4d01
authored
Dec 29, 2016
by
Stéphane Graber
Committed by
GitHub
Dec 29, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1365 from brauner/2016-12-25/skip_test_on_broken_overlayfs_symlinks
tests: skip unpriv tests on broken overlay module
parents
64fa2483
90e4eead
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
lxc-test-unpriv
src/tests/lxc-test-unpriv
+35
-0
No files found.
src/tests/lxc-test-unpriv
View file @
a87e4d01
...
@@ -27,6 +27,41 @@ if [ $(id -u) -ne 0 ]; then
...
@@ -27,6 +27,41 @@ if [ $(id -u) -ne 0 ]; then
echo
"ERROR: Must run as root."
echo
"ERROR: Must run as root."
exit
1
exit
1
fi
fi
# Test if we're using an overlayfs module that handles symlinks correctly. If
# not, we skip these tests since overlay clones will not work correctly.
if
modprobe
-q
overlayfs
;
then
TMPDIR
=
$(
mktemp
-d
)
MOUNTDIR
=
"
${
TMPDIR
}
/ovl_symlink_test"
mkdir
${
MOUNTDIR
}
mount
-t
tmpfs none
${
MOUNTDIR
}
mkdir
"
${
MOUNTDIR
}
/lowerdir"
"
${
MOUNTDIR
}
/upperdir"
"
${
MOUNTDIR
}
/overlayfs"
mount
-t
overlayfs
-o
lowerdir
=
"
${
MOUNTDIR
}
/lowerdir"
,upperdir
=
"
${
MOUNTDIR
}
/upperdir"
none
"
${
MOUNTDIR
}
/overlayfs"
CORRECT_LINK_TARGET
=
"
${
MOUNTDIR
}
/overlayfs/dummy_file"
exec
9>
"
${
CORRECT_LINK_TARGET
}
"
DETECTED_LINK_TARGET
=
$(
readlink
-q
/proc/
$$
/fd/9
)
# cleanup
exec
9>&-
umount
"
${
MOUNTDIR
}
/overlayfs"
umount
${
MOUNTDIR
}
rmdir
${
MOUNTDIR
}
# This overlay module does not correctly handle symlinks, so skip the
# tests.
if
[
"
${
DETECTED_LINK_TARGET
}
"
!=
"
${
CORRECT_LINK_TARGET
}
"
]
;
then
exit
0
fi
fi
which newuidmap
>
/dev/null 2>&1
||
{
echo
"'newuidmap' command is missing"
>
&2
;
exit
1
;
}
which newuidmap
>
/dev/null 2>&1
||
{
echo
"'newuidmap' command is missing"
>
&2
;
exit
1
;
}
DONE
=
0
DONE
=
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment