X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Freplay-ost-single.sh;h=8babef8685486bd9f8fbb2d45489d3fe737d00fc;hp=0f4194baef976bb1cdae4866e78871ebf59f4881;hb=7136981bfaad8b95e15e9d2969b94c933491eb98;hpb=5d37670e8507563db556879041c7992936aefa56 diff --git a/lustre/tests/replay-ost-single.sh b/lustre/tests/replay-ost-single.sh index 0f4194b..8babef8 100755 --- a/lustre/tests/replay-ost-single.sh +++ b/lustre/tests/replay-ost-single.sh @@ -19,10 +19,6 @@ init_logging require_dsh_ost || exit 0 -# Tests that fail on uml -CPU=`awk '/model/ {print $4}' /proc/cpuinfo` -[ "$CPU" = "UML" ] && EXCEPT="$EXCEPT 6" - # Skip these tests # BUG NUMBER: ALWAYS_EXCEPT="$REPLAY_OST_SINGLE_EXCEPT" @@ -30,6 +26,10 @@ ALWAYS_EXCEPT="$REPLAY_OST_SINGLE_EXCEPT" # [ "$SLOW" = "no" ] && EXCEPT_SLOW="5" +[ $(facet_fstype $SINGLEMDS) = "zfs" ] && +# bug number for skipped test: LU-2285 + ALWAYS_EXCEPT="$ALWAYS_EXCEPT 3" + build_test_filter check_and_setup_lustre @@ -164,6 +164,7 @@ test_5() { rc=$? log "iozone rc=$rc" rm -f $TDIR/$tfile + wait_delete_completed_mds [ $rc -eq 0 ] || error "iozone failed" return $rc } @@ -207,7 +208,7 @@ test_6() { sync # let the delete happen wait_mds_ost_sync || return 4 - wait_destroy_complete || return 5 + wait_delete_completed || return 5 after=`kbytesfree` log "before: $before after: $after" (( $before <= $after + 40 )) || return 3 # take OST logs into account @@ -240,7 +241,7 @@ test_7() { sync # let the delete happen wait_mds_ost_sync || return 4 - wait_destroy_complete || return 5 + wait_delete_completed || return 5 after=`kbytesfree` log "before: $before after: $after" (( $before <= $after + 40 )) || return 3 # take OST logs into account @@ -248,98 +249,125 @@ test_7() { run_test 7 "Fail OST before obd_destroy" test_8a() { - verify=$ROOT/tmp/verify-$$ - dd if=/dev/urandom of=$verify bs=4096 count=1280 || - error "Create verify file failed" -#define OBD_FAIL_OST_DQACQ_NET 0x230 - do_facet ost1 "lctl set_param fail_loc=0x230" - dd if=$verify of=$TDIR/$tfile bs=4096 count=1280 oflag=sync & - ddpid=$! - sleep $TIMEOUT # wait for the io to become redo io - if ! ps -p $ddpid > /dev/null 2>&1; then - error "redo io finished incorrectly" - return 1 - fi - do_facet ost1 "lctl set_param fail_loc=0" - wait $ddpid || return 1 - cancel_lru_locks osc - cmp $verify $TDIR/$tfile || return 2 - rm -f $verify $TDIR/$tfile + [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.3.0) ]] || + { skip "Need MDS version at least 2.3.0"; return; } + verify=$ROOT/tmp/verify-$$ + dd if=/dev/urandom of=$verify bs=4096 count=1280 || + error "Create verify file failed" +#define OBD_FAIL_OST_DQACQ_NET 0x230 + do_facet ost1 "lctl set_param fail_loc=0x230" + dd if=$verify of=$TDIR/$tfile bs=4096 count=1280 oflag=sync & + ddpid=$! + sleep $TIMEOUT # wait for the io to become redo io + if ! ps -p $ddpid > /dev/null 2>&1; then + error "redo io finished incorrectly" + return 1 + fi + do_facet ost1 "lctl set_param fail_loc=0" + wait $ddpid || true + cancel_lru_locks osc + cmp $verify $TDIR/$tfile || return 2 + rm -f $verify $TDIR/$tfile + message=`dmesg | grep "redo for recoverable error -115"` + [ -z "$message" ] || error "redo error messages found in dmesg" } run_test 8a "Verify redo io: redo io when get -EINPROGRESS error" test_8b() { - verify=$ROOT/tmp/verify-$$ - dd if=/dev/urandom of=$verify bs=4096 count=1280 || - error "Create verify file failed" -#define OBD_FAIL_OST_DQACQ_NET 0x230 - do_facet ost1 "lctl set_param fail_loc=0x230" - dd if=$verify of=$TDIR/$tfile bs=4096 count=1280 oflag=sync & - ddpid=$! - sleep $TIMEOUT # wait for the io to become redo io - fail ost1 - do_facet ost1 "lctl set_param fail_loc=0" - wait $ddpid || return 1 - cancel_lru_locks osc - cmp $verify $TDIR/$tfile || return 2 - rm -f $verify $TDIR/$tfile + [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.3.0) ]] || + { skip "Need MDS version at least 2.3.0"; return; } + verify=$ROOT/tmp/verify-$$ + dd if=/dev/urandom of=$verify bs=4096 count=1280 || + error "Create verify file failed" +#define OBD_FAIL_OST_DQACQ_NET 0x230 + do_facet ost1 "lctl set_param fail_loc=0x230" + dd if=$verify of=$TDIR/$tfile bs=4096 count=1280 oflag=sync & + ddpid=$! + sleep $TIMEOUT # wait for the io to become redo io + fail ost1 + do_facet ost1 "lctl set_param fail_loc=0" + wait $ddpid || return 1 + cancel_lru_locks osc + cmp $verify $TDIR/$tfile || return 2 + rm -f $verify $TDIR/$tfile } run_test 8b "Verify redo io: redo io should success after recovery" test_8c() { - verify=$ROOT/tmp/verify-$$ - dd if=/dev/urandom of=$verify bs=4096 count=1280 || - error "Create verify file failed" -#define OBD_FAIL_OST_DQACQ_NET 0x230 - do_facet ost1 "lctl set_param fail_loc=0x230" - dd if=$verify of=$TDIR/$tfile bs=4096 count=1280 oflag=sync & - ddpid=$! - sleep $TIMEOUT # wait for the io to become redo io - ost_evict_client - # allow recovery to complete - sleep $((TIMEOUT + 2)) - do_facet ost1 "lctl set_param fail_loc=0" - wait $ddpid - cancel_lru_locks osc - cmp $verify $TDIR/$tfile && return 2 - rm -f $verify $TDIR/$tfile + [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.3.0) ]] || + { skip "Need MDS version at least 2.3.0"; return; } + verify=$ROOT/tmp/verify-$$ + dd if=/dev/urandom of=$verify bs=4096 count=1280 || + error "Create verify file failed" +#define OBD_FAIL_OST_DQACQ_NET 0x230 + do_facet ost1 "lctl set_param fail_loc=0x230" + dd if=$verify of=$TDIR/$tfile bs=4096 count=1280 oflag=sync & + ddpid=$! + sleep $TIMEOUT # wait for the io to become redo io + ost_evict_client + # allow recovery to complete + sleep $((TIMEOUT + 2)) + do_facet ost1 "lctl set_param fail_loc=0" + wait $ddpid + cancel_lru_locks osc + cmp $verify $TDIR/$tfile && return 2 + rm -f $verify $TDIR/$tfile } run_test 8c "Verify redo io: redo io should fail after eviction" - -test_9d() { -#define OBD_FAIL_MDS_DQACQ_NET 0x187 - do_facet $SINGLEMDS "lctl set_param fail_loc=0x187" - # test the non-intent create path - mcreate $TDIR/$tfile & - cpid=$! - sleep $TIMEOUT - if ! ps -p $cpid > /dev/null 2>&1; then - error "mknod finished incorrectly" - return 1 - fi - do_facet $SINGLEMDS "lctl set_param fail_loc=0" - wait $cpid || return 2 - stat $TDIR/$tfile || error "mknod failed" - - rm $TDIR/$tfile - -#define OBD_FAIL_MDS_DQACQ_NET 0x187 - do_facet $SINGLEMDS "lctl set_param fail_loc=0x187" - # test the intent create path - openfile -f O_RDWR:O_CREAT $TDIR/$tfile & - cpid=$! - sleep $TIMEOUT - if ! ps -p $cpid > /dev/null 2>&1; then - error "open finished incorrectly" - return 3 - fi - do_facet $SINGLEMDS "lctl set_param fail_loc=0" - wait $cpid || return 4 - stat $TDIR/$tfile || error "open failed" +test_8d() { + [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.3.0) ]] || + { skip "Need MDS version at least 2.3.0"; return; } +#define OBD_FAIL_MDS_DQACQ_NET 0x187 + do_facet $SINGLEMDS "lctl set_param fail_loc=0x187" + # test the non-intent create path + mcreate $TDIR/$tfile & + cpid=$! + sleep $TIMEOUT + if ! ps -p $cpid > /dev/null 2>&1; then + error "mknod finished incorrectly" + return 1 + fi + do_facet $SINGLEMDS "lctl set_param fail_loc=0" + wait $cpid || return 2 + stat $TDIR/$tfile || error "mknod failed" + + rm $TDIR/$tfile + +#define OBD_FAIL_MDS_DQACQ_NET 0x187 + do_facet $SINGLEMDS "lctl set_param fail_loc=0x187" + # test the intent create path + openfile -f O_RDWR:O_CREAT $TDIR/$tfile & + cpid=$! + sleep $TIMEOUT + if ! ps -p $cpid > /dev/null 2>&1; then + error "open finished incorrectly" + return 3 + fi + do_facet $SINGLEMDS "lctl set_param fail_loc=0" + wait $cpid || return 4 + stat $TDIR/$tfile || error "open failed" +} +run_test 8d "Verify redo creation on -EINPROGRESS" + +test_8e() { + [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.3.0) ]] || + { skip "Need MDS version at least 2.3.0"; return; } + 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 & + 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!" + return 1 + fi + do_facet ost1 "lctl set_param fail_loc=0" } -run_test 9d "Verify redo creation on -EINPROGRESS" +run_test 8e "Verify that ptlrpc resends request on -EINPROGRESS" -complete $(basename $0) $SECONDS +complete $SECONDS check_and_cleanup_lustre exit_status