X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=test%2Fext%2Ftest-fuse;h=bfe04a978928fccb859c4ab6efe3574cfed8d77b;hb=c8301efc5911ab5af83e567aaa6c755f8f91c681;hp=08d7e2e44dbbe9e0c11d580ef323b156274481cd;hpb=ef77b2a82d66d3dc4fcd3a6dc4bde83f564a481a;p=bup.git diff --git a/test/ext/test-fuse b/test/ext/test-fuse index 08d7e2e..bfe04a9 100755 --- a/test/ext/test-fuse +++ b/test/ext/test-fuse @@ -9,25 +9,30 @@ unset BLOCKSIZE BLOCK_SIZE DF_BLOCK_SIZE root_status="$(dev/root-status)" || exit $? if ! bup-python -c 'import fuse' 2> /dev/null; then - WVSTART 'unable to import fuse; skipping test' + WVSKIP 'unable to import fuse; skipping test' exit 0 fi if test -n "$(type -p modprobe)" && ! modprobe fuse; then - echo 'Unable to load fuse module; skipping dependent tests.' 1>&2 + WVSKIP 'Unable to load fuse module; skipping dependent tests.' exit 0 fi if ! fusermount -V; then - echo 'skipping FUSE tests: fusermount does not appear to work' + WVSKIP 'skipping FUSE tests: fusermount does not appear to work' exit 0 fi if ! groups | grep -q fuse && test "$root_status" != root; then - echo 'skipping FUSE tests: you are not root and not in the fuse group' + WVSKIP 'skipping FUSE tests: you are not root and not in the fuse group' exit 0 fi + +clean_up() { fusermount -uz mnt || true; } +trap clean_up EXIT + + top="$(WVPASS pwd)" || exit $? tmpdir="$(WVPASS wvmktempdir)" || exit $? @@ -69,7 +74,12 @@ WVPASS bup save -n src -d "$savestamp1" --strip src WVSTART "basics" WVPASS mkdir mnt -WVPASS bup fuse mnt + +bup fuse -f mnt & +fuse_pid=$! +while ! test -d mnt/src; do + sleep 0.1 +done result=$(WVPASS ls mnt) || exit $? WVPASSEQ src "$result" @@ -92,9 +102,17 @@ WVPASSEQ "$result" "$savename1 latest" WVPASS fusermount -uz mnt +WVPASS wait "$fuse_pid" +fuse_pid='' WVSTART "extended metadata" -WVPASS bup fuse --meta mnt + +bup fuse -f --meta mnt & +fuse_pid=$! +while ! test -d mnt/src; do + sleep 0.1 +done + readonly user=$(WVPASS id -un) || $? readonly group=$(WVPASS id -gn) || $? result="$(stat --format='%A %U %G %x' mnt/src/latest/foo)"