lxc-test-autostart revision b7aa56b85ca96f321ef6aadb60a28f8c16bec44d
# lxc: linux Container library
# Authors:
# Stéphane Graber <stgraber@ubuntu.com>
#
# This is a test script for lxc-autostart
# 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
DONE=0
lxc-destroy -n $CONTAINER_NAME >/dev/null 2>&1 || true
echo "FAIL"
exit 1
fi
echo "PASS"
}
ARCH=$(dpkg --print-architecture)
fi
set -eu
# Create a container
# Ensure it's not in lxc-autostart
(echo "Container shouldn't be auto-started" && exit 1)
# Mark it as auto-started and re-check
(echo "Container should be auto-started" && exit 1)
# Put it in a test group and set a delay
# Check that everything looks good
echo "Invalid autostart setting" && exit 1
fi
# Start it
sleep 5
# Restart it
sleep 5
# Shut it down
# Kill it
DONE=1