[PATCH 1/1] test-fuse: show errors by running fuse in the foreground

1 view
Skip to first unread message

Rob Browning

unread,
Nov 28, 2021, 1:24:57 PM11/28/21
to bup-...@googlegroups.com
When not run in the foreground, errors (e.g. exceptions) don't show up
on stderr.

Signed-off-by: Rob Browning <r...@defaultvalue.org>
Tested-by: Rob Browning <r...@defaultvalue.org>
---

Proposed. (At least Linux and FreeBSD sleeps appear to support
fractional seconds.)

test/ext/test-fuse | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/test/ext/test-fuse b/test/ext/test-fuse
index 08d7e2e4..f3ca4935 100755
--- a/test/ext/test-fuse
+++ b/test/ext/test-fuse
@@ -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)"
--
2.30.2

Johannes Berg

unread,
Nov 28, 2021, 1:53:18 PM11/28/21
to Rob Browning, bup-...@googlegroups.com

> +bup fuse -f mnt &
> +fuse_pid=$!
> +while ! test -d mnt/src; do
> + sleep 0.1
> +done
>

Could maybe break that out into some kind of function?

But not sure that's possible due to other output?

johannes

Rob Browning

unread,
Dec 5, 2021, 11:59:39 AM12/5/21
to bup-...@googlegroups.com
Rob Browning <r...@defaultvalue.org> writes:

> When not run in the foreground, errors (e.g. exceptions) don't show up
> on stderr.

Pushed.

--
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4

Rob Browning

unread,
Dec 5, 2021, 12:02:05 PM12/5/21
to Johannes Berg, bup-...@googlegroups.com
Johannes Berg <joha...@sipsolutions.net> writes:

> Could maybe break that out into some kind of function?
>
> But not sure that's possible due to other output?

Fair point, though I just left the duplication for now -- didn't want to
think about getting everything right shell-wise at the moment.
Reply all
Reply to author
Forward
0 new messages