lxc-test-apparmor-mount revision efdca59e498ce7a7ff0db091d7d2fec01a91b8ea
6357N/A# apparmor_mount: test proper handling of apparmor in kernels 6357N/A# These require the ubuntu lxc package to be installed. 6357N/A# This program is free software; you can redistribute it and/or 6357N/A# modify it under the terms of the GNU Lesser General Public 6357N/A# License as published by the Free Software Foundation; either 6357N/A# version 2.1 of the License, or (at your option) any later version. 6357N/A# This library is distributed in the hope that it will be useful, 6357N/A# but WITHOUT ANY WARRANTY; without even the implied warranty of 6357N/A# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 6357N/A# Lesser General Public License for more details. 6357N/A# You should have received a copy of the GNU Lesser General Public 6357N/A# License along with this library; if not, write to the Free Software 6357N/A# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6357N/A# This test assumes an Ubuntu host 6357N/A# Only run on a normally configured ubuntu lxc system 6357N/A echo "lxcbr0 is not configured." 6357N/A echo "ERROR: Must run as root." 6357N/A# This would be much simpler if we could run it as 6357N/A# root. However, in order to not have the bind mount 6357N/A# of an empty directory over the securitfs 'mount' directory 6357N/A# 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"