Skip to content

Commit 0cda7d4

Browse files
committed
selftests: net: switch to socat in the GSO GRE test
Commit a985442 ("selftests: net: properly support IPv6 in GSO GRE test") is not compatible with: Ncat: Version 7.80 ( https://nmap.org/ncat ) (which is distributed with Fedora/Red Hat), tests fail with: nc: invalid option -- 'N' Let's switch to socat which is far more dependable. Fixes: 025efa0 ("selftests: add simple GSO GRE test") Fixes: a985442 ("selftests: net: properly support IPv6 in GSO GRE test") Tested-by: Andrea Righi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8753077 commit 0cda7d4

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

tools/testing/selftests/net/gre_gso.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,18 @@ gre_gst_test_checks()
118118
local addr=$2
119119
local proto=$3
120120

121-
$NS_EXEC nc $proto -kl $port >/dev/null &
121+
[ "$proto" == 6 ] && addr="[$addr]"
122+
123+
$NS_EXEC socat - tcp${proto}-listen:$port,reuseaddr,fork >/dev/null &
122124
PID=$!
123125
while ! $NS_EXEC ss -ltn | grep -q $port; do ((i++)); sleep 0.01; done
124126

125-
cat $TMPFILE | timeout 1 nc $proto -N $addr $port
127+
cat $TMPFILE | timeout 1 socat -u STDIN TCP:$addr:$port
126128
log_test $? 0 "$name - copy file w/ TSO"
127129

128130
ethtool -K veth0 tso off
129131

130-
cat $TMPFILE | timeout 1 nc $proto -N $addr $port
132+
cat $TMPFILE | timeout 1 socat -u STDIN TCP:$addr:$port
131133
log_test $? 0 "$name - copy file w/ GSO"
132134

133135
ethtool -K veth0 tso on
@@ -155,8 +157,8 @@ gre6_gso_test()
155157

156158
sleep 2
157159

158-
gre_gst_test_checks GREv6/v4 172.16.2.2
159-
gre_gst_test_checks GREv6/v6 2001:db8:1::2 -6
160+
gre_gst_test_checks GREv6/v4 172.16.2.2 4
161+
gre_gst_test_checks GREv6/v6 2001:db8:1::2 6
160162

161163
cleanup
162164
}
@@ -212,8 +214,8 @@ if [ ! -x "$(command -v ip)" ]; then
212214
exit $ksft_skip
213215
fi
214216

215-
if [ ! -x "$(command -v nc)" ]; then
216-
echo "SKIP: Could not run test without nc tool"
217+
if [ ! -x "$(command -v socat)" ]; then
218+
echo "SKIP: Could not run test without socat tool"
217219
exit $ksft_skip
218220
fi
219221

0 commit comments

Comments
 (0)