coverage.sh: add test for i386 on amd64 without qemu

This commit is contained in:
Johannes 'josch' Schauer 2019-09-26 23:32:52 +02:00
parent 70b33609ea
commit d4646fd8b0
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1
2 changed files with 53 additions and 6 deletions

View file

@ -48,7 +48,7 @@ if [ ! -e shared/mmdebstrap ] || [ mmdebstrap -nt shared/mmdebstrap ]; then
fi fi
starttime= starttime=
total=101 total=102
i=1 i=1
print_header() { print_header() {
@ -725,6 +725,50 @@ else
echo "HAVE_QEMU != yes -- Skipping test..." echo "HAVE_QEMU != yes -- Skipping test..."
fi fi
print_header "mode=$defaultmode,variant=apt: test i386 (which can be executed without qemu)"
cat << END > shared/test.sh
#!/bin/sh
set -eu
export LC_ALL=C.UTF-8
# remove qemu just to be sure
apt-get remove --yes qemu-user-static binfmt-support qemu-user
$CMD --mode=$defaultmode --variant=apt --architectures=i386 $DEFAULT_DIST /tmp/debian-chroot.tar $mirror
# we ignore differences between architectures by ignoring some files
# and renaming others
{ tar -tf /tmp/debian-chroot.tar \
| grep -v '^\./usr/bin/i386$' \
| grep -v '^\./lib/ld-linux\.so\.2$' \
| grep -v '^\./lib/i386-linux-gnu/ld-linux\.so\.2$' \
| grep -v '^\./usr/lib/gcc/i686-linux-gnu/$' \
| grep -v '^\./usr/lib/gcc/i686-linux-gnu/9/$' \
| grep -v '^\./usr/share/man/man8/i386\.8\.gz$' \
| grep -v '^\./usr/share/doc/[^/]\+/changelog\.Debian\.i386\.gz$' \
| sed 's/i386-linux-gnu/x86_64-linux-gnu/' \
| sed 's/i386/amd64/';
} | sort > tar2.txt
{ cat tar1.txt \
| grep -v '^\./usr/bin/i386$' \
| grep -v '^\./usr/bin/x86_64$' \
| grep -v '^\./lib64/$' \
| grep -v '^\./lib64/ld-linux-x86-64\.so\.2$' \
| grep -v '^\./usr/lib/gcc/x86_64-linux-gnu/$' \
| grep -v '^\./usr/lib/gcc/x86_64-linux-gnu/9/$' \
| grep -v '^\./lib/x86_64-linux-gnu/ld-linux-x86-64\.so\.2$' \
| grep -v '^\./lib/x86_64-linux-gnu/libmvec-2\.[0-9]\+\.so$' \
| grep -v '^\./lib/x86_64-linux-gnu/libmvec\.so\.1$' \
| grep -v '^\./usr/share/doc/[^/]\+/changelog\.Debian\.amd64\.gz$' \
| grep -v '^\./usr/share/doc/hostname/changelog\.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
rm /tmp/debian-chroot.tar
END
if [ "$HAVE_QEMU" = "yes" ]; then
./run_qemu.sh
else
echo "HAVE_QEMU != yes -- Skipping test..."
fi
# to test foreign architecture package installation we choose a package which # to test foreign architecture package installation we choose a package which
# - is not part of the native installation set # - is not part of the native installation set
# - does not have any dependencies # - does not have any dependencies

View file

@ -43,10 +43,9 @@ newmirrordir="$newcachedir/debian"
mirror="http://deb.debian.org/debian" mirror="http://deb.debian.org/debian"
security_mirror="http://security.debian.org/debian-security" security_mirror="http://security.debian.org/debian-security"
arch1=$(dpkg --print-architecture) if [ "$(dpkg --print-architecture)" != amd64 ]; then
arch2=armhf echo "script only supports being run on amd64" >&2
if [ "$arch1" = "$arch2" ]; then exit 1
arch2=amd64
fi fi
components=main components=main
@ -245,8 +244,12 @@ END
find "$rootdir" -depth -print0 | xargs -0 rmdir find "$rootdir" -depth -print0 | xargs -0 rmdir
} }
for nativearch in "$arch1" "$arch2"; do for nativearch in amd64 armhf i386; do
for dist in stable testing unstable; do for dist in stable testing unstable; do
# only store non-amd64 architectures for $DEFAULT_DIST
if [ $nativearch != amd64 ] && [ $DEFAULT_DIST != $dist ]; then
continue
fi
cat << END | update_cache "$dist" "$nativearch" cat << END | update_cache "$dist" "$nativearch"
deb [arch=$nativearch] $mirror $dist $components deb [arch=$nativearch] $mirror $dist $components
END END