]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test_auth_caps: Move trap and cleanup to the top
authorNishtha Rai <nishtha3rai@gmail.com>
Mon, 20 Jul 2015 13:32:03 +0000 (19:02 +0530)
committerSage Weil <sage@redhat.com>
Thu, 1 Oct 2015 13:39:32 +0000 (09:39 -0400)
qa/workunits/fs/test_auth_caps.sh

index 13ff54bcd28b789f901bb8139b9db800f1db4938..228439c8b643d6bc5b5bdc81efd24971892e5e4d 100644 (file)
@@ -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