coverage.sh: test xattr support

When creating a tarball: --xattrs
When extracting a tarball: --xattrs --xattrs-include='*'
This commit is contained in:
Johannes 'josch' Schauer 2020-01-03 16:02:35 +01:00
parent a4b070e4dc
commit 647e7e37f1
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1
2 changed files with 16 additions and 3 deletions

View file

@ -108,10 +108,10 @@ export SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH
$CMD --variant=$variant --mode=$defaultmode $dist /tmp/debian-$dist-mm.tar $mirror
mkdir /tmp/debian-$dist-mm
tar -C /tmp/debian-$dist-mm -xf /tmp/debian-$dist-mm.tar
tar --xattrs --xattrs-include='*' -C /tmp/debian-$dist-mm -xf /tmp/debian-$dist-mm.tar
mkdir /tmp/debian-$dist-debootstrap
tar -C /tmp/debian-$dist-debootstrap -xf "cache/debian-$dist-$variant.tar"
tar --xattrs --xattrs-include='*' -C /tmp/debian-$dist-debootstrap -xf "cache/debian-$dist-$variant.tar"
# diff cannot compare device nodes, so we use tar to do that for us and then
# delete the directory
@ -191,6 +191,19 @@ if [ "$variant" = "-" ]; then
rm /tmp/debian-$dist-mm/etc/machine-id
rm /tmp/debian-$dist-debootstrap/var/lib/systemd/catalog/database
rm /tmp/debian-$dist-mm/var/lib/systemd/catalog/database
cap=\$(chroot /tmp/debian-$dist-debootstrap /sbin/getcap /bin/ping)
if [ "\$cap" != "/bin/ping = cap_net_raw+ep" ]; then
echo "expected bin/ping to have capabilities cap_net_raw+ep" >&2
echo "but debootstrap produced: \$cap"
exit 1
fi
cap=\$(chroot /tmp/debian-$dist-mm /sbin/getcap /bin/ping)
if [ "\$cap" != "/bin/ping = cap_net_raw+ep" ]; then
echo "expected bin/ping to have capabilities cap_net_raw+ep" >&2
echo "but mmdebstrap produced: \$cap"
exit 1
fi
fi
rm /tmp/debian-$dist-mm/var/cache/apt/archives/lock
rm /tmp/debian-$dist-mm/var/lib/apt/extended_states

View file

@ -393,7 +393,7 @@ set -eu
export LC_ALL=C.UTF-8
export SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH
debootstrap --no-merged-usr --variant=$variant $dist /tmp/debian-$dist-debootstrap $mirror
tar --sort=name --mtime=@$SOURCE_DATE_EPOCH --clamp-mtime --numeric-owner --one-file-system -C /tmp/debian-$dist-debootstrap -c . > "$newcache/debian-$dist-$variant.tar"
tar --sort=name --mtime=@$SOURCE_DATE_EPOCH --clamp-mtime --numeric-owner --one-file-system --xattrs -C /tmp/debian-$dist-debootstrap -c . > "$newcache/debian-$dist-$variant.tar"
rm -r /tmp/debian-$dist-debootstrap
END
if [ "$HAVE_QEMU" = "yes" ]; then