From d4646fd8b07d6a368fe7ea62ef6e85df2a67a44d Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Thu, 26 Sep 2019 23:32:52 +0200 Subject: [PATCH] coverage.sh: add test for i386 on amd64 without qemu --- coverage.sh | 46 +++++++++++++++++++++++++++++++++++++++++++++- make_mirror.sh | 13 ++++++++----- 2 files changed, 53 insertions(+), 6 deletions(-) diff --git a/coverage.sh b/coverage.sh index 4420bc9..cb4eebc 100755 --- a/coverage.sh +++ b/coverage.sh @@ -48,7 +48,7 @@ if [ ! -e shared/mmdebstrap ] || [ mmdebstrap -nt shared/mmdebstrap ]; then fi starttime= -total=101 +total=102 i=1 print_header() { @@ -725,6 +725,50 @@ else echo "HAVE_QEMU != yes -- Skipping test..." 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 # - is not part of the native installation set # - does not have any dependencies diff --git a/make_mirror.sh b/make_mirror.sh index 2b9fa6c..b747ee6 100755 --- a/make_mirror.sh +++ b/make_mirror.sh @@ -43,10 +43,9 @@ newmirrordir="$newcachedir/debian" mirror="http://deb.debian.org/debian" security_mirror="http://security.debian.org/debian-security" -arch1=$(dpkg --print-architecture) -arch2=armhf -if [ "$arch1" = "$arch2" ]; then - arch2=amd64 +if [ "$(dpkg --print-architecture)" != amd64 ]; then + echo "script only supports being run on amd64" >&2 + exit 1 fi components=main @@ -245,8 +244,12 @@ END 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 + # only store non-amd64 architectures for $DEFAULT_DIST + if [ $nativearch != amd64 ] && [ $DEFAULT_DIST != $dist ]; then + continue + fi cat << END | update_cache "$dist" "$nativearch" deb [arch=$nativearch] $mirror $dist $components END