From 5db247abfc55417f3df3569fc8010f824c250bba Mon Sep 17 00:00:00 2001 From: Darek Stojaczyk Date: Tue, 17 Mar 2020 11:30:37 +0100 Subject: [PATCH] test/spdkcli/tcp: don't override the ERR trap That test used to call an inexistent function in its ERR trap. That's for one. Second, none of the SPDK tests should set the ERR trap themselves - it's set once in autotest_common.sh and prints the backtrace. What test scripts should do is setting SIGINT/EXIT traps - fix it now. Change-Id: I46c82651be78eeaec16ac52396c5e80a0405e5ff Signed-off-by: Darek Stojaczyk Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1331 Tested-by: SPDK CI Jenkins Reviewed-by: Michal Berger Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- test/spdkcli/tcp.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/spdkcli/tcp.sh b/test/spdkcli/tcp.sh index e786264c4..a73e2f394 100755 --- a/test/spdkcli/tcp.sh +++ b/test/spdkcli/tcp.sh @@ -46,7 +46,7 @@ function waitfortcplisten() { IP_ADDRESS="127.0.0.1" PORT="9998" -trap 'on_error_exit;' ERR +trap 'killprocess $spdk_tgt_pid; exit 1' SIGINT SIGTERM EXIT timing_enter run_spdk_tgt_tcp $rootdir/app/spdk_tgt/spdk_tgt -m 0x3 -p 0 -s 2048 -r $IP_ADDRESS:$PORT & @@ -57,4 +57,5 @@ waitfortcplisten $spdk_tgt_pid $IP_ADDRESS $PORT timing_exit run_spdk_tgt_tcp +trap - SIGINT SIGTERM EXIT killprocess $spdk_tgt_pid