coverage.sh: don't execute test modifying /etc/hosts without qemu

This commit is contained in:
Johannes 'josch' Schauer 2020-12-02 00:44:57 +01:00
parent 7c15185dfd
commit 2ccd025a25
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -1412,6 +1412,10 @@ cat << END > shared/test.sh
#!/bin/sh #!/bin/sh
set -eu set -eu
export LC_ALL=C.UTF-8 export LC_ALL=C.UTF-8
if [ ! -e /mmdebstrap-testenv ]; then
echo "this test modifies the system and should only be run inside a container" >&2
exit 1
fi
echo "127.0.0.1 deb.debian.org" >> /etc/hosts echo "127.0.0.1 deb.debian.org" >> /etc/hosts
$CMD --mode=$defaultmode --variant=apt $DEFAULT_DIST /tmp/debian-chroot.tar $CMD --mode=$defaultmode --variant=apt $DEFAULT_DIST /tmp/debian-chroot.tar
tar -tf /tmp/debian-chroot.tar | sort | diff -u tar1.txt - tar -tf /tmp/debian-chroot.tar | sort | diff -u tar1.txt -
@ -1420,12 +1424,9 @@ END
if [ "$HAVE_QEMU" = "yes" ]; then if [ "$HAVE_QEMU" = "yes" ]; then
./run_qemu.sh ./run_qemu.sh
runtests=$((runtests+1)) runtests=$((runtests+1))
elif [ "$defaultmode" = "root" ]; then
./run_null.sh SUDO
runtests=$((runtests+1))
else else
./run_null.sh echo "HAVE_QEMU != yes -- Skipping test..." >&2
runtests=$((runtests+1)) skipped=$((skipped+1))
fi fi
print_header "mode=$defaultmode,variant=apt: invalid mirror" print_header "mode=$defaultmode,variant=apt: invalid mirror"