2
0
mirror of git://github.com/lxc/lxc synced 2025-08-31 12:19:39 +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
DONE=0
KNOWN_RELEASES="precise trusty xenial yakkety zesty"
LOGFILE="/tmp/lxc-test-$$.log"
cleanup() {
lxc-destroy -n $CONTAINER_NAME >/dev/null 2>&1 || true
@@ -39,29 +38,13 @@ cleanup() {
echo "PASS"
}
ARCH=i386
if type dpkg >/dev/null 2>&1; then
ARCH=$(dpkg --print-architecture)
fi
trap cleanup EXIT HUP INT TERM
set -eu
# Create a container
CONTAINER_NAME=lxc-test-apparmor-generated
# default release is trusty, or the systems release if recognized
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
lxc-create -t busybox -n $CONTAINER_NAME -B 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