]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests: mptcp: sockopt: set EXIT trap earlier
authorGeliang Tang <tanggeliang@kylinos.cn>
Wed, 27 May 2026 12:11:36 +0000 (22:11 +1000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 28 May 2026 23:38:13 +0000 (16:38 -0700)
Set the EXIT trap for cleanup immediately after creating temporary file
variables, before init and make_file, to ensure cleanup runs on any
failure or interruption during the early setup phase.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20260527-net-mptcp-sft-bufferbloat-exit-v1-3-9afc4e742090@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/mptcp/mptcp_sockopt.sh

index ab8bce06b2626c79debea88f7a73b7f2bf690de4..e850a87429b61304bc81eed5824eec1b0c095e9e 100755 (executable)
@@ -355,10 +355,10 @@ sin=$(mktemp)
 sout=$(mktemp)
 cin=$(mktemp)
 cout=$(mktemp)
+trap cleanup EXIT
 init
 make_file "$cin" "client" 1
 make_file "$sin" "server" 1
-trap cleanup EXIT
 mptcp_lib_subtests_last_ts_reset
 
 run_tests $ns1 $ns2 10.0.1.1