From: Mark Wooding Date: Fri, 19 Feb 2016 21:49:33 +0000 (+0000) Subject: server/tests.at (server retry): Use the new `WITH_STRACE' macro. X-Git-Tag: 1.0.0pre18~10 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/tripe/commitdiff_plain/ee07712cb7eb8f692976a5dcca97e8f138b5cfb5 server/tests.at (server retry): Use the new `WITH_STRACE' macro. Now we don't necessarily need strace(1) installed at build time. It's now the responsibility of `WITH_STRACE' to clear away the strace(1) process if there is one. There's now too much process hierarchy in between the wait and the child for us to wait on the proxy process itself. It doesn't really matter much, fortunately. --- diff --git a/server/tests.at b/server/tests.at index 8e155b68..303c3464 100644 --- a/server/tests.at +++ b/server/tests.at @@ -472,12 +472,16 @@ WITH_2TRIPES([alice], [bob], [-nslip], [-talice], [-tbob], [ ## Set up the evil proxy. alicemitm=24516 bobmitm=14016 - MITM -kalice/keyring.pub >mitm.out 2>mitm.err \ - peer:alice:$alicemitm:127.0.0.1:$(cat alice/port) \ - peer:bob:$bobmitm:127.0.0.1:$(cat bob/port) \ - filt:drop:5 filt:send& mitmpid=$! - strace -omitm.trace -p$mitmpid& mitmtrace=$! - trap 'kill $mitmpid $mitmtrace; exit 127' EXIT INT QUIT TERM HUP + mknod pipe-mitmpid p + WITH_STRACE([mitm], + [sh -c 'echo $$ >pipe-mitmpid; exec "$@"' - \ + MITM -kalice/keyring.pub >mitm.out 2>mitm.err \ + peer:alice:$alicemitm:127.0.0.1:$(cat alice/port) \ + peer:bob:$bobmitm:127.0.0.1:$(cat bob/port) \ + filt:drop:5 filt:send])& + read mitmpid &- ## Try to establish keys anyway. AWAIT_KXDONE([alice], [alice], [bob], [bob], [ @@ -491,8 +495,6 @@ WITH_2TRIPES([alice], [bob], [-nslip], [-talice], [-tbob], [ ## Tear down the MITM proxy. kill $mitmpid - wait $mitmpid - wait $mitmtrace ]) AT_CLEANUP