selftests: mptcp: sockopt: set EXIT trap earlier

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>
This commit is contained in:
Geliang Tang 2026-05-27 22:11:36 +10:00 committed by Jakub Kicinski
parent b7c746a8ee
commit c8da80af28

View File

@ -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