diff -Nru sbuild-0.81.2ubuntu4/debian/changelog sbuild-0.81.2ubuntu5/debian/changelog --- sbuild-0.81.2ubuntu4/debian/changelog 2021-03-01 11:02:26.000000000 +0000 +++ sbuild-0.81.2ubuntu5/debian/changelog 2021-03-18 07:38:02.000000000 +0000 @@ -1,3 +1,14 @@ +sbuild (0.81.2ubuntu5) hirsute; urgency=medium + + * debian/tests/control: Skip unshare-qemuwrapper test where linux-image-amd64 + is missing. It is missing in Ubuntu making the test fail. + * debian/tests/unshare: Run the test, but skip it if user namespaces are not + supported + * debian/tests/unshare-qemuwrapper: Drop delta + * debian/tests/unshare*: Test with current release + + -- Balint Reczey Thu, 18 Mar 2021 08:38:02 +0100 + sbuild (0.81.2ubuntu4) hirsute; urgency=medium * debian/tests/unshare-qemuwrapper: Don't use linux-image-amd64 package in diff -Nru sbuild-0.81.2ubuntu4/debian/tests/control sbuild-0.81.2ubuntu5/debian/tests/control --- sbuild-0.81.2ubuntu4/debian/tests/control 2021-02-25 17:50:10.000000000 +0000 +++ sbuild-0.81.2ubuntu5/debian/tests/control 2021-03-18 07:38:02.000000000 +0000 @@ -4,5 +4,10 @@ Tests: unshare-qemuwrapper Architecture: amd64 -Depends: mmdebstrap, qemu-system-x86, libguestfs-tools, sleepenh, openssh-client, grep-dctrl -Restrictions: allow-stderr needs-root +Depends: mmdebstrap, qemu-system-x86, libguestfs-tools, linux-image-amd64, sleepenh, openssh-client, grep-dctrl, lsb-release +Restrictions: allow-stderr needs-root skip-not-installable + +Tests: unshare +Architecture: amd64 +Depends: gnupg, sbuild, mmdebstrap, build-essential, uidmap, fakeroot, diffoscope, lsb-release +Restrictions: allow-stderr skippable diff -Nru sbuild-0.81.2ubuntu4/debian/tests/unshare sbuild-0.81.2ubuntu5/debian/tests/unshare --- sbuild-0.81.2ubuntu4/debian/tests/unshare 2021-01-31 14:34:54.000000000 +0000 +++ sbuild-0.81.2ubuntu5/debian/tests/unshare 2021-03-18 07:38:02.000000000 +0000 @@ -13,7 +13,16 @@ exit 1 fi +if ! grep -q '^1$' /proc/sys/kernel/unprivileged_userns_clone 2> /dev/null; then + echo "User namespace support is not enabled" >&2; + exit 77 +fi + nativearch=$(dpkg --print-architecture) +release=$(lsb_release -c -s) +if [ "$release" = "sid" ]; then + release="unstable" +fi mkdir -p "${AUTOPKGTEST_TMP}/gpghome" chmod 700 "${AUTOPKGTEST_TMP}/gpghome" @@ -69,12 +78,18 @@ } verify() { + verify_orig="${1+no}" + verify_deb="${1+no}" verify_src="${1+no}" verify_bin="${1+no}" - echo "verifying test-pkg_1.0.tar.xz" >&2 - verify_orig - echo "verifying test-pkg_1.0_all.deb" >&2 - verify_deb + if [ "$verify_bin" = "yes" ]; then + echo "verifying test-pkg_1.0.tar.xz" >&2 + verify_orig + fi + if [ "$verify_bin" = "yes" ]; then + echo "verifying test-pkg_1.0_all.deb" >&2 + verify_deb + fi # we shouldn't have to manually pass the keyring because the path is an # implementation detail of gnupg (it used to be named pubring.gpg in # the past) but dscverify ignores GNUPGHOME, see Debian bug #981008 @@ -156,7 +171,7 @@ END cat << END > "${AUTOPKGTEST_TMP}/test-pkg-1.0/debian/changelog" -test-pkg (1.0) unstable; urgency=low +test-pkg (1.0) ${release}; urgency=low * Entry. Closes: #12345 @@ -207,11 +222,16 @@ 3.0 (native) END -mmdebstrap --mode=unshare --variant=apt unstable "${AUTOPKGTEST_TMP}/chroot.tar" +mmdebstrap --mode=unshare --variant=apt ${release} "${AUTOPKGTEST_TMP}/chroot.tar" env --chdir="${AUTOPKGTEST_TMP}/test-pkg-1.0/" dpkg-buildpackage --build=full env --chdir="${AUTOPKGTEST_TMP}/test-pkg-1.0/" dpkg-buildpackage --target=clean -verify no yes + +if [ "$release" = unstable ]; then + verify yes yes no yes +else + verify no no no yes +fi # FIXME use installed sbuild @@ -235,14 +255,14 @@ --chroot="${AUTOPKGTEST_TMP}/chroot.tar" --chroot-mode=unshare \ --keyid="sbuild fake uploader " \ --source \ - --no-run-lintian --no-run-autopkgtest -d unstable test-pkg_1.0.dsc + --no-run-lintian --no-run-autopkgtest -d ${release} test-pkg_1.0.dsc verify no yes env --chdir="${AUTOPKGTEST_TMP}/test-pkg-1.0/" dpkg-source --build . env --chdir="${AUTOPKGTEST_TMP}" sbuild \ --chroot="${AUTOPKGTEST_TMP}/chroot.tar" --chroot-mode=unshare \ --keyid="sbuild fake uploader " \ - --no-run-lintian --no-run-autopkgtest -d unstable test-pkg_1.0.dsc + --no-run-lintian --no-run-autopkgtest -d ${release} test-pkg_1.0.dsc verify no yes diff -Nru sbuild-0.81.2ubuntu4/debian/tests/unshare-qemuwrapper sbuild-0.81.2ubuntu5/debian/tests/unshare-qemuwrapper --- sbuild-0.81.2ubuntu4/debian/tests/unshare-qemuwrapper 2021-03-01 11:02:22.000000000 +0000 +++ sbuild-0.81.2ubuntu5/debian/tests/unshare-qemuwrapper 2021-03-18 07:38:02.000000000 +0000 @@ -24,9 +24,11 @@ set -exu -EXTRA_DEPS=gnupg,sbuild,mmdebstrap,build-essential,uidmap,fakeroot,diffoscope +EXTRA_DEPS=gnupg,sbuild,mmdebstrap,build-essential,uidmap,fakeroot,diffoscope,lsb-release SCRIPT=./debian/tests/unshare +release=$(lsb_release -c -s) + [ -e debian/tests/control ] SOURCES="$(pwd)" @@ -133,12 +135,12 @@ SCRIPT chmod +x "$TMPDIR/setup.sh" -if [ ! -e "$TMPDIR/debian-unstable-host.tar" ]; then +if [ ! -e "$TMPDIR/debian-${release}-host.tar" ]; then mmdebstrap --variant=apt --mode=$MODE --verbose \ --setup-hook="$TMPDIR/setup.sh" \ - --include=openssh-server,systemd-sysv,ifupdown,netbase,isc-dhcp-client,udev,policykit-1,$EXTRA_DEPS \ + --include=openssh-server,systemd-sysv,ifupdown,netbase,isc-dhcp-client,udev,policykit-1,linux-image-amd64,$EXTRA_DEPS \ --customize-hook="$TMPDIR/customize.sh" \ - unstable "$TMPDIR/debian-unstable-host.tar" $aptsources + ${release} "$TMPDIR/debian-${release}-host.tar" $aptsources fi # use guestfish to prepare the host system @@ -155,7 +157,7 @@ part-disk /dev/sda mbr : \ mkfs ext2 /dev/sda1 : \ mount /dev/sda1 / : \ - tar-in "$TMPDIR/debian-unstable-host.tar" / : \ + tar-in "$TMPDIR/debian-${release}-host.tar" / : \ mkdir /build : \ copy-in "$SOURCES/." /build/ : \ upload /usr/lib/SYSLINUX/mbr.bin /mbr.bin : \ @@ -273,7 +275,7 @@ wait $QEMUPID # cleanup -for f in debian-unstable-host.tar id_rsa id_rsa.pub \ +for f in debian-${release}-host.tar id_rsa id_rsa.pub \ qemu.log host.img customize.sh setup.sh; do rm "$TMPDIR/$f" done