From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson To: passt-dev@passt.top Subject: [PATCH v5 03/14] test: Actually run cleanup function Date: Tue, 13 Sep 2022 14:35:18 +1000 Message-ID: <20220913043529.3079003-4-david@gibson.dropbear.id.au> In-Reply-To: <20220913043529.3079003-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4153636084998185182==" --===============4153636084998185182== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit We install a cleanup() function with 'trap' in order to clean up temporary files we generate during the tests. However, we deinstall it after run_term, which means it won't run in most of the cases where it would be useful. Even if "run from_term" exits with an error, that error will be hidden from the run_term wrapper because it's within a tmux session, so we will return from run_term normally, uninstall the trap and never clean up. In fact there's no reason to uninstall the trap at all, it works just as well on the success exit path as an error exit path. Signed-off-by: David Gibson --- test/run | 1 - 1 file changed, 1 deletion(-) diff --git a/test/run b/test/run index d8b60bf..9b0227b 100755 --- a/test/run +++ b/test/run @@ -178,7 +178,6 @@ else :> "${LOGFILE}" trap "cleanup" EXIT run_term - trap "" EXIT fi [ ${DEMO} -eq 1 ] && exit 0 -- 2.37.3 --===============4153636084998185182==--