]> arthur.barton.de Git - bup.git/blobdiff - t/test-fuse.sh
midx-cmd: accommodate python 3
[bup.git] / t / test-fuse.sh
index 36ebfe54a6712ad3bb31a8c290243d363ca6abe5..1732d66f2b3c4b71de209e8dd335adf3ef787df8 100755 (executable)
@@ -6,6 +6,8 @@ set -o pipefail
 
 unset BLOCKSIZE BLOCK_SIZE DF_BLOCK_SIZE
 
+root_status="$(t/root-status)" || exit $?
+
 if ! bup-python -c 'import fuse' 2> /dev/null; then
     WVSTART 'unable to import fuse; skipping test'
     exit 0
@@ -21,7 +23,7 @@ if ! fusermount -V; then
     exit 0
 fi
 
-if ! groups | grep -q fuse && test "$(t/root-status)" != root; then
+if ! groups | grep -q fuse && test "$root_status" != root; then
     echo 'skipping FUSE tests: you are not root and not in the fuse group'
     exit 0
 fi
@@ -42,6 +44,8 @@ savename()
        print strftime('%Y-%m-%d-%H%M%S', localtime($secs))"
 }
 
+export TZ=UTC
+
 WVPASS bup init
 WVPASS cd "$tmpdir"
 
@@ -91,12 +95,12 @@ WVPASS fusermount -uz mnt
 
 WVSTART "extended metadata"
 WVPASS bup fuse --meta mnt
-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 1
--rw-r--r-- 1 $user $group 8 Nov 11  2011 foo
--rw-r--r-- 1 $user $group 8 Jan  1  1970 pre-epoch"
+result="$(stat --format='%A %U %G %x' mnt/src/latest/foo)"
+WVPASSEQ "$result" "-rw-r--r-- $user $group 2011-11-11 11:11:00.000000000 +0000"
+result="$(stat --format='%A %U %G %x' mnt/src/latest/pre-epoch)"
+WVPASSEQ "$result" "-rw-r--r-- $user $group 1970-01-01 00:00:00.000000000 +0000"
 
 WVPASS fusermount -uz mnt
 WVPASS rm -rf "$tmpdir"