From: Ian Jackson Date: Tue, 10 Jan 2023 21:29:20 +0000 (+0000) Subject: Break out on-failure X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=04855b7ed2b919bdb4d685ade3434c3884cfe9f0;p=hippotat.git Break out on-failure Signed-off-by: Ian Jackson --- diff --git a/adt/acommon b/adt/acommon index 1baf9e1..6568235 100644 --- a/adt/acommon +++ b/adt/acommon @@ -8,6 +8,15 @@ set -x . "${0%/*}"/../test/tcommon +on_failure=: + +trap ' + rc=$? + : =================== ^^ TEST FAILURE ^^ ==================== + $on_failure + exit $rc +' 0 + test-prep () { determine-tname adt @@ -183,13 +192,7 @@ in- () { setup-pair () { test-prep - trap ' - rc=$? - : =================== ^^ TEST FAILURE ^^ ==================== - host-cleanup client - host-cleanup server - exit $rc - ' 0 + on_failure=host-cleanup $test/netns-setup $tname setup-host client setup-host server