From: Harald Hoyer Date: Mon, 9 Jul 2012 18:44:48 +0000 (+0200) Subject: TEST-99-RPM test trap X-Git-Tag: 021~42 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=43bac63e33a31f4d86ca8f16b439dd33336a374b;p=thirdparty%2Fdracut.git TEST-99-RPM test trap --- diff --git a/test/TEST-99-RPM/test.sh b/test/TEST-99-RPM/test.sh index 25c189561..66f0bebd0 100755 --- a/test/TEST-99-RPM/test.sh +++ b/test/TEST-99-RPM/test.sh @@ -14,6 +14,9 @@ test_run() { mkdir -p "$rootdir/sys" mkdir -p "$rootdir/dev" +trap 'ret=$?; [[ -d $rootdir ]] && { umount "$rootdir/proc"; umount "$rootdir/sys"; umount "$rootdir/dev"; rm -rf "$rootdir"; }; exit $ret;' EXIT +trap '[[ -d $rootdir ]] && { umount "$rootdir/proc"; umount "$rootdir/sys"; umount "$rootdir/dev"; rm -rf "$rootdir"; }; exit 1;' SIGINT + mount --bind /proc "$rootdir/proc" mount --bind /sys "$rootdir/sys" mount -t devtmpfs devtmpfs "$rootdir/dev"