From 106f5d04d985d9434d06b67d3476b63a33bb71a8 Mon Sep 17 00:00:00 2001 From: Andrew Bettison Date: Mon, 18 May 2015 17:20:01 +0930 Subject: [PATCH] Fix 'msp' test failures: different netcat versions The "traditional" variant of nc(1) ("netcat") (installed by default on Debian and Ubuntu) behaves differently from the OpenBSD variant, causing two 'msp' tests to fail. Added -q options to nc(1) invocations to make tests pass with either variant. --- tests/msp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/msp b/tests/msp index 13a25503..0c554fdb 100755 --- a/tests/msp +++ b/tests/msp @@ -194,7 +194,7 @@ test_forward() { set_instance +B fork %connect client_forward 2048 $SIDA sleep 1 - executeOk nc -v 127.0.0.1 2048 < <(echo "Hello from the client") + executeOk nc -q 30 -v 127.0.0.1 2048 < <(echo "Hello from the client") assertStdoutGrep --matches=1 "^Hello from the server$" fork_wait %listen %connect } @@ -210,10 +210,9 @@ server_forward() { tfw_cat --stderr } nc_listen() { - execute nc -v -l $1 < <(echo "Hello from the server") + execute nc -q -1 -v -l -p $1 < <(echo "Hello from the server") tfw_cat --stdout --stderr } - test_tcp_tunnel() { fork %listen nc_listen 6000 set_instance +A @@ -221,7 +220,8 @@ test_tcp_tunnel() { set_instance +B fork %client client_forward 6001 $SIDA sleep 1 - executeOk nc -v 127.0.0.1 6001 < <(echo "Hello from the client") + executeOk nc -q 10 -v 127.0.0.1 6001 < <(echo "Hello from the client") + tfw_cat --stdout --stderr assertStdoutGrep --matches=1 "^Hello from the server$" fork_wait %listen %server %client } @@ -304,7 +304,7 @@ test_terminate() { fork %mspconnect client_terminate sleep 1 # todo capture nc output nicely, while still being able to terminate it - fork %ncconnect nc -v 127.0.0.1 3001 + fork %ncconnect nc -q 0 -v 127.0.0.1 3001 fork_terminate %ncconnect fork_wait %msplisten %mspconnect %ncconnect }