mmdebstrap/tests/keyring-overwrites

18 lines
615 B
Text
Raw Normal View History

2022-05-25 14:02:09 +00:00
#!/bin/sh
set -eu
export LC_ALL=C.UTF-8
mkdir -p /tmp/emptydir
touch /tmp/emptyfile
# this overwrites the apt keyring options and should fail
ret=0
{{ CMD }} --mode=root --variant=apt --keyring=/tmp/emptydir --keyring=/tmp/emptyfile {{ DIST }} /tmp/debian-chroot "deb {{ MIRROR }} {{ DIST }} main" || ret=$?
# make sure that no [signedby=...] managed to make it into the sources.list
echo "deb {{ MIRROR }} {{ DIST }} main" | cmp /tmp/debian-chroot/etc/apt/sources.list -
rm -r /tmp/debian-chroot
rmdir /tmp/emptydir
rm /tmp/emptyfile
if [ "$ret" = 0 ]; then
echo expected failure but got exit $ret >&2
exit 1
fi