]> arthur.barton.de Git - bup.git/commitdiff
test-web: redirect stdio to make test work standalone
authorJohannes Berg <johannes@sipsolutions.net>
Tue, 4 Aug 2020 14:49:36 +0000 (16:49 +0200)
committerRob Browning <rlb@defaultvalue.org>
Sat, 19 Dec 2020 22:32:04 +0000 (16:32 -0600)
Python (at least 3) behaves differently if somehow
stdio is connected to the terminal, and external
SIGTERM then doesn't cause the same behaviour as
actually pressing Ctrl-C. Redirect the output to
a file to make the test run standalone.

Print the file if any errors occur so that if there's
anything interesting in there, we can see it.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
test/ext/test-web

index eab092c1caa802826a3c704a00862724882bd048..dafd9cd568a23126b70dfc012cd3410ca9eb4023 100755 (executable)
@@ -53,8 +53,10 @@ WVPASS echo -e 'whee \x80\x90\xff' > "$(echo -ne 'src/whee \x80\x90\xff')"
 WVPASS bup index src
 WVPASS bup save -n '¡excitement!' --strip src
 
-"$TOP/bup" web unix://socket &
+"$TOP/bup" web unix://socket </dev/null >bup-web.log 2>&1 &
 web_pid=$!
+# output the log if something fails
+trap cat bup-web.log EXIT
 wait-for-server-start
 
 WVPASS curl --unix-socket ./socket \
@@ -69,4 +71,5 @@ WVPASS cmp "$(echo -ne 'src/whee \x80\x90\xff')" result2
 WVPASS kill -s TERM "$web_pid"
 WVPASS wait "$web_pid"
 
+trap - EXIT
 WVPASS rm -r "$tmpdir"