6 if [ $(t/root-status) != root ]; then
7 echo 'Not root: skipping xdev tests.'
8 exit 0 # FIXME: add WVSKIP.
11 # These tests are only likely to work under Linux for now
13 if ! [[ $(uname) =~ Linux ]]; then
14 echo 'Not Linux: skipping xdev tests.'
15 exit 0 # FIXME: add WVSKIP.
18 top="$(WVPASS pwd)" || exit $?
19 tmpdir="$(WVPASS wvmktempdir)" || exit $?
21 export BUP_DIR="$tmpdir/bup"
22 export GIT_DIR="$tmpdir/bup"
24 bup() { "$top/bup" "$@"; }
27 WVPASS pushd "$tmpdir"
31 WVPASS dd if=/dev/zero of=testfs.img bs=1M count=32
32 WVPASS mkfs -F testfs.img # Don't care what type.
33 WVPASS mkdir -p src/mnt/{a,b,c}
34 WVPASS mount -o loop testfs.img src/mnt
35 WVPASS mkdir -p src/mnt/x
36 WVPASS touch src/1 src/mnt/2 src/mnt/x/3
38 WVPASSEQ "$(bup drecurse src | grep -vF lost+found)" "src/mnt/x/3
45 WVPASSEQ "$(bup drecurse -x src)" "src/mnt/
49 WVSTART 'index/save/restore'
52 WVPASS bup save -n src src
53 WVPASS mkdir src-restore
54 WVPASS bup restore -C src-restore "/src/latest$(pwd)/"
55 WVPASS test -d src-restore/src
56 WVPASS "$top/t/compare-trees" -c src/ src-restore/src/
58 WVPASS rm -r "$BUP_DIR" src-restore
60 WVPASS bup index -x src
61 WVPASS bup save -n src src
62 WVPASS mkdir src-restore
63 WVPASS bup restore -C src-restore "/src/latest$(pwd)/"
64 WVPASS test -d src-restore/src
65 WVPASSEQ "$(cd src-restore/src && find . -not -name lost+found | sort)" ".
70 WVPASS umount "$tmpdir/src/mnt"
71 WVPASS rm -r "$tmpdir"