1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
#!/bin/sh
# Copyright 2022 Simon McVittie
# SPDX-License-Identifier: GPL-2.0-or-later
set -eu
if dpkg-vendor --is ubuntu; then
vendor=${vendor:-ubuntu}
suite=${suite:-$(ubuntu-distro-info --latest)}
else
# default to Debian
vendor=${vendor:-debian}
suite=${suite:-testing}
fi
arch="$(dpkg --print-architecture)"
sudoify () {
if [ "$(id -u)" = 0 ]; then
"$@"
else
sudo -n "$@"
fi
}
if [ -z "${AUTOPKGTEST_TEST_UNINSTALLED-}" ]; then
export AUTOPKGTEST_TEST_INSTALLED=yes
build_lxc=autopkgtest-build-lxc
else
build_lxc=tools/autopkgtest-build-lxc
fi
if ! sudoify "$build_lxc" "$vendor" "$suite" "$arch"; then
echo "SKIP: Unable to build autopkgtest-$suite-$arch container"
exit 77
fi
export AUTOPKGTEST_TEST_LXC="autopkgtest-$suite-$arch"
# Wrapping the test in annotate-output helps to distinguish the output of
# the autopkgtest that is running these tests from the output of the
# autopkgtest that is under test.
exec annotate-output ./tests/autopkgtest LxcRunner
|