lxc-test-usernic revision 250b1eec71b074acdff1c5f6b5a1f0d7d2c20b77
# lxc: linux Container library
# Authors:
# Serge Hallyn <serge.hallyn@ubuntu.com>
#
# This is a test script for the lxc-user-nic program
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
# there is no conffile, so we have no permissions
if [ $? -eq 0 ]; then
echo "Fail: empty conffile should not allow me a nic"
exit 1
fi
$(id -un) veth lxcbr0 1
EOF
# Should be allowed one but not two
if [ $? -ne 0 ]; then
echo "Failed to get one allowed nic"
exit 1
fi
if [ $? -eq 0 ]; then
echo "Fail: was able to get a second nic"
exit 1
fi
# now remove the 'existing nic' and make sure we're allowed to create
# a new one
if [ $? -ne 0 ]; then
echo "Fail: was unable to get a replacement nic"
exit 1
fi
echo "All tests passed"