]> arthur.barton.de Git - bup.git/commitdiff
test-fuse: show errors by running fuse in the foreground
authorRob Browning <rlb@defaultvalue.org>
Sat, 27 Nov 2021 19:44:27 +0000 (13:44 -0600)
committerRob Browning <rlb@defaultvalue.org>
Sun, 5 Dec 2021 20:26:53 +0000 (14:26 -0600)
When not run in the foreground, errors (e.g. exceptions) don't show up
on stderr.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
test/ext/test-fuse

index 08d7e2e44dbbe9e0c11d580ef323b156274481cd..f3ca49355089fbca730c50d9e70630ada8bc7c62 100755 (executable)
@@ -28,6 +28,11 @@ if ! groups | grep -q fuse && test "$root_status" != root; then
     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)"