X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/tripe/blobdiff_plain/5d85da1c8dba900b960ab8fd81e2f8fdb7a7a660..c85c17123f9713266341520e86e0acb31fad4031:/server/tests.at?ds=sidebyside diff --git a/server/tests.at b/server/tests.at index 1a3bc4c5..0a7e7855 100644 --- a/server/tests.at +++ b/server/tests.at @@ -34,7 +34,8 @@ m4_define([SETUPDIR], [ ## Running standard programs with useful options. m4_define([TRIPE], - [$abs_top_builddir/server/tripe -F -d. -aadmin -p0 -b127.0.0.1 -talice]) + [env TRIPE_PRIVHELPER=$abs_top_builddir/priv/tripe-privhelper \ + $abs_top_builddir/server/tripe -F -d. -aadmin -p0 -b127.0.0.1 -talice]) m4_define([TRIPECTL], [$abs_top_builddir/client/tripectl -d. -aadmin]) m4_define([USLIP], [$abs_top_builddir/uslip/tripe-uslip]) @@ -54,9 +55,9 @@ rm -f $1/server-status > $1/expected-server-output > $1/expected-server-errors -## Keep Autotest writes crap to standard output, which we don't want going to -## the server. So keep a copy of the standard output, do the pipe, and -## recover the old stdout inside the group. +## Autotest writes crap to standard output, which we don't want going to the +## server. So keep a copy of the standard output, do the pipe, and recover +## the old stdout inside the group. exec 3>&1 { ( exec 1>&3 3>&- @@ -64,7 +65,7 @@ exec 1>&3 3>&- ## Wait for the socket to appear. Watch for the server crashing during ## initialization. Busy waiting is evil, but it's the best I can do and ## not sleep for ages. (Yes, a second on each test group is a long time.) -while test ! -r $1//server-status && test ! -S $1/admin; do :; done +while test ! -r $1/server-status && test ! -S $1/admin; do :; done ## Test body... $3 @@ -105,8 +106,8 @@ rm -f pipe-$1; mknod pipe-$1 p ## TRIPECTL_INTERACT(ARGS, SHELLSTUFF) m4_define([TRIPECTL_INTERACT], [ - exec 3<&1 - COPROCESSES([client], [exec 4>&1 1>&3 $2], [TRIPECTL $1]) + exec 3>&1 + COPROCESSES([client], [exec 4>&1 1>&3 $1], [TRIPECTL $2]) ]) ## TRIPECTL_COMMAND(CMD, EXPECT) @@ -223,24 +224,25 @@ WITH_2TRIPES([alice], [bob], [-nslip], [-talice], [-tbob], [ AT_CHECK([TRIPECTL -dalice ADD bob INET 127.0.0.1 $(cat bob/port)]) echo >>bob/expected-server-output \ "WARN PEER - unexpected-source INET 127.0.0.1 $(cat alice/port)" - AT_CHECK([TRIPECTL -dbob ADD alice INET 127.0.0.1 $(cat alice/port)]) + AT_CHECK([TRIPECTL -dbob ADD -key alice not-alice \ + INET 127.0.0.1 $(cat alice/port)]) ## Check transport pinging. AT_CHECK([TRIPECTL -dalice PING bob],, [ignore]) - AT_CHECK([TRIPECTL -dbob PING alice],, [ignore]) + AT_CHECK([TRIPECTL -dbob PING not-alice],, [ignore]) ## Wait for the completion announcement. wait ## Check encrypted pinging. AT_CHECK([TRIPECTL -dalice EPING bob],, [ignore]) - AT_CHECK([TRIPECTL -dbob EPING alice],, [ignore]) + AT_CHECK([TRIPECTL -dbob EPING not-alice],, [ignore]) ## Check that packets can flow from one to the other. AT_CHECK([echo "from alice" | USLIP -p alice/bob]) - AT_CHECK([USLIP -g bob/alice],, [from alice[]nl]) + AT_CHECK([USLIP -g bob/not-alice],, [from alice[]nl]) - AT_CHECK([echo "from bob" | USLIP -p bob/alice]) + AT_CHECK([echo "from bob" | USLIP -p bob/not-alice]) AT_CHECK([USLIP -g alice/bob],, [from bob[]nl]) ])