Whamcloud - gitweb
LU-5023 tests: check FID seq properly for sanity-lfsck t_11b 76/10276/4
authorFan Yong <fan.yong@intel.com>
Fri, 10 Oct 2014 18:14:04 +0000 (02:14 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 3 Feb 2015 18:01:50 +0000 (18:01 +0000)
To guarantee the right FID seq to be checked.

Other scripts improvement for error handling.

Try to collect more logs.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I51cb75c15cc7421721ea0bc149fc2a5a72c13cc6
Reviewed-on: http://review.whamcloud.com/10276
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/sanity-lfsck.sh

index 2d971ce..b3b062b 100644 (file)
@@ -1224,9 +1224,16 @@ test_11b() {
        echo "set fail_loc=0x160d to skip the updating LAST_ID on-disk"
        #define OBD_FAIL_LFSCK_SKIP_LASTID      0x160d
        do_facet ost1 $LCTL set_param fail_loc=0x160d
        echo "set fail_loc=0x160d to skip the updating LAST_ID on-disk"
        #define OBD_FAIL_LFSCK_SKIP_LASTID      0x160d
        do_facet ost1 $LCTL set_param fail_loc=0x160d
-       createmany -o $DIR/$tdir/f 64
+
+       local count=$(precreated_ost_obj_count 0 0)
+
+       createmany -o $DIR/$tdir/f $((count + 32))
+
+       local proc_path="${FSNAME}-OST0000-osc-MDT0000"
+       local seq=$(do_facet mds1 $LCTL get_param -n \
+                   osp.${proc_path}.prealloc_last_seq)
        local lastid1=$(do_facet ost1 "lctl get_param -n \
        local lastid1=$(do_facet ost1 "lctl get_param -n \
-               obdfilter.${ost1_svc}.last_id" | grep 0x100000000 |
+               obdfilter.${ost1_svc}.last_id" | grep $seq |
                awk -F: '{ print $2 }')
 
        umount_client $MOUNT
                awk -F: '{ print $2 }')
 
        umount_client $MOUNT
@@ -1240,7 +1247,7 @@ test_11b() {
 
        for ((i = 0; i < 60; i++)); do
                lastid2=$(do_facet ost1 "lctl get_param -n \
 
        for ((i = 0; i < 60; i++)); do
                lastid2=$(do_facet ost1 "lctl get_param -n \
-                       obdfilter.${ost1_svc}.last_id" | grep 0x100000000 |
+                       obdfilter.${ost1_svc}.last_id" | grep $seq |
                        awk -F: '{ print $2 }')
                [ ! -z $lastid2 ] && break;
                sleep 1
                        awk -F: '{ print $2 }')
                [ ! -z $lastid2 ] && break;
                sleep 1
@@ -1267,10 +1274,11 @@ test_11b() {
 
        echo "the on-disk LAST_ID should have been rebuilt"
        wait_update_facet ost1 "$LCTL get_param -n \
 
        echo "the on-disk LAST_ID should have been rebuilt"
        wait_update_facet ost1 "$LCTL get_param -n \
-               obdfilter.${ost1_svc}.last_id | grep 0x100000000 |
+               obdfilter.${ost1_svc}.last_id | grep $seq |
                awk -F: '{ print \\\$2 }'" "$lastid1" 60 || {
                awk -F: '{ print \\\$2 }'" "$lastid1" 60 || {
-               $LCTL get_param -n obdfilter.${ost1_svc}.last_id
-               error "(9) expect lastid1 0x100000000:$lastid1"
+               do_facet ost1 $LCTL get_param -n \
+               obdfilter.${ost1_svc}.last_id
+               error "(9) expect lastid1 $seq:$lastid1"
        }
 
        do_facet ost1 $LCTL set_param fail_loc=0
        }
 
        do_facet ost1 $LCTL set_param fail_loc=0
@@ -1327,6 +1335,8 @@ test_12() {
                        error "(7) MDS${k} is not the expected 'completed'"
        done
 
                        error "(7) MDS${k} is not the expected 'completed'"
        done
 
+       start_full_debug_logging
+
        echo "Start layout LFSCK on all targets by single command (-s 1)."
        do_facet mds1 $LCTL lfsck_start -M ${FSNAME}-MDT0000 -t layout -A \
                -s 1 -r || error "(8) Fail to start LFSCK on all devices!"
        echo "Start layout LFSCK on all targets by single command (-s 1)."
        do_facet mds1 $LCTL lfsck_start -M ${FSNAME}-MDT0000 -t layout -A \
                -s 1 -r || error "(8) Fail to start LFSCK on all devices!"
@@ -1375,6 +1385,8 @@ test_12() {
                        awk '/^status/ { print \\\$2 }'" "completed" 32 ||
                        error "(14) MDS${k} is not the expected 'completed'"
        done
                        awk '/^status/ { print \\\$2 }'" "completed" 32 ||
                        error "(14) MDS${k} is not the expected 'completed'"
        done
+
+       stop_full_debug_logging
 }
 run_test 12 "single command to trigger LFSCK on all devices"
 
 }
 run_test 12 "single command to trigger LFSCK on all devices"