set -e
-export MULTIOP=${MULTIOP:-multiop}
PTLDEBUG=${PTLDEBUG:--1}
-LUSTRE=${LUSTRE:-`dirname $0`/..}
+LUSTRE=${LUSTRE:-$(dirname $0)/..}
. $LUSTRE/tests/test-framework.sh
init_test_env $@
-. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
init_logging
ALWAYS_EXCEPT="$RECOVERY_SMALL_EXCEPT "
# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
fi
-selinux_status=$(getenforce)
-if [ "$selinux_status" != "Disabled" ]; then
- # bug number for skipped test: LU-12928
- $SHARED_KEY && ALWAYS_EXCEPT+=" 136"
-fi
+build_test_filter
require_dsh_mds || exit 0
-# also long tests: 19, 21a, 21e, 21f, 23, 27
-
-[ "$SLOW" = "no" ] && EXCEPT_SLOW=""
-
-build_test_filter
-
# Allow us to override the setup if we already have a mounted system by
# setting SETUP=" " and CLEANUP=" "
SETUP=${SETUP:-""}
for i in $SEQ
do
#echo failover in $i sec
- log "test_$testnum: failover in $i sec"
+ log "$TESTNAME: failover in $i sec"
sleep $i
facet_failover $SINGLEMDS
done
mount_client $DIR2
#grant lock1, export2
- $SETSTRIPE -i -0 $DIR2/$tfile || return 1
- $MULTIOP $DIR2/$tfile Ow || return 2
+ $LFS setstripe -i -0 $DIR2/$tfile || error "setstripe failed"
+ $MULTIOP $DIR2/$tfile Ow || error "multiop failed"
#define OBD_FAIL_LDLM_BL_EVICT 0x31e
do_facet ost $LCTL set_param fail_loc=0x31e
# Since the client just mounted, its last_rcvd entry is not on disk.
# Send an RPC so exp_need_sync forces last_rcvd to commit this export
# so the client can reconnect during OST recovery (LU-924, LU-1582)
- $SETSTRIPE -i 0 $DIR/$tfile
+ $LFS setstripe -i 0 $DIR/$tfile
dd if=/dev/zero of=$DIR/$tfile bs=1M count=1 conv=sync
# make sure MGS's state is Partial
test_108() {
mkdir -p $DIR/$tdir
- $SETSTRIPE -c 1 -i 0 $DIR/$tdir
+ $LFS setstripe -c 1 -i 0 $DIR/$tdir
dd if=/dev/zero of=$DIR/$tdir/$tfile bs=1M count=256 &
local dd_pid=$!
drop_update_reply $mdtidx "$LFS mkdir -i $mdtidx -c2 $remote_dir" ||
error "lfs mkdir failed"
- diridx=$($GETSTRIPE -m $remote_dir)
+ diridx=$($LFS getstripe -m $remote_dir)
[ $diridx -eq $mdtidx ] || error "$diridx != $mdtidx"
rm -rf $DIR/$tdir || error "rmdir failed"
rm -f $DIR/$tfile
# get a lock on client so that export would reach the stale list
- $SETSTRIPE -i 0 $DIR/$tfile || error "setstripe failed"
+ $LFS setstripe -i 0 $DIR/$tfile || error "setstripe failed"
dd if=/dev/zero of=$DIR/$tfile bs=4096 count=1 conv=fsync ||
error "dd failed"
rm -f $DIR/$tfile
# get a lock on client so that export would reach the stale list
- $SETSTRIPE -i 0 $DIR/$tfile || error "setstripe failed"
+ $LFS setstripe -i 0 $DIR/$tfile || error "setstripe failed"
dd if=/dev/zero of=$DIR/$tfile count=1 || error "dd failed"
# another IO under the same lock
}
run_test 137 "late resend must be skipped if already applied"
+test_138() {
+ remote_mds_nodsh && skip "remote MDS with nodsh"
+ [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
+ [[ "$MDS1_VERSION" -ge $(version_code 2.12.59) ]] ||
+ skip "Need server version newer than 2.12.59"
+
+ zconf_umount_clients $CLIENTS $MOUNT
+
+#define OBD_FAIL_TGT_RECOVERY_CONNECT 0x724
+ #delay a first step of recovey when MDS waiting clients
+ #and failing to get osp logs
+ do_facet $SINGLEMDS $LCTL set_param fail_loc=0x724 fail_val=5
+
+ facet_failover $SINGLEMDS
+
+ #waiting failover and recovery timer
+ #the valuse is based on target_recovery_overseer() wait_event timeout
+ sleep 55
+ stop $SINGLEMDS || error "stop MDS failed"
+ do_facet $SINGLEMDS $LCTL set_param fail_loc=0
+ start $SINGLEMDS $(mdsdevname ${SINGLEMDS//mds/}) ||
+ error "start MDS failed"
+ zconf_mount_clients $CLIENTS $MOUNT
+}
+run_test 138 "Umount MDT during recovery"
+
+test_139() {
+ [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
+ [ $MDS1_VERSION -lt $(version_code 2.13.50) ] &&
+ skip "Need MDS version at least 2.13.50"
+
+ mdt_dev=$(mdsdevname 1)
+
+ stop $SINGLEMDS || error "stop $SINGLEMDS failed"
+
+#define OBD_FAIL_OSP_INVALID_LOGID 0x2106
+ do_facet $SINGLEMDS $LCTL set_param fail_val=0x68 fail_loc=0x80002106
+ start $SINGLEMDS $mdt_dev $MDS_MOUNT_OPTS || error "Fail to start MDT"
+}
+run_test 139 "corrupted catid won't cause crash"
+
complete $SECONDS
check_and_cleanup_lustre
exit_status