lxc-test-unpriv revision 8bb165038d60d59084c1fafee171948244f0f86a
86N/A# lxc: linux Container library 86N/A# Serge Hallyn <serge.hallyn@ubuntu.com> 86N/A# This is a test script for unprivileged containers 86N/A# This library is free software; you can redistribute it and/or 86N/A# modify it under the terms of the GNU Lesser General Public 86N/A# License as published by the Free Software Foundation; either 86N/A# version 2.1 of the License, or (at your option) any later version. 86N/A# This library is distributed in the hope that it will be useful, 86N/A# but WITHOUT ANY WARRANTY; without even the implied warranty of 86N/A# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 86N/A# Lesser General Public License for more details. 86N/A# You should have received a copy of the GNU Lesser General Public 86N/A# License along with this library; if not, write to the Free Software 2899N/A# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 86N/A# This test assumes an Ubuntu host 86N/A echo "ERROR: Must run as root." 844N/A# Test if we're using an overlayfs module that handles symlinks correctly. If 844N/A# not, we skip these tests since overlay clones will not work correctly. 86N/A mkdir "${MOUNTDIR}/lowerdir" "${MOUNTDIR}/upperdir" "${MOUNTDIR}/overlayfs" 2123N/A exec 9>
"${CORRECT_LINK_TARGET}" 86N/A # This overlay module does not correctly handle symlinks, so skip the 86N/A if [
"${DETECTED_LINK_TARGET}" !=
"${CORRECT_LINK_TARGET}" ];
then lxc.network.link = lxcbr0 lxc.id_map = u 0 910000 9999 lxc.id_map = g 0 910000 9999 # default release is trusty, or the systems release if recognized # Copy the download template cache if available # Make sure we can start it - twice [
"$p1" !=
"-1" ] ||
{ echo "Failed to start container c1 (run $count)"; false; }[
"$p1" !=
"-1" ] ||
{ echo "Failed to start container c2"; false; } echo "Testing containers under different cgroups per subsystem" [
"$p1" !=
"-1" ] ||
{ echo "Failed to start container c1"; false; } echo "Testing lxc-attach and lxc-cgroup from different cgroup"