lxc-test-unpriv revision 7059802cf0653d94236a78793a407cf02ff378a9
a34684a59b60a4173c25035d0c627ef17e6dc215rpluem# lxc: linux Container library
1337c7673efc1f80f634139fbad7cbb98a0dc657ylavic# Serge Hallyn <serge.hallyn@ubuntu.com>
4da61833a1cbbca94094f9653fd970582b97a72etrawick# This is a test script for unprivileged containers
4da61833a1cbbca94094f9653fd970582b97a72etrawick# This library is free software; you can redistribute it and/or
4da61833a1cbbca94094f9653fd970582b97a72etrawick# modify it under the terms of the GNU Lesser General Public
4da61833a1cbbca94094f9653fd970582b97a72etrawick# License as published by the Free Software Foundation; either
4789804be088bcd86ae637a29cdb7fda25169521jailletc# version 2.1 of the License, or (at your option) any later version.
4789804be088bcd86ae637a29cdb7fda25169521jailletc# This library is distributed in the hope that it will be useful,
4789804be088bcd86ae637a29cdb7fda25169521jailletc# but WITHOUT ANY WARRANTY; without even the implied warranty of
e50c3026198fd496f183cda4c32a202925476778covener# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
e50c3026198fd496f183cda4c32a202925476778covener# Lesser General Public License for more details.
5b88c8507d5ef6d0c4cfbc78230294968175b638minfrin# You should have received a copy of the GNU Lesser General Public
5b88c8507d5ef6d0c4cfbc78230294968175b638minfrin# License along with this library; if not, write to the Free Software
6c3b9cebb551140fbb25d58bae08b539b3802133ylavic# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
4f29b65ab4b547ad5dbe506e2d0ff5d12ead9247ylavic echo 'run as root'
0a0df13b7f1f4f1a74fe295253d89ca3911b301aylavicwhich newuidmap >/dev/null 2>&1 || { echo "'newuidmap' command is missing" >&2; exit 1; }
506bfe33206b2fece40ef25f695af39dd4130facjkaluza sed -i '/lxcunpriv/d' /var/run/lxc/nics /etc/lxc/lxc-usernet
17e6c95f3b22d18acdf8380fb26a8d0e10c80767ylavic if [ $DONE -eq 0 ]; then
330e16bea8fe9cace4de90c349750c03dfb1fe64ylavic sudo -i -u $TUSER env XDG_RUNTIME_DIR=/run/user/$(id -u $TUSER) $*
330e16bea8fe9cace4de90c349750c03dfb1fe64ylavic# create a test user
032982212dbcc7c3cce95bf89c503bb56e185ac7kbrandlxc.network.type = veth
032982212dbcc7c3cce95bf89c503bb56e185ac7kbrandlxc.network.link = lxcbr0
caad2986f81ab263f7af41467dd622dc9add17f3ylaviclxc.id_map = u 0 910000 9999
caad2986f81ab263f7af41467dd622dc9add17f3ylaviclxc.id_map = g 0 910000 9999
0b67eb8568cd58bb77082703951679b42cf098actrawickrun_cmd lxc-create -t download -n c1 -- -d ubuntu -r trusty -a i386
5ef3c61605a3a021ff71f488983cb0065f8e1a79covener[ "$p1" != "-1" ] || { echo "Failed to start container c1"; false; }