diff --git a/lib/testing/test_runner.sh b/lib/testing/test_runner.sh index 90c7cda7..49b9c2e1 100755 --- a/lib/testing/test_runner.sh +++ b/lib/testing/test_runner.sh @@ -25,7 +25,7 @@ ALL_TESTS="" VERBOSE_TESTS=${V:-0} NUM_NS=2 -NEEDED_TOOLS="capinfos ethtool ip ping sed tc tcpdump timeout nc tshark nft socat" +NEEDED_TOOLS="capinfos ethtool ip ping sed tc tcpdump timeout tshark nft socat" if [ -f "$TEST_CONFIG" ]; then source "$TEST_CONFIG" diff --git a/xdp-filter/tests/test-xdp-filter.sh b/xdp-filter/tests/test-xdp-filter.sh index 1d24c312..3da9ccd8 100644 --- a/xdp-filter/tests/test-xdp-filter.sh +++ b/xdp-filter/tests/test-xdp-filter.sh @@ -87,8 +87,8 @@ check_port() local port=$2 local expect=$3 echo "$type port $port $expect" - [[ "$type" == "tcp" ]] && command="nc -w 1 -z $OUTSIDE_IP6 $port" - [[ "$type" == "udp" ]] && command="echo test | nc -w 1 -u $OUTSIDE_IP6 $port" + [[ "$type" == "tcp" ]] && command="echo test | socat - TCP6:[$OUTSIDE_IP6]:$port,connect-timeout=1" + [[ "$type" == "udp" ]] && command="echo test | socat - UDP6:[$OUTSIDE_IP6]:$port" check_packet "$type dst port $port" "$command" $expect } diff --git a/xdp-forward/tests/test-xdp-forward.sh b/xdp-forward/tests/test-xdp-forward.sh index 68fe0a0a..f86f68c2 100644 --- a/xdp-forward/tests/test-xdp-forward.sh +++ b/xdp-forward/tests/test-xdp-forward.sh @@ -115,11 +115,11 @@ EOF check_run $XDP_FORWARD load -f flowtable ${NS_NAMES[@]} PID=$(start_background_ns_devnull "socat -4 TCP-LISTEN:10000,reuseaddr,fork -") - check_run ip netns exec ${NS_NAMES[0]} socat ${INPUT_FILE} TCP4:${OUTSIDE_IP4}:12345 + check_run ip netns exec ${NS_NAMES[0]} socat ${INPUT_FILE} TCP4:${OUTSIDE_IP4}:12345,connect-timeout=1 stop_background $PID PID=$(start_background_ns_devnull "socat -6 TCP-LISTEN:10000,reuseaddr,fork -") - check_run ip netns exec ${NS_NAMES[0]} socat ${INPUT_FILE} TCP6:[${OUTSIDE_IP6}]:12345 + check_run ip netns exec ${NS_NAMES[0]} socat ${INPUT_FILE} TCP6:[${OUTSIDE_IP6}]:12345,connect-timeout=1 stop_background $PID } diff --git a/xdp-trafficgen/tests/test-xdp-trafficgen.sh b/xdp-trafficgen/tests/test-xdp-trafficgen.sh index a42032d0..118af388 100644 --- a/xdp-trafficgen/tests/test-xdp-trafficgen.sh +++ b/xdp-trafficgen/tests/test-xdp-trafficgen.sh @@ -28,7 +28,7 @@ test_tcp() skip_if_missing_kernel_support export XDP_SAMPLE_IMMEDIATE_EXIT=1 - PID=$(start_background_ns_devnull "nc -6 -l 10000") + PID=$(start_background_ns_devnull "socat -6 TCP-LISTEN:10000,reuseaddr,fork -") $XDP_TRAFFICGEN tcp -i $NS $INSIDE_IP6 -n 1 res=$? stop_background $PID