From 2ccd025a259f615c622f18acefcb933ad4352339 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Wed, 2 Dec 2020 00:44:57 +0100 Subject: [PATCH] coverage.sh: don't execute test modifying /etc/hosts without qemu --- coverage.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/coverage.sh b/coverage.sh index 1f2bacb..dcb6655 100755 --- a/coverage.sh +++ b/coverage.sh @@ -1412,6 +1412,10 @@ cat << END > shared/test.sh #!/bin/sh set -eu 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 $CMD --mode=$defaultmode --variant=apt $DEFAULT_DIST /tmp/debian-chroot.tar tar -tf /tmp/debian-chroot.tar | sort | diff -u tar1.txt - @@ -1420,12 +1424,9 @@ END if [ "$HAVE_QEMU" = "yes" ]; then ./run_qemu.sh runtests=$((runtests+1)) -elif [ "$defaultmode" = "root" ]; then - ./run_null.sh SUDO - runtests=$((runtests+1)) else - ./run_null.sh - runtests=$((runtests+1)) + echo "HAVE_QEMU != yes -- Skipping test..." >&2 + skipped=$((skipped+1)) fi print_header "mode=$defaultmode,variant=apt: invalid mirror"