From 10c3d3e5f4358b59a8373999d0d11166c3cb29fb Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Sun, 16 Oct 2022 22:32:46 +0200 Subject: [PATCH] tests: output to stderr to prevent interleaving with set -x output --- tests/check-against-debootstrap-dist | 6 +++--- tests/create-arm64-tarball | 2 +- tests/i386-which-can-be-executed-without-qemu | 2 +- tests/tarfilter-idshift | 12 ++++++------ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/check-against-debootstrap-dist b/tests/check-against-debootstrap-dist index aad1cd7..95ce307 100644 --- a/tests/check-against-debootstrap-dist +++ b/tests/check-against-debootstrap-dist @@ -83,11 +83,11 @@ rm /tmp/debian-{{ DIST }}-mm/var/lib/dpkg/arch # thus we first check for equality and then remove the files chroot /tmp/debian-{{ DIST }}-debootstrap dpkg --list > dpkg1 chroot /tmp/debian-{{ DIST }}-mm dpkg --list > dpkg2 -diff -u dpkg1 dpkg2 +diff -u dpkg1 dpkg2 >&2 rm dpkg1 dpkg2 grep -v '^Priority: ' /tmp/debian-{{ DIST }}-debootstrap/var/lib/dpkg/status > status1 grep -v '^Priority: ' /tmp/debian-{{ DIST }}-mm/var/lib/dpkg/status > status2 -diff -u status1 status2 +diff -u status1 status2 >&2 rm status1 status2 rm /tmp/debian-{{ DIST }}-debootstrap/var/lib/dpkg/status /tmp/debian-{{ DIST }}-mm/var/lib/dpkg/status # debootstrap exposes the hosts's kernel version @@ -223,7 +223,7 @@ tar -C /tmp/debian-{{ DIST }}-debootstrap --numeric-owner --sort=name --clamp-mt tar -C /tmp/debian-{{ DIST }}-mm --numeric-owner --sort=name --clamp-mtime --mtime=$(date --utc --date=@{{ SOURCE_DATE_EPOCH }} --iso-8601=seconds) -cf /tmp/root2.tar . tar --full-time --verbose -tf /tmp/root1.tar > /tmp/root1.tar.list tar --full-time --verbose -tf /tmp/root2.tar > /tmp/root2.tar.list -diff -u /tmp/root1.tar.list /tmp/root2.tar.list +diff -u /tmp/root1.tar.list /tmp/root2.tar.list >&2 rm /tmp/root1.tar /tmp/root2.tar /tmp/root1.tar.list /tmp/root2.tar.list # check if file properties (permissions, ownership, symlink names, modification time) differ diff --git a/tests/create-arm64-tarball b/tests/create-arm64-tarball index 0b52d7b..d0e361e 100644 --- a/tests/create-arm64-tarball +++ b/tests/create-arm64-tarball @@ -39,5 +39,5 @@ $prefix {{ CMD }} --mode={{ MODE }} --variant=apt --architectures=arm64 {{ DIST | grep -v '^\./usr/share/doc/[^/]\+/changelog\(\.Debian\)\?\.amd64\.gz$' \ | grep -v '^\./usr/share/man/man8/i386\.8\.gz$' \ | grep -v '^\./usr/share/man/man8/x86_64\.8\.gz$'; -} | sort | diff -u - tar2.txt +} | sort | diff -u - tar2.txt >&2 rm /tmp/debian-chroot.tar diff --git a/tests/i386-which-can-be-executed-without-qemu b/tests/i386-which-can-be-executed-without-qemu index 5e964a6..936dd01 100644 --- a/tests/i386-which-can-be-executed-without-qemu +++ b/tests/i386-which-can-be-executed-without-qemu @@ -34,5 +34,5 @@ apt-get remove --yes qemu-user-static binfmt-support qemu-user | grep -v '^\./usr/share/doc/[^/]\+/changelog\(\.Debian\)\?\.amd64\.gz$' \ | grep -v '^\./usr/share/man/man8/i386\.8\.gz$' \ | grep -v '^\./usr/share/man/man8/x86_64\.8\.gz$'; -} | sort | diff -u - tar2.txt +} | sort | diff -u - tar2.txt >&2 rm /tmp/debian-chroot.tar diff --git a/tests/tarfilter-idshift b/tests/tarfilter-idshift index 303b093..67cef5e 100644 --- a/tests/tarfilter-idshift +++ b/tests/tarfilter-idshift @@ -20,7 +20,7 @@ runuser -u user -- {{ CMD }} --mode=unshare --variant=apt --include=iputils-ping mkdir /tmp/debian-chroot tar --xattrs --xattrs-include='*' --directory /tmp/debian-chroot -xf /tmp/debian-chroot.tar ./bin/ping echo "/tmp/debian-chroot/bin/ping cap_net_raw=ep" > /tmp/expected -getcap /tmp/debian-chroot/bin/ping | diff -u /tmp/expected - +getcap /tmp/debian-chroot/bin/ping | diff -u /tmp/expected - >&2 rm /tmp/debian-chroot/bin/ping rmdir /tmp/debian-chroot/bin rmdir /tmp/debian-chroot @@ -44,16 +44,16 @@ tar --numeric-owner -tvf /tmp/debian-chroot.tar \ > /tmp/debian-chroot.txt tar --numeric-owner -tvf /tmp/debian-chroot-shifted.tar \ | sed 's/ \+/ /g' \ - | diff -u /tmp/debian-chroot.txt - + | diff -u /tmp/debian-chroot.txt - >&2 mkdir /tmp/debian-chroot tar --xattrs --xattrs-include='*' --directory /tmp/debian-chroot -xf /tmp/debian-chroot-shifted.tar echo "100000 100000" > /tmp/expected -stat --format="%u %g" /tmp/debian-chroot/bin/ping | diff -u /tmp/expected - +stat --format="%u %g" /tmp/debian-chroot/bin/ping | diff -u /tmp/expected - >&2 echo "/tmp/debian-chroot/bin/ping cap_net_raw=ep" > /tmp/expected -getcap /tmp/debian-chroot/bin/ping | diff -u /tmp/expected - +getcap /tmp/debian-chroot/bin/ping | diff -u /tmp/expected - >&2 echo "0 0" > /tmp/expected runuser -u user -- {{ CMD }} --unshare-helper /usr/sbin/chroot /tmp/debian-chroot stat --format="%u %g" /bin/ping \ - | diff -u /tmp/expected - + | diff -u /tmp/expected - >&2 echo "/bin/ping cap_net_raw=ep" > /tmp/expected runuser -u user -- {{ CMD }} --unshare-helper /usr/sbin/chroot /tmp/debian-chroot getcap /bin/ping \ - | diff -u /tmp/expected - + | diff -u /tmp/expected - >&2