tests/chrootless: make sure that nothing outside the chroot changes
This commit is contained in:
parent
e62f32b098
commit
dc5bbb7173
1 changed files with 6 additions and 0 deletions
|
@ -3,6 +3,7 @@ set -eu
|
|||
export LC_ALL=C.UTF-8
|
||||
export SOURCE_DATE_EPOCH={{ SOURCE_DATE_EPOCH }}
|
||||
trap "rm -f /tmp/chrootless.tar /tmp/root.tar" EXIT INT TERM
|
||||
before=$(tar --one-file-system --anchored --exclude="./var/log/journal/*" --exclude=./var/log/wtmp -C / -c ./usr ./bin ./etc ./lib ./sbin ./var | md5sum)
|
||||
for INCLUDE in '' 'apt' 'apt,build-essential' 'systemd-sysv'; do
|
||||
for MODE in root chrootless; do
|
||||
{{ CMD }} --mode=$MODE --variant={{ VARIANT }} \
|
||||
|
@ -12,3 +13,8 @@ for INCLUDE in '' 'apt' 'apt,build-essential' 'systemd-sysv'; do
|
|||
cmp /tmp/root.tar /tmp/chrootless.tar || diffoscope /tmp/root.tar /tmp/chrootless.tar
|
||||
rm /tmp/chrootless.tar /tmp/root.tar
|
||||
done
|
||||
after=$(tar --one-file-system --anchored --exclude="./var/log/journal/*" --exclude=./var/log/wtmp -C / -c ./usr ./bin ./etc ./lib ./sbin ./var | md5sum)
|
||||
if [ "$before" != "$after" ]; then
|
||||
echo "found changes outside the chroot" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue