From 9af57d0bdce9949dc3fe91817263758b57efbe9b Mon Sep 17 00:00:00 2001 From: Bobi Jam Date: Thu, 15 Feb 2018 15:59:14 +0800 Subject: [PATCH] LU-10670 test: make sanity-flr test_43 more reliable Improve sanity-flr test_43 more reliable by setting the active state of OSP device instead of OSC device to simulate OST's unavailability. Test-Parameters: testlist=sanity-flr Signed-off-by: Bobi Jam Change-Id: Ibfb4a54479a7dafff251dd3645b03ec172b6884e Reviewed-on: https://review.whamcloud.com/31315 Tested-by: Jenkins Reviewed-by: Jinshan Xiong Tested-by: Maloo Reviewed-by: James Nunez Reviewed-by: Oleg Drokin --- lustre/tests/sanity-flr.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lustre/tests/sanity-flr.sh b/lustre/tests/sanity-flr.sh index 4201887..f21f3d8 100644 --- a/lustre/tests/sanity-flr.sh +++ b/lustre/tests/sanity-flr.sh @@ -1522,22 +1522,22 @@ run_test 42 "lfs mirror verify" write_file_43() { local file=$1 local ost=$2 - local PARAM="osc.${FSNAME}-OST000${ost}-osc-M*.active" + local PARAM="osp.${FSNAME}-OST000${ost}-osc-M*.active" local wait wait=$(do_facet $SINGLEMDS \ "$LCTL get_param -n lod.*MDT0000-*.qos_maxage") wait=${wait%%[^0-9]*} - echo "deactivate OST$ost, waiting for $((wait*2)) seconds" + echo " **deactivate OST$ost, waiting for $((wait*2+2)) seconds" $(do_facet $SINGLEMDS "$LCTL set_param -n $PARAM 0") # lod_qos_statfs_update needs 2*$wait seconds to refresh targets statfs - sleep $(($wait * 2)) - echo "write $file" + sleep $(($wait * 2 + 2)) + echo " **write $file" dd if=/dev/zero of=$file bs=1M count=1 || error "write $file failed" - echo "restore activating OST$ost, waiting for $((wait*2)) seconds" + echo " **restore activating OST$ost, waiting for $((wait*2+2)) seconds" $(do_facet $SINGLEMDS "$LCTL set_param -n $PARAM 1") - sleep $((wait * 2)) + sleep $((wait * 2 + 2)) local flags=$($LFS getstripe -v $file | awk '/lcm_flags:/ { print $2 }') [ $flags = wp ] || error "file mirror state $flags != wp" @@ -1559,30 +1559,33 @@ test_43() { ################## OST0 ########################################### write_file_43 $tf 0 + echo " **verify components" verify_comp_attr lcme_flags $tf 0x10001 init,stale verify_comp_attr lcme_flags $tf 0x20002 init verify_comp_attr lcme_flags $tf 0x30003 init,stale # resync - echo "resync $tf" + echo " **resync $tf" $LFS mirror resync $tf flags=$($LFS getstripe -v $tf | awk '/lcm_flags:/ { print $2 }') [ $flags = ro ] || error "file mirror state $flags != ro" ################## OST1 ########################################### write_file_43 $tf 1 + echo " **verify components" verify_comp_attr lcme_flags $tf 0x10001 init,stale verify_comp_attr lcme_flags $tf 0x20002 init,stale verify_comp_attr lcme_flags $tf 0x30003 init # resync - echo "resync $tf" + echo " **resync $tf" $LFS mirror resync $tf flags=$($LFS getstripe -v $tf | awk '/lcm_flags:/ { print $2 }') [ $flags = ro ] || error "file mirror state $flags != ro" ################## OST2 ########################################### write_file_43 $tf 2 + echo " **verify components" verify_comp_attr lcme_flags $tf 0x10001 init verify_comp_attr lcme_flags $tf 0x20002 init,stale verify_comp_attr lcme_flags $tf 0x30003 init,stale -- 1.8.3.1