From d69584882ff88148ae4d49738f7e8602548c3b75 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 26 Jul 2023 15:53:56 -0500 Subject: [PATCH] Skip sparse tests on filesystems that can't handle 4k granularity sparse files. --- tests/tar.test | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/tar.test b/tests/tar.test index e6487bd7..e967b706 100755 --- a/tests/tar.test +++ b/tests/tar.test @@ -231,8 +231,10 @@ toyonly testing "autodetect falls back to gzip -d when no zcat" \ "PATH=path; tar tf $FILES/tar/tar.tgz" "dir/\ndir/file\n" "" "" rm -rf path -# Tests that don't produce the same results on MacOS X as Linux -[ "$(uname)" == Darwin ] && SKIP=999 +# Only run sparse tests if filesystem can handle sparse files @4k granularity +dd if=/dev/zero bs=4k count=1 seek=1 of=blah.img 2>/dev/null +[ $(du blah.img | sed 's/[ \t].*//') -ne 4 ] && SKIP=999 +rm -f blah.img yes | head -n $((1<<18)) > bang { @@ -277,7 +279,7 @@ rm -rf path "807664bcad0e827793318ff742991d6f006b2127\n" "" "" rm fweep2 fweep2.tar -SKIP=0 # End of tests that don't work on MacOS X +SKIP=0 # End of sparse tests mkdir -p links touch links/orig -- 2.39.2