server/tests.at (server retry): Use the new `WITH_STRACE' macro.
[tripe] / server / tests.at
index 8e155b6..303c346 100644 (file)
@@ -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 <pipe-mitmpid
+  trap 'kill $mitmpid; exit 127' EXIT INT QUIT TERM HUP
+  exec 3>&-
 
   ## 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