Skip to content

Commit 9ac4c28

Browse files
matttbedavem330
authored andcommitted
selftests: mptcp: sockopt: return error if wrong mark
When an error was detected when checking the marks, a message was correctly printed mentioning the error but followed by another one saying everything was OK and the selftest was not marked as failed as expected. Now the 'ret' variable is directly set to 1 in order to make sure the exit is done with an error, similar to what is done in other functions. While at it, the error is correctly propagated to the caller. Link: multipath-tcp/mptcp_net-next#368 Fixes: dc65fe8 ("selftests: mptcp: add packet mark test case") Cc: [email protected] Acked-by: Paolo Abeni <[email protected]> Signed-off-by: Matthieu Baerts <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a5a5990 commit 9ac4c28

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tools/testing/selftests/net/mptcp/mptcp_sockopt.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ check_mark()
128128
for v in $values; do
129129
if [ $v -ne 0 ]; then
130130
echo "FAIL: got $tables $values in ns $ns , not 0 - not all expected packets marked" 1>&2
131+
ret=1
131132
return 1
132133
fi
133134
done
@@ -227,11 +228,11 @@ do_transfer()
227228
fi
228229

229230
if [ $local_addr = "::" ];then
230-
check_mark $listener_ns 6
231-
check_mark $connector_ns 6
231+
check_mark $listener_ns 6 || retc=1
232+
check_mark $connector_ns 6 || retc=1
232233
else
233-
check_mark $listener_ns 4
234-
check_mark $connector_ns 4
234+
check_mark $listener_ns 4 || retc=1
235+
check_mark $connector_ns 4 || retc=1
235236
fi
236237

237238
check_transfer $cin $sout "file received by server"

0 commit comments

Comments
 (0)