coverage.sh: check that xattrs are set in the original tarball

This commit is contained in:
Johannes 'josch' Schauer 2020-08-15 18:05:59 +02:00
parent 7ec0e1b4e1
commit 8c467584f6
Signed by: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -530,6 +530,15 @@ sysctl -w kernel.unprivileged_userns_clone=1
# identical to a round trip through "taridshift X" and "taridshift -X"
runuser -u user -- $CMD --mode=unshare --variant=apt --include=iputils-ping $DEFAULT_DIST - $mirror \
| ./taridshift 0 > /tmp/debian-chroot.tar
# make sure that xattrs are set in the original tarball
mkdir /tmp/debian-chroot
tar --xattrs --xattrs-include='*' --directory /tmp/debian-chroot -xf /tmp/debian-chroot.tar ./bin/ping
echo "/tmp/debian-chroot/bin/ping cap_net_raw=ep" > expected
getcap /tmp/debian-chroot/bin/ping | diff -u expected -
rm /tmp/debian-chroot/bin/ping
rmdir /tmp/debian-chroot/bin
rmdir /tmp/debian-chroot
# shift the uid/gid forward by 100000 and backward by 100000
./taridshift 100000 < /tmp/debian-chroot.tar > /tmp/debian-chroot-shifted.tar
./taridshift -100000 < /tmp/debian-chroot-shifted.tar > /tmp/debian-chroot-shiftedback.tar
# the tarball before and after the roundtrip through taridshift should be bit