Whamcloud - gitweb
LU-2194 tests: add debugging to recovery-small/19
authorNathaniel Clark <nathaniel.l.clark@intel.com>
Mon, 21 Jan 2013 20:15:20 +0000 (15:15 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 4 Feb 2013 17:46:17 +0000 (12:46 -0500)
Add error messages to 19a and 19b

Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Change-Id: Ief35c063734654c5a6f3dab0d283c4b7a32706e8
Reviewed-on: http://review.whamcloud.com/5141
Reviewed-by: Li Wei <wei.g.li@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/tests/recovery-small.sh

index 78f8463..ed8ce3a 100755 (executable)
@@ -409,10 +409,12 @@ test_19a() {
        local BEFORE=`date +%s`
        local EVICT
 
-       mount_client $DIR2
+       mount_client $DIR2 || error "failed to mount $DIR2"
 
-       do_facet client "stat $DIR > /dev/null"  || return 1
-       drop_ldlm_cancel "chmod 0777 $DIR2"
+       do_facet client "stat $DIR > /dev/null"  ||
+               error "failed to stat $DIR: $?"
+       drop_ldlm_cancel "chmod 0777 $DIR2" ||
+               error "failed to chmod $DIR2"
 
        umount_client $DIR2
 
@@ -421,7 +423,9 @@ test_19a() {
        EVICT=$(do_facet client $LCTL get_param mdc.$FSNAME-MDT*.state | \
            awk -F"[ [,]" '/EVICTED]$/ { if (mx<$4) {mx=$4;} } END { print mx }')
 
-       [ ! -z "$EVICT" ] && [[ $EVICT -gt $BEFORE ]] || error "no eviction"
+       [ ! -z "$EVICT" ] && [[ $EVICT -gt $BEFORE ]] ||
+               (do_facet client $LCTL get_param mdc.$FSNAME-MDT*.state;
+                   error "no eviction: $EVICT before:$BEFORE")
 }
 run_test 19a "test expired_lock_main on mds (2867)"
 
@@ -429,19 +433,25 @@ test_19b() {
        local BEFORE=`date +%s`
        local EVICT
 
-       mount_client $DIR2
+       mount_client $DIR2 || error "failed to mount $DIR2: $?"
 
-       do_facet client $MULTIOP $DIR/$tfile Ow  || return 1
-       drop_ldlm_cancel $MULTIOP $DIR2/$tfile Ow
-       umount_client $DIR2
-       do_facet client munlink $DIR/$tfile
+       do_facet client $MULTIOP $DIR/$tfile Ow ||
+               error "failed to run multiop: $?"
+       drop_ldlm_cancel $MULTIOP $DIR2/$tfile Ow ||
+               error "failed to ldlm_cancel: $?"
+
+       umount_client $DIR2 || error "failed to unmount $DIR2: $?"
+       do_facet client munlink $DIR/$tfile ||
+               error "failed to unlink $DIR/$tfile: $?"
 
        # let the client reconnect
        client_reconnect
        EVICT=$(do_facet client $LCTL get_param osc.$FSNAME-OST*.state | \
            awk -F"[ [,]" '/EVICTED]$/ { if (mx<$4) {mx=$4;} } END { print mx }')
 
-       [ ! -z "$EVICT" ] && [[ $EVICT -gt $BEFORE ]] || error "no eviction"
+       [ ! -z "$EVICT" ] && [[ $EVICT -gt $BEFORE ]] ||
+               (do_facet client $LCTL get_param osc.$FSNAME-OST*.state;
+                   error "no eviction: $EVICT before:$BEFORE")
 }
 run_test 19b "test expired_lock_main on ost (2867)"