chiark / gitweb /
adt-common: adt-full: Use a trap to try unmounting things
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 9 Jan 2023 23:39:43 +0000 (23:39 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 9 Jan 2023 23:42:11 +0000 (23:42 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
adt/acommon
adt/adt-full

index 7d4c1cf70cde020864151cdf7129d2510b09976b..3d3712c15c639c2ce1d1853ff6da1d6cdda3df47 100644 (file)
@@ -181,6 +181,12 @@ in- () {
 
 setup-pair () {
     test-prep
+    trap '
+        rc=$/
+        host-cleanup client
+        host-cleanup server
+        exit $rc
+    ' 0
     $test/netns-setup $tname
     setup-host client
     setup-host server
index 764c1e714cfc77b01f9d29e0424b14ce4e418c46..e1654b8d7128d0b31d852ff5c7e9ac879a55e7d7 100755 (executable)
@@ -33,4 +33,5 @@ echo tests passed, cleaning up.
 
 $src/adt/acleanup
 
+trap '' 0
 echo ok.