From: Colin Walters Date: Mon, 12 Mar 2018 22:02:04 +0000 (-0400) Subject: tests: Avoid generating lots of output in itest-payload-link X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2~25^2~23 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=79fc506284bb4bfa7c8434a52f21229d05268790;p=ostree.git tests: Avoid generating lots of output in itest-payload-link We noticed this in a recent PR. While I'm here, also only do the `find` once, add `-type l` for good measure, and use our built in `libtest.sh` assertion functions. Closes: #1494 Approved by: giuseppe --- diff --git a/tests/installed/itest-payload-link.sh b/tests/installed/itest-payload-link.sh index a0764a07..807d497d 100755 --- a/tests/installed/itest-payload-link.sh +++ b/tests/installed/itest-payload-link.sh @@ -68,18 +68,17 @@ if cp --reflink a b; then ostree config --repo=repo set core.payload-link-threshold 0 ostree --repo=repo remote add origin --set=gpg-verify=false ${origin} ostree --repo=repo pull --disable-static-deltas origin ${host_nonremoteref} - if test `find repo -name '*.payload-link' | wc -l` = 0; then - fatal ".payload-link files not found" - fi + find repo -type l -name '*.payload-link' >payload-links.txt + assert_not_streq "$(wc -l < payload-links.txt)" "0" - find repo -name '*.payload-link' | while read i; - do + # Disable logging for inner loop, otherwise it'd be enormous + set +x + cat payload-links.txt | while read i; do payload_checksum=$(basename $(dirname $i))$(basename $i .payload-link) payload_checksum_calculated=$(sha256sum $(readlink -f $i) | cut -d ' ' -f 1) - if test $payload_checksum != $payload_checksum_calculated; then - fatal ".payload-link has the wrong checksum" - fi + assert_streq "${payload_checksum}" "${payload_checksum_calculated}" done + set -x echo "ok pull creates .payload-link" else echo "ok # SKIP no reflink support in the file system"