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" "$@"; }
34 savestamp1=$(WVPASS python -c 'import time; print int(time.time())') || exit $?
35 savestamp2=$(($savestamp1 + 1))
36 savename1="$(printf '%(%Y-%m-%d-%H%M%S)T' "$savestamp1")" || exit $?
37 savename2="$(printf '%(%Y-%m-%d-%H%M%S)T' "$savestamp2")" || exit $?
40 WVPASS echo content > src/foo
41 WVPASS chmod 644 src/foo
42 WVPASS touch -t 201111111111 src/foo
43 # FUSE, python-fuse, something, can't handle negative epoch times.
44 # Use pre-epoch to make sure bup properly "bottoms out" at 0 for now.
45 WVPASS echo content > src/pre-epoch
46 WVPASS chmod 644 src/pre-epoch
47 WVPASS touch -t 196907202018 src/pre-epoch
49 WVPASS bup save -n src -d "$savestamp1" --strip src
55 result=$(WVPASS ls mnt) || exit $?
56 WVPASSEQ src "$result"
58 result=$(WVPASS ls mnt/src) || exit $?
59 WVPASSEQ "$result" "$savename1
62 result=$(WVPASS ls mnt/src/latest) || exit $?
63 WVPASSEQ "$result" "foo
66 # Right now we don't detect new saves.
67 WVPASS bup save -n src -d "$savestamp2" --strip src
68 result=$(WVPASS ls mnt/src) || exit $?
69 savename="$(WVPASS printf '%(%Y-%m-%d-%H%M%S)T' "$savestamp1")" || exit $?
70 WVPASSEQ "$result" "$savename1
73 WVPASS fusermount -uz mnt
75 WVSTART "extended metadata"
76 WVPASS bup fuse --meta mnt
77 result=$(TZ=UTC LC_ALL=C WVPASS ls -l mnt/src/latest/) || exit $?
78 readonly user=$(WVPASS id -un) || $?
79 readonly group=$(WVPASS id -gn) || $?
80 WVPASSEQ "$result" "total 0
81 -rw-r--r-- 1 $user $group 8 Nov 11 2011 foo
82 -rw-r--r-- 1 $user $group 8 Jan 1 1970 pre-epoch"
84 WVPASS fusermount -uz mnt
85 WVPASS rm -rf "$tmpdir"