lxc-test-apparmor-mount revision 7aff4f43fd84b021db12b2ffed1a4aa1b4cf65ef
10656N/A# apparmor_mount: test proper handling of apparmor in kernels 10656N/A# These require the ubuntu lxc package to be installed. 10656N/A# This program is free software; you can redistribute it and/or 10656N/A# modify it under the terms of the GNU Lesser General Public 10656N/A# License as published by the Free Software Foundation; either 12605N/A# version 2.1 of the License, or (at your option) any later version. 10656N/A# This library is distributed in the hope that it will be useful, 10656N/A# but WITHOUT ANY WARRANTY; without even the implied warranty of 10656N/A# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10656N/A# Lesser General Public License for more details. 10656N/A# You should have received a copy of the GNU Lesser General Public 12605N/A# License along with this library; if not, write to the Free Software 12605N/A# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 10656N/A# This test assumes an Ubuntu host # Only run on a normally configured ubuntu lxc system echo "lxcbr0 is not configured." if [
"$(id -u)" !=
"0" ];
then echo "ERROR: Must run as root." # This would be much simpler if we could run it as # root. However, in order to not have the bind mount # of an empty directory over the securitfs 'mount' directory # be removed, we need to do this as non-root. lxc.network.link = lxcbr0 lxc.id_map = u 0 910000 9999 lxc.id_map = g 0 910000 9999 echo "test default confined container" if [
"x$profile" !=
"xlxc-container-default (enforce)" ];
then echo "FAIL: confined container was in profile $profile" echo "test regular unconfined container" if [
"x$profile" !=
"xunconfined" ];
then echo "FAIL: unconfined container was in profile $profile" echo "test default confined container" if [ -n
"$pid" -a
"$pid" !=
"-1" ];
then echo "FAIL: confined container started without mount restrictions" echo "test regular unconfined container" if [
"$pid" =
"-1" ];
then echo "FAIL: unconfined container failed to start without mount restrictions" if [
"x$profile" !=
"xunconfined" ];
then echo "FAIL: confined container was in profile $profile" if [
"$pid" =
"-1" ];
then echo "FAIL: excepted container failed to start without mount restrictions" if [
"x$profile" !=
"xlxc-container-default (enforce)" ];
then echo "FAIL: confined container was in profile $profile"