From 647e7e37f1615ab8b8f2050718a3d06a9f7c71a6 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Fri, 3 Jan 2020 16:02:35 +0100 Subject: [PATCH] coverage.sh: test xattr support When creating a tarball: --xattrs When extracting a tarball: --xattrs --xattrs-include='*' --- coverage.sh | 17 +++++++++++++++-- make_mirror.sh | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/coverage.sh b/coverage.sh index 8e7fbc0..8bf743b 100755 --- a/coverage.sh +++ b/coverage.sh @@ -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 diff --git a/make_mirror.sh b/make_mirror.sh index cad8f3e..6c04e7e 100755 --- a/make_mirror.sh +++ b/make_mirror.sh @@ -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