init_test_env $@
-. ${CONFIG:=$LUSTRE/tests/cfg/insanity-local.sh}
+. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
+#
+ALWAYS_EXCEPT="10 $INSANITY_EXCEPT"
-ALWAYS_EXCEPT="10 $INSANITY_EXCEPT"
+if [ "$FAILURE_MODE" = "HARD" ]; then
+ mixed_ost_devs && CONFIG_EXCEPTIONS="0 2 4 5 6 8" && \
+ echo -n "Several ost services on one ost node are used with FAILURE_MODE=$FAILURE_MODE. " && \
+ echo "Except the tests: $CONFIG_EXCEPTIONS" && \
+ ALWAYS_EXCEPT="$ALWAYS_EXCEPT $CONFIG_EXCEPTIONS"
+fi
#
-[ "$SLOW" = "no" ] && EXCEPT="$EXCEPT "
+[ "$SLOW" = "no" ] && EXCEPT_SLOW=""
SETUP=${SETUP:-""}
CLEANUP=${CLEANUP:-""}
build_test_filter
+SINGLECLIENT=${SINGLECLIENT:-$HOSTNAME}
+LIVE_CLIENT=${LIVE_CLIENT:-$SINGLECLIENT}
+FAIL_CLIENTS=${FAIL_CLIENTS:-$RCLIENTS}
+
assert_env mds_HOST MDS_MKFS_OPTS
assert_env ost_HOST OST_MKFS_OPTS OSTCOUNT
assert_env LIVE_CLIENT FSNAME
-
-# This can be a regexp, to allow more clients
-CLIENTS=${CLIENTS:-"`comma_list $LIVE_CLIENT $FAIL_CLIENTS $EXTRA_CLIENTS`"}
+# FAIL_CLIENTS list should not contain the LIVE_CLIENT
+FAIL_CLIENTS=$(echo " $FAIL_CLIENTS " | sed -re "s/\s+$LIVE_CLIENT\s+/ /g")
DIR=${DIR:-$MOUNT}
fail_clients() {
num=$1
+
+ log "Request clients to fail: ${num}. Num of clients to fail: ${FAIL_NUM}, already failed: $DOWN_NUM"
if [ -z "$num" ] || [ "$num" -gt $((FAIL_NUM - DOWN_NUM)) ]; then
num=$((FAIL_NUM - DOWN_NUM))
fi
if [ -z "$num" ] || [ "$num" -le 0 ]; then
+ log "No clients failed!"
return
fi
echo "Waiting for df pid: $DFPID"
wait $DFPID || { echo "df returned $?" && return 1; }
- facet_failover ost1 || return 4
- echo "Waiting for df pid: $DFPID"
- wait $DFPID || { echo "df returned $?" && return 2; }
-
- facet_failover ost2 || return 5
- echo "Waiting for df pid: $DFPID"
- wait $DFPID || { echo "df returned $?" && return 3; }
+ for i in $(seq $OSTCOUNT) ; do
+ facet_failover ost$i || return 4
+ echo "Waiting for df pid: $DFPID"
+ wait $DFPID || { echo "df returned $?" && return 3; }
+ done
return 0
}
run_test 0 "Fail all nodes, independently"
############### Second Failure Mode ###############
test_2() {
echo "Verify Lustre filesystem is up and running"
+ [ -z "$(mounted_lustre_filesystems)" ] && error "Lustre is not running"
+
client_df
shutdown_facet $SINGLEMDS
test_3() {
#Create files
echo "Verify Lustre filesystem is up and running"
+ [ -z "$(mounted_lustre_filesystems)" ] && error "Lustre is not running"
#MDS Portion
facet_failover $SINGLEMDS
############### Fifth Failure Mode ###############
test_5() {
+ [ $OSTCOUNT -lt 2 ] && skip "$OSTCOUNT < 2, not enough OSTs" && return 0
+
echo "Fifth Failure Mode: OST/OST `date`"
#Create files
echo "Verify Lustre filesystem is up and running"
+ [ -z "$(mounted_lustre_filesystems)" ] && error "Lustre is not running"
+
client_df
#OST Portion
#Create files
echo "Verify Lustre filesystem is up and running"
- client_df || return 1
+ [ -z "$(mounted_lustre_filesystems)" ] && error "Lustre is not running"
+
+ client_df
client_touch testfile || return 2
#OST Portion
echo "Test Lustre stability after OST failure"
client_df &
DFPIDA=$!
+ echo DFPIDA=$DFPIDA
sleep 5
#CLIENT Portion
echo "Test Lustre stability after CLIENTs failure"
client_df &
DFPIDB=$!
+ echo DFPIDB=$DFPIDB
sleep 5
#Reintegration
echo "Reintegrating OST/CLIENTs"
wait_for ost1
start_ost 1
- reintegrate_clients
+ reintegrate_clients || return 1
sleep 5
+ wait_remote_prog df $((TIMEOUT * 3 + 10))
wait $DFPIDA
wait $DFPIDB
+
echo "Verifying mount"
- client_df || return 3
+ [ -z "$(mounted_lustre_filesystems)" ] && return 3
+ client_df
}
run_test 6 "Sixth Failure Mode: OST/CLIENT `date`"
###################################################
#Create files
echo "Verify Lustre filesystem is up and running"
+ [ -z "$(mounted_lustre_filesystems)" ] && error "Lustre is not running"
+
client_df
client_touch testfile || return 1
#Create files
echo "Verify Lustre filesystem is up and running"
+ [ -z "$(mounted_lustre_filesystems)" ] && return 2
+
client_df
client_rm testfile
#Reintegration
echo "Reintegrating CLIENTs"
- reintegrate_clients
- client_df || return 2
+ reintegrate_clients || return 2
+ client_df
#Sleep
echo "wait 1 minutes"
#Create files
echo "Verify Lustre filesystem is up and running"
+ [ -z "$(mounted_lustre_filesystems)" ] && error "Lustre is not running"
+
client_df
client_touch testfile
#Create files
echo "Verify Lustre filesystem is up and running"
+ [ -z "$(mounted_lustre_filesystems)" ] && error "Lustre is not running"
+
client_df
client_touch testfile
#Reintegration
echo "Reintegrating CLIENTs/OST"
- reintegrate_clients
+ reintegrate_clients || return 3
wait_for ost1
start_ost 1
wait $DFPID
#Create files
echo "Verify Lustre filesystem is up and running"
+ [ -z "$(mounted_lustre_filesystems)" ] && error "Lustre is not running"
+
client_df
client_touch testfile || return 1
#Reintegration
echo "Reintegrating CLIENTs/CLIENTs"
- reintegrate_clients
- client_df || return 7
+ reintegrate_clients || return 7
+ client_df
#Sleep
echo "Wait 1 minutes"