coverage.sh: the output of getcap differs depending on the version

This commit is contained in:
Johannes 'josch' Schauer 2021-01-06 11:19:15 +01:00
parent e9e5f15f61
commit 0dc8321094
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -268,14 +268,18 @@ if [ "$variant" = "-" ]; then
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
expected="/bin/ping cap_net_raw=ep"
if [ "$dist" = stable ]; then
expected="/bin/ping = cap_net_raw+ep"
fi
if [ "\$cap" != "\$expected" ]; then
echo "expected bin/ping to have capabilities \$expected" >&2
echo "but debootstrap produced: \$cap" >&2
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
if [ "\$cap" != "\$expected" ]; then
echo "expected bin/ping to have capabilities \$expected" >&2
echo "but mmdebstrap produced: \$cap" >&2
exit 1
fi