From: Simon Frankenberger Date: Wed, 16 Sep 2020 09:46:13 +0200 Subject: fix port detection from tcpserver in tests It seems that the port printed out by tcpserver differs from the expected form. Use some bash magic to extract the port number from the logline (last element in last line, separated by space). --- old/test/functions.in +++ new/test/functions.in @@ -52,6 +52,7 @@ catch-port() { local name=$1 port=$( head -n 1 $tmpdir/service/${name}-log ) + port=${port##* } } #not() { if "$@"; then return 1; else return 0; fi } --- old/test/tests/protocols +++ new/test/tests/protocols @@ -51,6 +51,7 @@ start server tcpserver -1 0 0 date port=$( head -n 1 $tmpdir/service/server-log ) + port=${port##* } echo "Testing protocol failure with $p." error 11 protocol $p -p $port --host=localhost 3<$testmail stop server