From d7c9c6a0d926982b64d13949a5da580ea4ecc4b6 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 18 Jun 2012 13:05:35 +0100 Subject: fuse: Skip 'truncate' tests if this command is missing. --- fuse/test-fuse.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/fuse/test-fuse.sh b/fuse/test-fuse.sh index 517222a4..3dac2336 100755 --- a/fuse/test-fuse.sh +++ b/fuse/test-fuse.sh @@ -208,15 +208,18 @@ chmod a+r new rm -f new stage Checking truncate -truncate -s 10000 truncated -[ "$(stat -c %s truncated)" -eq 10000 ] -truncate -c -s 1000 truncated -[ "$(stat -c %s truncated)" -eq 1000 ] -truncate -c -s 10 truncated -[ "$(stat -c %s truncated)" -eq 10 ] -truncate -c -s 0 truncated -[ "$(stat -c %s truncated)" -eq 0 ] -rm -f truncated +# RHEL 5 didn't have the truncate command. +if truncate --help >/dev/null 2>&1; then + truncate -s 10000 truncated + [ "$(stat -c %s truncated)" -eq 10000 ] + truncate -c -s 1000 truncated + [ "$(stat -c %s truncated)" -eq 1000 ] + truncate -c -s 10 truncated + [ "$(stat -c %s truncated)" -eq 10 ] + truncate -c -s 0 truncated + [ "$(stat -c %s truncated)" -eq 0 ] + rm -f truncated +fi # Disabled because of RHBZ#660687 on Debian. # stage Checking utimens and timestamps -- cgit