diff options
Diffstat (limited to 'testing/nullmailer/fix-tests-catch-port.patch')
-rw-r--r-- | testing/nullmailer/fix-tests-catch-port.patch | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/testing/nullmailer/fix-tests-catch-port.patch b/testing/nullmailer/fix-tests-catch-port.patch new file mode 100644 index 0000000000..54bace9362 --- /dev/null +++ b/testing/nullmailer/fix-tests-catch-port.patch @@ -0,0 +1,28 @@ +From: Simon Frankenberger <simon-alpine@fraho.eu> +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 |