X-Git-Url: https://git.distorted.org.uk/~mdw/tripe/blobdiff_plain/9867bea0e9719d3e66b9b1504c728579a9a6b39c..f4c9c08fb4a558d880d183b65a12de3770c3860b:/server/tests.at diff --git a/server/tests.at b/server/tests.at index af94847d..f47aae48 100644 --- a/server/tests.at +++ b/server/tests.at @@ -35,7 +35,8 @@ m4_define([SETUPDIR], [ ## Running standard programs with useful options. m4_define([TRIPE], [env TRIPE_PRIVHELPER=$abs_top_builddir/priv/tripe-privhelper \ - $abs_top_builddir/server/tripe -F -d. -aadmin -p0 -b127.0.0.1 -talice]) + $abs_top_builddir/server/tripe -F -d. -aadmin -p0 -b127.0.0.1 -talice \ + ${TRIPE_TEST_TRACEOPTS+-T$TRIPE_TEST_TRACEOPTS}]) m4_define([TRIPECTL], [$abs_top_builddir/client/tripectl -d. -aadmin]) m4_define([USLIP], [$abs_top_builddir/uslip/tripe-uslip]) m4_define([PKSTREAM], @@ -57,7 +58,7 @@ m4_define([WITH_STRACE], mkdir -p strace-hack.$1/ (ulimit -c hard >/dev/null 2>&1 sh -c 'cd strace-hack.$1; exec "$[]@"' - \ - strace -f -o../$1.trace \ + strace -ff -tt -v -s1024 -o../$1.trace \ sh -c 'cd ..; exec "$[]@"' - \ $2) ;; @@ -109,12 +110,13 @@ $3 ) && :; } | { cd $1 echo TRIPE $2 >&2 - WITH_STRACE([tripe], [TRIPE $2 >server-output.full 2>server-errors]) + WITH_STRACE([tripe], [TRIPE $2 >server-output.full 2>server-errors.full]) stat=$? echo $stat >server-status if test $stat -ne 0; then - echo "exit status: $stat" >>server-errors + echo "exit status: $stat" >>server-errors.full fi + grep -v '^+ tripe: ' server-errors.full >server-errors ## We interrupt this relatively sensible macro for an especially awful ## hack. The tripe server emits warnings which are often caused by lack of @@ -227,11 +229,12 @@ m4_define([COMMS_SLIP], [ m4_define([AWAIT_KXDONE], [ ## Ignore some reports caused by races. - for d in $1 $3; do + for i in $1!$4 $3!$2; do + d=${i%!*} o=${i#*!} TRIPECTL -d$d WARN test PUSH - TRIPECTL -d$d WARN test IGNORE WARN KX $2 incorrect cookie - TRIPECTL -d$d WARN test IGNORE WARN KX $2 unexpected pre-challenge - TRIPECTL -d$d WARN test IGNORE WARN KX $2 unexpected challenge + TRIPECTL -d$d WARN test IGNORE WARN KX $o incorrect cookie + TRIPECTL -d$d WARN test IGNORE WARN KX $o unexpected pre-challenge + TRIPECTL -d$d WARN test IGNORE WARN KX $o unexpected challenge done ## Watch for the key-exchange completion announcement in the background. @@ -243,7 +246,7 @@ m4_define([AWAIT_KXDONE], [ case "$[]1:$[]2:$[]3" in OK::) ;; NOTE:KXDONE:$4) break ;; - NOTE:*) ;; + NOTE:* | TRACE:* | WARN:*) ;; *) exit 63 ;; esac done @@ -470,12 +473,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], [ @@ -489,8 +496,6 @@ WITH_2TRIPES([alice], [bob], [-nslip], [-talice], [-tbob], [ ## Tear down the MITM proxy. kill $mitmpid - wait $mitmpid - wait $mitmtrace ]) AT_CLEANUP