X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Freplay-ost-single.sh;h=9764e6bd4073b7e82e2c71570848dfd5a3d72514;hp=476b91d224537b4cd73d452b5ea2fd301c31f2a5;hb=dc52a88cde1e7cea093b25fc9a15509fe0ac527a;hpb=28497055cdac33293122b73e62c00555a32a5f88 diff --git a/lustre/tests/replay-ost-single.sh b/lustre/tests/replay-ost-single.sh index 476b91d..9764e6b 100755 --- a/lustre/tests/replay-ost-single.sh +++ b/lustre/tests/replay-ost-single.sh @@ -22,15 +22,17 @@ ALWAYS_EXCEPT="$REPLAY_OST_SINGLE_EXCEPT" # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT! # bug number for SLOW test: -# 40 (min)" +# time in minutes: 40" [ "$SLOW" = "no" ] && EXCEPT_SLOW="5" if [ $(facet_fstype $SINGLEMDS) = "zfs" ]; then -# bug number for skipped test: LU-2285 - ALWAYS_EXCEPT="$ALWAYS_EXCEPT 3" -# bug number for slowed tests: LU-2887 - # 32 12.5 (min)" - [ "$SLOW" = "no" ] && EXCEPT_SLOW="$EXCEPT_SLOW 8a 8b" +# bug number for slow tests: LU-2887 +# time in minutes: 32 12.5" + [ "$SLOW" = "no" ] && EXCEPT_SLOW+=" 8a 8b" + if [ $MDSCOUNT -gt 1 ]; then +# bug number for skipped test: + ALWAYS_EXCEPT+="" + fi fi build_test_filter @@ -41,15 +43,15 @@ rm -rf $DIR/[df][0-9]* TDIR=$DIR/d0.${TESTSUITE} mkdir -p $TDIR -$SETSTRIPE $TDIR -i 0 -c 1 -$GETSTRIPE $TDIR +$LFS setstripe $TDIR -i 0 -c 1 +$LFS getstripe $TDIR test_0a() { zconf_umount $(hostname) $MOUNT -f # needs to run during initial client->OST connection #define OBD_FAIL_OST_ALL_REPLY_NET 0x211 do_facet ost1 "lctl set_param fail_loc=0x80000211" - zconf_mount $(hostname) $MOUNT && df $MOUNT || error "0a mount fail" + zconf_mount $(hostname) $MOUNT && $LFS df $MOUNT || error "mount fail" } run_test 0a "target handle mismatch (bug 5317)" @@ -159,7 +161,8 @@ test_5() { if (( size > GB )); then size=$GB fi - local iozone_opts="-i 0 -i 1 -i 2 -+d -r 4 -s $size -f $TDIR/$tfile" + # no random I/O (-i 2) as it's very slow with ZFS + local iozone_opts="-i 0 -i 1 -+d -r 4 -s $size -f $TDIR/$tfile" iozone_bg $iozone_opts & local pid=$! @@ -196,7 +199,7 @@ test_6() { local before=$(kbytesfree) dd if=/dev/urandom bs=4096 count=1280 of=$f || error "dd failed" - $GETSTRIPE $f || error "$GETSTRIPE $f failed" + $LFS getstripe $f || error "$LFS getstripe $f failed" local stripe_index=$(lfs getstripe -i $f) sync @@ -382,12 +385,12 @@ test_8e() { sleep 1 # ensure we have a fresh statfs #define OBD_FAIL_OST_STATFS_EINPROGRESS 0x231 do_facet ost1 "lctl set_param fail_loc=0x231" - df $MOUNT & + $LFS df $MOUNT & dfpid=$! sleep $TIMEOUT if ! ps -p $dfpid > /dev/null 2>&1; then - do_facet ost1 "lctl set_param fail_loc=0" - error "df shouldn't have completed!" + do_facet ost1 "lctl set_param fail_loc=0" + error "df shouldn't have completed!" fi } run_test 8e "Verify that ptlrpc resends request on -EINPROGRESS" @@ -395,7 +398,11 @@ run_test 8e "Verify that ptlrpc resends request on -EINPROGRESS" test_9() { [ $(lustre_version_code ost1) -ge $(version_code 2.6.54) ] || { skip "Need OST version at least 2.6.54"; return; } - $SETSTRIPE -i 0 -c 1 $DIR/$tfile || "setstripe failed" + $LFS setstripe -i 0 -c 1 $DIR/$tfile || error "setstripe failed" + + # LU-1573 - Add duplicate write to generate grants + dd if=/dev/zero of=$DIR/$tfile count=1 bs=1M > /dev/null || + error "First write failed" replay_barrier ost1 # do IO dd if=/dev/zero of=$DIR/$tfile count=1 bs=1M > /dev/null || @@ -413,6 +420,68 @@ test_9() { } run_test 9 "Verify that no req deadline happened during recovery" +test_10() { + rm -f $TDIR/$tfile + + dd if=/dev/zero of=$TDIR/$tfile count=10 || error "dd failed" + + #define OBD_FAIL_OSC_DELAY_IO 0x414 + $LCTL set_param fail_val=60 fail_loc=0x414 + cancel_lru_locks OST0000-osc & + sleep 2 + facet_failover ost1 || error "failover: $?" + + #define OBD_FAIL_LDLM_GRANT_CHECK 0x32a + $LCTL set_param fail_loc=0x32a + stat $TDIR/$tfile + + wait +} +run_test 10 "conflicting PW & PR locks on a client" + +test_12() { + [ $FAILURE_MODE != "HARD" ] && + skip "Test needs FAILURE_MODE HARD" && return 0 + remote_ost || { skip "need remote OST" && return 0; } + + local tmp=$TMP/$tdir + local dir=$DIR/$tdir + declare -a pids + + + mkdir -p $tmp || error "can't create $tmp" + mkdir -p $dir || error "can't create $dir" + + $LFS setstripe -c 1 -i 0 $dir + + for i in `seq 1 10`; do mkdir $dir/d$i; done + + #define OBD_FAIL_OST_DELAY_TRANS 0x245 + do_facet ost1 "$LCTL set_param fail_loc=0x245" || + error "can't set fail_loc" + + for i in `seq 1 10`; + do + createmany -o $dir/d$i/$(openssl rand -base64 12) 500 & + pids+=($!) + done + echo "Waiting createmany pids" + wait ${pids[@]} + + ls -lR $dir > $tmp/ls_r_out 2>&1& + local ls_pid=$! + + facet_failover ost1 + + echo "starting wait for ls -l" + wait $ls_pid + grep "?\|No such file or directory" $tmp/ls_r_out && + error "Found file without object on OST" + rm -rf $tmp + rm -rf $dir +} +run_test 12 "check stat after OST failover" + complete $SECONDS check_and_cleanup_lustre exit_status