Whamcloud - gitweb
LU-3809 test: Cleanup if replay-single/58[bc] fail 19/7419/2
authorNathaniel Clark <nathaniel.l.clark@intel.com>
Thu, 22 Aug 2013 14:10:25 +0000 (10:10 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 5 Sep 2013 20:57:42 +0000 (20:57 +0000)
Cleanup state if replay-single/58b or 58c have an error.  This will
unmount MOUNT2.

Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Change-Id: I471408ffe1aa818be16b6a36ccf6b7e9e9e9891e
Reviewed-on: http://review.whamcloud.com/7419
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/tests/replay-single.sh

index 4e7e301..5c695d8 100755 (executable)
@@ -1393,6 +1393,11 @@ test_57() {
 }
 run_test 57 "test recovery from llog for setattr op"
 
+cleanup_58() {
+    zconf_umount `hostname` $MOUNT2
+    trap - EXIT
+}
+
 #recovery many mds-ost setattr from llog
 test_58a() {
     mkdir -p $DIR/$tdir
@@ -1413,6 +1418,8 @@ test_58b() {
     local orig
     local new
 
+    trap cleanup_58 EXIT
+
     large_xattr_enabled &&
         orig="$(generate_string $(max_xattr_size))" || orig="bar"
 
@@ -1426,7 +1433,7 @@ test_58b() {
     [[ "$new" = "$orig" ]] || return 1
     rm -f $DIR/$tdir/$tfile
     rmdir $DIR/$tdir
-    zconf_umount `hostname` $MOUNT2
+    cleanup_58
 }
 run_test 58b "test replay of setxattr op"
 
@@ -1435,6 +1442,8 @@ test_58c() { # bug 16570
     local orig1
     local new
 
+    trap cleanup_58 EXIT
+
     if large_xattr_enabled; then
         local xattr_size=$(max_xattr_size)
         orig="$(generate_string $((xattr_size / 2)))"
@@ -1457,7 +1466,7 @@ test_58c() { # bug 16570
     [[ "$new" = "$orig1" ]] || return 4
     rm -f $DIR/$tdir/$tfile
     rmdir $DIR/$tdir
-    zconf_umount $HOSTNAME $MOUNT2
+    cleanup_58
 }
 run_test 58c "resend/reconstruct setxattr op"