From: Nishtha Rai Date: Mon, 20 Jul 2015 13:32:03 +0000 (+0530) Subject: test_auth_caps: Move trap and cleanup to the top X-Git-Tag: v10.0.0~123^2~69 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4ce4b58056d46b48ed58bb6e6e2f446e804c3a0a;p=ceph.git test_auth_caps: Move trap and cleanup to the top --- diff --git a/qa/workunits/fs/test_auth_caps.sh b/qa/workunits/fs/test_auth_caps.sh index 13ff54bcd28b..228439c8b643 100644 --- a/qa/workunits/fs/test_auth_caps.sh +++ b/qa/workunits/fs/test_auth_caps.sh @@ -1,5 +1,14 @@ #!/bin/sh -ex +cleanup() +{ + echo "*** Restoring to old state" + sudo rm -r mnt.admin/foo1 mnt.admin/foo2 + fusermount -u mnt.admin + fusermount -u mnt.foo + rmdir mnt.admin mnt.foo +} +trap cleanup INT TERM EXIT echo "*** Creating directories for mount" mkdir -p mnt.admin mnt.foo @@ -37,13 +46,3 @@ mkdir mnt.foo/foo1/asdf expect_false mkdir mnt.foo/foo2/asdf -echo "*** Restoring to old state" -cleanup() -{ - - sudo rm -r mnt.admin/foo1 mnt.admin/foo2 - fusermount -u mnt.admin - fusermount -u mnt.foo - rmdir mnt.admin mnt.foo -} -trap cleanup INT TERM EXIT