coverage.sh: add test for copy:// and file:// mirrors

This commit is contained in:
Johannes 'josch' Schauer 2019-09-26 23:25:05 +02:00
parent 46eb9cdc5d
commit c8b9a2ed96
Signed by: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -48,7 +48,7 @@ if [ ! -e shared/mmdebstrap ] || [ mmdebstrap -nt shared/mmdebstrap ]; then
fi fi
starttime= starttime=
total=95 total=97
i=1 i=1
print_header() { print_header() {
@ -561,6 +561,40 @@ else
./run_null.sh ./run_null.sh
fi fi
print_header "mode=$defaultmode,variant=apt: copy:// mirror"
cat << END > shared/test.sh
#!/bin/sh
set -eu
export LC_ALL=C.UTF-8
$CMD --mode=$defaultmode --variant=apt $DEFAULT_DIST /tmp/debian-chroot.tar "deb copy:///mnt/cache/debian unstable main"
tar -tf /tmp/debian-chroot.tar | sort | diff -u tar1.txt -
rm /tmp/debian-chroot.tar
END
if [ "$HAVE_QEMU" = "yes" ]; then
./run_qemu.sh
else
echo "HAVE_QEMU != yes -- Skipping test..."
fi
print_header "mode=$defaultmode,variant=apt: fail with file:// mirror"
cat << END > shared/test.sh
#!/bin/sh
set -eu
export LC_ALL=C.UTF-8
ret=0
$CMD --mode=$defaultmode --variant=apt $DEFAULT_DIST /tmp/debian-chroot.tar "deb file:///mnt/cache/debian unstable main" || ret=\$?
rm /tmp/debian-chroot.tar
if [ "\$ret" = 0 ]; then
echo expected failure but got exit \$ret
exit 1
fi
END
if [ "$HAVE_QEMU" = "yes" ]; then
./run_qemu.sh
else
echo "HAVE_QEMU != yes -- Skipping test..."
fi
print_header "mode=$defaultmode,variant=apt: mirror is deb..." print_header "mode=$defaultmode,variant=apt: mirror is deb..."
cat << END > shared/test.sh cat << END > shared/test.sh
#!/bin/sh #!/bin/sh