From: Pádraig Brady Date: Thu, 16 Apr 2026 17:35:26 +0000 (+0100) Subject: tests: avoid failure on older Centos 7 X-Git-Tag: v9.11~17 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=ad4a9fb82a2d3a7a89ade99ace6cec2a0366cdd5;p=thirdparty%2Fcoreutils.git tests: avoid failure on older Centos 7 * tests/cp/sparse-perf.sh: Old Centos 7 can give EINVAL from SEEK_DATA on sparse files being copied from /dev/shm. Avoid this failure as it's not practical to fix. --- diff --git a/tests/cp/sparse-perf.sh b/tests/cp/sparse-perf.sh index 2fa95deff1..3908958e92 100755 --- a/tests/cp/sparse-perf.sh +++ b/tests/cp/sparse-perf.sh @@ -18,6 +18,7 @@ . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src print_ver_ cp +getlimits_ cleanup_() { rm -rf "$other_partition_tmpdir"; } . "$abs_srcdir/tests/other-fs-tmpdir" @@ -30,7 +31,10 @@ truncate -s1M $other_partition_sparse || framework_failure_ # cp should not disable anything by default, even for sparse files. For e.g. # copy offload is an important performance improvement for sparse files on NFS. -cp --debug $other_partition_sparse k2 >cp.out || fail=1 +cp --debug $other_partition_sparse k2 >cp.out 2>cp.err; ret=$? +# Old Centos 7 or WSL 1 can give EINVAL erroneously +grep -F "$EINVAL" cp.err && skip_ 'received EINVAL when copying sparse file' +test "$ret" = 0 || { cat cp.err >&2; fail=1; } cmp $other_partition_sparse k2 || fail=1 grep ': avoided' cp.out && { cat cp.out; fail=1; }