summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-06-18 13:05:35 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-06-18 15:33:10 +0100
commitd7c9c6a0d926982b64d13949a5da580ea4ecc4b6 (patch)
treeca0f273a0850495a02da4226bed4bc73f378afb4
parent39df80dcc0e485e69048bddbf33c259ce532e50d (diff)
downloadlibguestfs-d7c9c6a0d926982b64d13949a5da580ea4ecc4b6.tar.gz
libguestfs-d7c9c6a0d926982b64d13949a5da580ea4ecc4b6.tar.xz
libguestfs-d7c9c6a0d926982b64d13949a5da580ea4ecc4b6.zip
fuse: Skip 'truncate' tests if this command is missing.
-rwxr-xr-xfuse/test-fuse.sh21
1 files 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