From b3ee5c2d4672c557d133f0f1299c8986fa5bb948 Mon Sep 17 00:00:00 2001 From: Fan Yong Date: Mon, 29 Sep 2014 01:33:58 +0800 Subject: [PATCH] LU-6000 tests: avoid test failure on b2_4 server 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 Change-Id: I9866707a336865e7e30ba587bd9847c1dae7ea58 Reviewed-on: http://review.whamcloud.com/13000 Tested-by: Jenkins Reviewed-by: Jian Yu Reviewed-by: Emoly Liu Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/tests/sanity-lfsck.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lustre/tests/sanity-lfsck.sh b/lustre/tests/sanity-lfsck.sh index fbb8cd6..14d38a7 100755 --- a/lustre/tests/sanity-lfsck.sh +++ b/lustre/tests/sanity-lfsck.sh @@ -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" ] || -- 1.8.3.1