]> arthur.barton.de Git - bup.git/blobdiff - t/test-fuse.sh
Rework write_sparsely() to fix in-buffer zero runs
[bup.git] / t / test-fuse.sh
index d3d78b744e9be6e4298df8cbf6e82dca02a40fef..c19918284cc30d2e401b81d2348b5b00a95c9c41 100755 (executable)
@@ -1,8 +1,15 @@
 #!/usr/bin/env bash
-. ./wvtest-bup.sh
+. ./wvtest-bup.sh || exit $?
 
 set -o pipefail
 
+unset BLOCKSIZE BLOCK_SIZE DF_BLOCK_SIZE
+
+if test -n "$(type -p modprobe)" && ! modprobe fuse; then
+    echo 'Unable to load fuse module; skipping dependent tests.' 1>&2
+    exit 0
+fi
+
 if ! fusermount -V; then
     echo 'skipping FUSE tests: fusermount does not appear to work'
     exit 0
@@ -30,12 +37,12 @@ savename1="$(printf '%(%Y-%m-%d-%H%M%S)T' "$savestamp1")" || exit $?
 savename2="$(printf '%(%Y-%m-%d-%H%M%S)T' "$savestamp2")" || exit $?
 
 WVPASS mkdir src
-WVPASS date > src/foo
+WVPASS echo content > src/foo
 WVPASS chmod 644 src/foo
 WVPASS touch -t 201111111111 src/foo
 # FUSE, python-fuse, something, can't handle negative epoch times.
 # Use pre-epoch to make sure bup properly "bottoms out" at 0 for now.
-WVPASS date > src/pre-epoch
+WVPASS echo content > src/pre-epoch
 WVPASS chmod 644 src/pre-epoch
 WVPASS touch -t 196907202018 src/pre-epoch
 WVPASS bup index src
@@ -67,12 +74,12 @@ WVPASS fusermount -uz mnt
 
 WVSTART "extended metadata"
 WVPASS bup fuse --meta mnt
-result=$(WVPASS ls -l mnt/src/latest/) || exit $?
+result=$(TZ=UTC LC_ALL=C WVPASS ls -l mnt/src/latest/) || exit $?
 readonly user=$(WVPASS id -un) || $?
 readonly group=$(WVPASS id -gn) || $?
 WVPASSEQ "$result" "total 0
--rw-r--r-- 1 $user $group 29 Nov 11  2011 foo
--rw-r--r-- 1 $user $group 29 Dec 31  1969 pre-epoch"
+-rw-r--r-- 1 $user $group 8 Nov 11  2011 foo
+-rw-r--r-- 1 $user $group 8 Jan  1  1970 pre-epoch"
 
 WVPASS fusermount -uz mnt
 WVPASS rm -rf "$tmpdir"