2 . ./wvtest-bup.sh || exit $?
6 unset BLOCKSIZE BLOCK_SIZE DF_BLOCK_SIZE
8 if test -n "$(type -p modprobe)" && ! modprobe fuse; then
9 echo 'Unable to load fuse module; skipping dependent tests.' 1>&2
13 if ! fusermount -V; then
14 echo 'skipping FUSE tests: fusermount does not appear to work'
18 if ! groups | grep -q fuse && test "$(t/root-status)" != root; then
19 echo 'skipping FUSE tests: you are not root and not in the fuse group'
23 top="$(WVPASS pwd)" || exit $?
24 tmpdir="$(WVPASS wvmktempdir)" || exit $?
26 export BUP_DIR="$tmpdir/bup"
27 export GIT_DIR="$tmpdir/bup"
29 bup() { "$top/bup" "$@"; }
31 # Some versions of bash's printf don't support the relevant date expansion.
35 WVPASS python -c "from time import strftime, localtime; \
36 print strftime('%Y-%m-%d-%H%M%S', localtime($secs))"
42 savestamp1=$(WVPASS python -c 'import time; print int(time.time())') || exit $?
43 savestamp2=$(($savestamp1 + 1))
44 savename1="$(savename "$savestamp1")" || exit $?
45 savename2="$(savename "$savestamp2")" || exit $?
48 WVPASS echo content > src/foo
49 WVPASS chmod 644 src/foo
50 WVPASS touch -t 201111111111 src/foo
51 # FUSE, python-fuse, something, can't handle negative epoch times.
52 # Use pre-epoch to make sure bup properly "bottoms out" at 0 for now.
53 WVPASS echo content > src/pre-epoch
54 WVPASS chmod 644 src/pre-epoch
55 WVPASS touch -t 196907202018 src/pre-epoch
57 WVPASS bup save -n src -d "$savestamp1" --strip src
63 result=$(WVPASS ls mnt) || exit $?
64 WVPASSEQ src "$result"
66 result=$(WVPASS ls mnt/src) || exit $?
67 WVPASSEQ "$result" "$savename1
70 result=$(WVPASS ls mnt/src/latest) || exit $?
71 WVPASSEQ "$result" "foo
74 # Right now we don't detect new saves.
75 WVPASS bup save -n src -d "$savestamp2" --strip src
76 result=$(WVPASS ls mnt/src) || exit $?
77 WVPASSEQ "$result" "$savename1
80 WVPASS fusermount -uz mnt
82 WVSTART "extended metadata"
83 WVPASS bup fuse --meta mnt
84 result=$(TZ=UTC LC_ALL=C WVPASS ls -l mnt/src/latest/) || exit $?
85 readonly user=$(WVPASS id -un) || $?
86 readonly group=$(WVPASS id -gn) || $?
87 WVPASSEQ "$result" "total 0
88 -rw-r--r-- 1 $user $group 8 Nov 11 2011 foo
89 -rw-r--r-- 1 $user $group 8 Jan 1 1970 pre-epoch"
91 WVPASS fusermount -uz mnt
92 WVPASS rm -rf "$tmpdir"