#!/bin/sh # run upstream system integration tests via mkosi set -e set -x RELEASE=$( . /etc/os-release; if [ "$ID" = "ubuntu" ]; then echo "$VERSION_CODENAME" elif [ "$ID" = "debian" ]; then if [ -n "$VERSION_ID" ] && [ -n "$VERSION_CODENAME" ]; then echo "$VERSION_CODENAME" else debian_version="$(cat /etc/debian_version)" if [ "${debian_version#*/}" = sid ]; then if [ "$VERSION_CODENAME" = sid ] || grep -q -r sid /etc/apt/sources.list* || grep -q -r unstable /etc/apt/sources.list*; then echo "unstable" else echo "$VERSION_CODENAME" fi fi fi fi ) cleanup () { if [ -f "${workdir}/btrfs/build/meson-logs/testlog.txt" ]; then cp "${workdir}/btrfs/build/meson-logs/testlog.txt" "$AUTOPKGTEST_ARTIFACTS" fi if [ -d "${workdir}/btrfs/build/test/journal" ]; then cp -r "${workdir}/btrfs/build/test/journal" "$AUTOPKGTEST_ARTIFACTS" fi if [ -n "$workdir" ]; then umount "$workdir/btrfs" || true losetup --detach "$loop" || true rm -rf "$workdir" fi } # apparmor is not compatible with swtpm aa-teardown >/dev/null 2>&1 || true # we need user namespaces for some tests running in nspawn sysctl -we kernel.apparmor_restrict_unprivileged_unconfined=0 sysctl -we kernel.apparmor_restrict_unprivileged_userns=0 mkdir -p /run/systemd/resolved.conf.d/ tee /run/systemd/resolved.conf.d/dns.conf <