Whamcloud - gitweb
LU-6000 tests: avoid test failure on b2_4 server 00/13000/7
authorFan Yong <fan.yong@intel.com>
Sun, 28 Sep 2014 17:33:58 +0000 (01:33 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 15 Jan 2015 04:44:30 +0000 (04:44 +0000)
The injection failure stub OBD_FAIL_FID_LOOKUP on old MDT
(version < 2.5.4) will cause sanity-lfsck test_4 failure
when traversal the directory. Since we will not land more
patch on b2_4, then skip related test(s) in new version
test scripts.

Test-Parameters: alwaysuploadlogs ossjob=lustre-b2_4 mdsjob=lustre-b2_4 ossbuildno=73 mdsbuildno=73 testlist=sanity-lfsck
Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I9866707a336865e7e30ba587bd9847c1dae7ea58
Reviewed-on: http://review.whamcloud.com/13000
Tested-by: Jenkins
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/sanity-lfsck.sh

index fbb8cd6..14d38a7 100755 (executable)
@@ -176,6 +176,7 @@ test_1a() {
        ls $DIR/$tdir/ > /dev/null || error "(7) no FID-in-dirent."
 
        do_facet $SINGLEMDS $LCTL set_param fail_loc=0
+       cancel_lru_locks mdc
 }
 run_test 1a "LFSCK can find out and repair crashed FID-in-dirent"
 
@@ -212,6 +213,7 @@ test_1b()
        stat $DIR/$tdir/dummy > /dev/null || error "(7) no FID-in-LMA."
 
        do_facet $SINGLEMDS $LCTL set_param fail_loc=0
+       cancel_lru_locks mdc
 }
 run_test 1b "LFSCK can find out and repair missed FID-in-LMA"
 
@@ -366,10 +368,16 @@ test_4()
        do_facet $SINGLEMDS $LCTL set_param fail_loc=0x1505
        ls $DIR/$tdir/ > /dev/null || error "(11) no FID-in-dirent."
 
-       local count=$(ls -al $DIR/$tdir | wc -l)
-       [ $count -gt 9 ] || error "(12) namespace LFSCK failed"
+       local server_version=$(lustre_version_code $SINGLEMDS)
+       if [[ $server_version -ge $(version_code 2.5.58) ]] ||
+          [[ $server_version -ge $(version_code 2.5.4) &&
+             $server_version -lt $(version_code 2.5.11) ]]; then
+               local count=$(ls -al $DIR/$tdir | wc -l)
+               [ $count -gt 9 ] || error "(12) namespace LFSCK failed"
+       fi
 
        do_facet $SINGLEMDS $LCTL set_param fail_loc=0
+       cancel_lru_locks mdc
 }
 run_test 4 "FID-in-dirent can be rebuilt after MDT file-level backup/restore"
 
@@ -423,6 +431,7 @@ test_5()
        ls $DIR/$tdir/ > /dev/null || error "(12) no FID-in-dirent."
 
        do_facet $SINGLEMDS $LCTL set_param fail_loc=0
+       cancel_lru_locks mdc
        local dummyfid=$($LFS path2fid $DIR/$tdir/dummy)
        local dummyname=$($LFS fid2path $DIR $dummyfid)
        [ "$dummyname" == "$DIR/$tdir/dummy" ] ||