2
0
mirror of git://github.com/lxc/lxc synced 2025-09-03 21:49:34 +00:00

test: use busybox in lxc-test-apparmor-generated

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner
2021-08-16 17:33:59 +02:00
parent fd0349a7a0
commit acd792c965

View File

@@ -24,7 +24,6 @@ fi
exit 0 exit 0
DONE=0 DONE=0
KNOWN_RELEASES="precise trusty xenial yakkety zesty"
LOGFILE="/tmp/lxc-test-$$.log" LOGFILE="/tmp/lxc-test-$$.log"
cleanup() { cleanup() {
lxc-destroy -n $CONTAINER_NAME >/dev/null 2>&1 || true lxc-destroy -n $CONTAINER_NAME >/dev/null 2>&1 || true
@@ -39,29 +38,13 @@ cleanup() {
echo "PASS" echo "PASS"
} }
ARCH=i386
if type dpkg >/dev/null 2>&1; then
ARCH=$(dpkg --print-architecture)
fi
trap cleanup EXIT HUP INT TERM trap cleanup EXIT HUP INT TERM
set -eu set -eu
# Create a container # Create a container
CONTAINER_NAME=lxc-test-apparmor-generated CONTAINER_NAME=lxc-test-apparmor-generated
# default release is trusty, or the systems release if recognized lxc-create -t busybox -n $CONTAINER_NAME -B dir
release=trusty
if [ -f /etc/lsb-release ]; then
. /etc/lsb-release
rels=$(ubuntu-distro-info --supported 2>/dev/null) ||
rels="$KNOWN_RELEASES"
for r in $rels; do
[ "$DISTRIB_CODENAME" = "$r" ] && release="$r"
done
fi
lxc-create -t download -n $CONTAINER_NAME -B dir -- -d ubuntu -r $release -a $ARCH
CONTAINER_PATH=$(dirname $(lxc-info -n $CONTAINER_NAME -c lxc.rootfs.path -H) | sed -e 's/dir://') CONTAINER_PATH=$(dirname $(lxc-info -n $CONTAINER_NAME -c lxc.rootfs.path -H) | sed -e 's/dir://')
cp $CONTAINER_PATH/config $CONTAINER_PATH/config.bak cp $CONTAINER_PATH/config $CONTAINER_PATH/config.bak