# This is the default set of tests to run.
DEFAULT_SUITES="runtests sanity sanity-benchmark sanityn lfsck liblustre
runracer replay-single conf-sanity recovery-small
- replay-ost-single replay-dual insanity sanity-quota sanity-sec
- sanity-gss performance-sanity large-scale recovery-mds-scale
- recovery-double-scale recovery-random-scale parallel-scale
- lustre_rsync-test metadata-updates ost-pools lnet-selftest
- mmp obdfilter-survey sgpdd-survey"
+ replay-ost-single replay-dual replay-vbr insanity sanity-quota
+ sanity-sec sanity-gss performance-sanity large-scale
+ recovery-mds-scale recovery-double-scale recovery-random-scale
+ parallel-scale lustre_rsync-test metadata-updates ost-pools
+ lnet-selftest mmp obdfilter-survey sgpdd-survey"
if [[ -n $@ ]]; then
ACC_SM_ONLY="${ACC_SM_ONLY} $@"
log "-----============= acceptance-small: "$*" ============----- $(date)"
}
-is_sanity_benchmark() {
- local benchmarks="dbench bonnie iozone fsx"
- local suite=$1
- for b in $benchmarks; do
- if [ "$b" == "$suite" ]; then
- return 0
- fi
- done
- return 1
-}
-
run_suite() {
local suite_name=$(echo ${1%.sh} | tr "[:upper:]_" "[:lower:]-" )
local suite=$(echo ${suite_name} | tr "[:lower:]-" "[:upper:]_")
if ! combined_mgs_mds ; then
stop mgs
fi
+
cleanup_gss
-equals_msg `basename $0`: test complete
-[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true
+
+complete $(basename $0) $SECONDS
+exit_status
}
run_test 10 "Running Availability for 6 hours..."
-equals_msg `basename $0`: test complete, cleaning up
+complete $(basename $0) $SECONDS
check_and_cleanup_lustre
-[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true
+exit_status
run_test 3a "recovery time, $CLIENTCOUNT clients"
-equals_msg `basename $0`: test complete, cleaning up
+complete $(basename $0) $SECONDS
check_and_cleanup_lustre
-[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG || true
+exit_status
fi
fi
-equals_msg $(basename $0): test complete, cleaning up
-
LFSCK_ALWAYS=no
-check_and_cleanup_lustre
-[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && \
- grep -q FAIL $TESTSUITELOG && exit 1 || true
-echo "$0: completed"
+complete $(basename $0) $SECONDS
+check_and_cleanup_lustre
+exit_status
}
run_test 1 "liblustre sanity"
-banner "test complete, cleaning up"
+complete $(basename $0) $SECONDS
check_and_cleanup_lustre
-[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true
+exit_status
}
run_test smoke "lst regression test"
-equals_msg `basename $0`: test complete, cleaning up
+complete $(basename $0) $SECONDS
if [ "$RESTORE_MOUNT" = yes ]; then
setupall
fi
-[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true
-
+exit_status
. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
init_logging
-REPLLOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
-
-[ "$REPLLOG" ] && rm -f $REPLLOG || true
-
check_and_setup_lustre
DIR=${DIR:-$MOUNT}
}
run_test 9 "Replicate recursive directory removal"
-log "cleanup: ======================================================"
cd $ORIG_PWD
+complete $(basename $0) $SECONDS
check_and_cleanup_lustre
-echo '=========================== finished ==============================='
-[ -f "$REPLLOG" ] && cat $REPLLOG && grep -q FAIL $REPLLOG && exit 1 || true
-echo "$0: completed"
+exit_status
skip_env "$0 : write_disjoint not found "
fi
-equals_msg `basename $0`: test complete, cleaning up
+complete $(basename $0) $SECONDS
rm -rf $TESTDIR
rm -f $MACHINEFILE
check_and_cleanup_lustre
-exit $STATUS
+exit_status
mmp_fini
FAIL_ON_ERROR=$SAVED_FAIL_ON_ERROR
-equals_msg $(basename $0): test complete
+complete $(basename $0) $SECONDS
$MMP_RESTORE_MOUNT && setupall
-[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && \
- grep -q FAIL $TESTSUITELOG && exit 1 || true
-echo "$0: completed"
+exit_status
}
run_test 3a "Network survey"
-equals_msg `basename $0`: test complete, cleaning up
+complete $(basename $0) $SECONDS
cleanup_echo_devs
check_and_cleanup_lustre
-[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true
+exit_status
DIR=${DIR:-$MOUNT}
assert_DIR
-POOLSLOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
-[ "$POOLSLOG" ] && rm -f $POOLSLOG || true
build_test_filter
FAIL_ON_ERROR=${FAIL_ON_ERROR:-true}
}
run_test 26 "Choose other OSTs in the pool first in the creation remedy"
-log "cleanup: ======================================================"
cd $ORIG_PWD
+
+complete $(basename $0) $SECONDS
cleanup_pools $FSNAME
check_and_cleanup_lustre
-echo '=========================== finished ==============================='
-[ -f "$POOLSLOG" ] && cat $POOLSLOG && grep -q FAIL $POOLSLOG && exit 1 || true
-echo "$0: completed"
+exit_status
run_test statahead "statahead test, multiple clients"
-equals_msg `basename $0`: test complete, cleaning up
+complete $(basename $0) $SECONDS
check_and_cleanup_lustre
-[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true
+exit_status
}
run_test 8 "getattr large files ======"
-equals_msg `basename $0`: test complete, cleaning up
+complete $(basename $0) $SECONDS
check_and_cleanup_lustre
[ -f "$LOG" ] && cat $LOG || true
-[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true
+exit_status
}
run_test 61 "Verify to not reuse orphan objects - bug 17025"
-equals_msg `basename $0`: test complete, cleaning up
+complete $(basename $0) $SECONDS
check_and_cleanup_lustre
-[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true
+exit_status
# end commit on sharing tests
-equals_msg `basename $0`: test complete, cleaning up
+complete $(basename $0) $SECONDS
SLEEP=$((`date +%s` - $NOW))
[ $SLEEP -lt $TIMEOUT ] && sleep $SLEEP
[ "$MOUNTED2" = yes ] && zconf_umount $HOSTNAME $MOUNT2 || true
check_and_cleanup_lustre
-[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true
+exit_status
}
run_test 7 "Fail OST before obd_destroy"
-equals_msg `basename $0`: test complete, cleaning up
+complete $(basename $0) $SECONDS
check_and_cleanup_lustre
-[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true
+exit_status
run_test 89 "no disk space leak on late ost connection"
-equals_msg `basename $0`: test complete, cleaning up
+complete $(basename $0) $SECONDS
check_and_cleanup_lustre
-[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true
+exit_status
[ "$CLIENTS" ] && zconf_mount_clients $CLIENTS $DIR
-equals_msg `basename $0`: test complete, cleaning up
+complete $(basename $0) $SECONDS
check_and_cleanup_lustre
-[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true
+exit_status
}
run_test 1 "racer on clients: $CLIENTS DURATION=$DURATION"
-equals_msg `basename $0`: test complete, cleaning up
+complete $(basename $0) $SECONDS
check_and_cleanup_lustre
-[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true
+exit_status
echo "Space not all freed: now ${NOWUSED}kB, was ${USED}kB." 1>&2
fi
+complete $(basename $0) $SECONDS
rm -f $FILES
check_and_cleanup_lustre
+exit_status
}
run_test pios_fpp "pios file per process"
-equals_msg `basename $0`: test complete, cleaning up
+complete $(basename $0) $SECONDS
check_and_cleanup_lustre
-[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true
+exit_status
}
run_test 151 "secure mgs connection: server flavor control"
-equals_msg `basename $0`: test complete, cleaning up
+complete $(basename $0) $SECONDS
check_and_cleanup_lustre
-[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true
+exit_status
}
quota_fini
-log "cleanup: ======================================================"
cd $ORIG_PWD
+complete $(basename $0) $SECONDS
check_and_cleanup_lustre
-echo '=========================== finished ==============================='
export QUOTA_AUTO=$QUOTA_AUTO_OLD
-[ -f "$QUOTALOG" ] && cat $QUOTALOG && grep -q FAIL $QUOTALOG && exit 1 || true
-echo "$0: completed"
+exit_status
CONFDIR=/etc/lustre
PERM_CONF=$CONFDIR/perm.conf
-SANITYSECLOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
FAIL_ON_ERROR=false
require_dsh_mds || exit 0
sec_cleanup
-echo '=========================== finished ==============================='
-[ -f "$SANITYSECLOG" ] && \
- cat $SANITYSECLOG && grep -q FAIL $SANITYSECLOG && exit 1 || true
-echo "$0 completed"
+complete $(basename $0) $SECONDS
+exit_status
[ "$SLOW" = "no" ] && EXCEPT_SLOW="24o 24v 27m 36f 36g 36h 51b 51c 60c 63 64b 68 71 73 77f 78 101 103 115 120g 124b"
-SANITYLOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
FAIL_ON_ERROR=false
cleanup() {
exit 0
fi
-[ "$SANITYLOG" ] && rm -f $SANITYLOG || true
-
check_and_setup_lustre
DIR=${DIR:-$MOUNT}
}
run_test 900 "umount should not race with any mgc requeue thread"
-log "cleanup: ======================================================"
+complete $(basename $0) $SECONDS
check_and_cleanup_lustre
if [ "$I_MOUNTED" != "yes" ]; then
lctl set_param debug="$OLDDEBUG" 2> /dev/null || true
fi
-
-echo '=========================== finished ==============================='
-[ -f "$SANITYLOG" ] && cat $SANITYLOG && grep -q FAIL $SANITYLOG && exit 1 || true
-echo "$0: completed"
+exit_status
[ "$SLOW" = "no" ] && EXCEPT_SLOW="12 16 23 33a"
-SANITYLOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
FAIL_ON_ERROR=false
SETUP=${SETUP:-:}
TRACE=${TRACE:-""}
-[ "$SANITYLOG" ] && rm -f $SANITYLOG || true
-
check_and_setup_lustre
LOVNAME=`lctl get_param -n llite.*.lov.common_name | tail -n 1`
log "cleanup: ======================================================"
[ "$(mount | grep $MOUNT2)" ] && umount $MOUNT2
-check_and_cleanup_lustre
-echo '=========================== finished ==============================='
-[ -f "$SANITYLOG" ] && cat $SANITYLOG && grep -q FAIL $SANITYLOG && exit 1 || true
-echo "$0: completed"
+complete $(basename $0) $SECONDS
+check_and_cleanup_lustre
+exit_status
}
run_test 2 "sgpdd-survey, osts, scsidevs"
-equals_msg `basename $0`: test complete, cleaning up
-[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG || true
+complete $(basename $0) $SECONDS
+exit_status
print_summary () {
trap 0
[ "$TESTSUITE" == "lfsck" ] && return 0
- [ -n "$ONLY" ] && echo "WARNING: ONLY is set to ${ONLY}."
- local form="%-13s %-17s %s\n"
- printf "$form" "status" "script" "skipped tests E(xcluded) S(low)"
+ [ -n "$ONLY" ] && echo "WARNING: ONLY is set to $(echo $ONLY)"
+ local details
+ local form="%-13s %-17s %-9s %s %s\n"
+ printf "$form" "status" "script" "Total(sec)" "E(xcluded) S(low)"
echo "------------------------------------------------------------------------------------"
for O in $DEFAULT_SUITES; do
- local skipped=""
- local slow=""
O=$(echo $O | tr "-" "_" | tr "[:lower:]" "[:upper:]")
- local o=$(echo $O | tr "[:upper:]" "[:lower:]")
- o=${o//_/-}
+ [ "${!O}" = "no" ] && continue || true
+ local o=$(echo $O | tr "[:upper:]_" "[:lower:]-")
local log=${TMP}/${o}.log
- [ -f $log ] && skipped=$(grep excluded $log | awk '{ printf " %s", $3 }' | sed 's/test_//g')
- [ -f $log ] && slow=$(grep SLOW $log | awk '{ printf " %s", $3 }' | sed 's/test_//g')
- [ "${!O}" = "done" ] && \
- printf "$form" "Done" "$O" "E=$skipped" && \
- [ -n "$slow" ] && printf "$form" "-" "-" "S=$slow"
-
+ if is_sanity_benchmark $o; then
+ log=${TMP}/sanity-benchmark.log
+ fi
+ local slow=
+ local skipped=
+ local total=
+ local status=Unfinished
+ if [ -f $log ]; then
+ skipped=$(grep excluded $log | awk '{ printf " %s", $3 }' | sed 's/test_//g')
+ slow=$(egrep "^PASS|^FAIL" $log | tr -d "("| sed s/s\)$//g | sort -nr -k 3 | head -5 | awk '{ print $2":"$3"s" }')
+ total=$(grep duration $log | awk '{ print $2}')
+ if [ "${!O}" = "done" ]; then
+ status=Done
+ fi
+ if $DDETAILS; then
+ local durations=$(egrep "^PASS|^FAIL" $log | tr -d "("| sed s/s\)$//g | awk '{ print $2":"$3"|" }')
+ details=$(printf "%s\n%s %s %s\n" "$details" "DDETAILS" "$O" "$(echo $durations)")
+ fi
+ fi
+ printf "$form" $status "$O" "${total}" "E=$skipped"
+ printf "$form" "-" "-" "-" "S=$(echo $slow)"
done
for O in $DEFAULT_SUITES; do
O=$(echo $O | tr "-" "_" | tr "[:lower:]" "[:upper:]")
if [ "${!O}" = "no" ]; then
- # FIXME.
- # only for those tests suits which are run directly from acc-sm script:
- # bonnie, iozone, etc.
- if [ -f "$TESTSUITELOG" ] && grep FAIL $TESTSUITELOG | grep -q ' '$O ; then
- printf "$form" "UNFINISHED" "$O" ""
- else
- printf "$form" "Skipped" "$O" ""
- fi
+ printf "$form" "Skipped" "$O" ""
fi
done
- for O in $DEFAULT_SUITES; do
- O=$(echo $O | tr "-" "_" | tr "[:lower:]" "[:upper:]")
- [ "${!O}" = "done" -o "${!O}" = "no" ] || \
- printf "$form" "UNFINISHED" "$O" ""
- done
+ # print the detailed tests durations if DDETAILS=true
+ if $DDETAILS; then
+ echo "$details"
+ fi
}
init_test_env() {
shift $((OPTIND - 1))
ONLY=${ONLY:-$*}
+ # print the durations of each test if "true"
+ DDETAILS=${DDETAILS:-false}
[ "$TESTSUITELOG" ] && rm -f $TESTSUITELOG || true
rm -f $TMP/*active
}
echo "$@" > $LOGDIR/err
}
+exit_status () {
+ local status=0
+ local log=$TESTSUITELOG
+
+ [ -f "$log" ] && grep -q FAIL $log && status=1
+ exit $status
+}
+
error() {
error_noexit "$@"
exit 1
return 1
}
+complete () {
+ equals_msg $1 test complete, duration $2 sec
+ [ -f "$TESTSUITELOG" ] && egrep .FAIL $TESTSUITELOG || true
+ echo duration $2 >>$TESTSUITELOG
+}
+
pass() {
# Set TEST_STATUS here; will be used for logging the result
if [ -f $LOGDIR/err ]; then
else
TEST_STATUS="PASS"
fi
- echo $TEST_STATUS " " $@
+ echo "$TEST_STATUS $@" 2>&1 | tee -a $TESTSUITELOG
}
check_mds() {
echo "test_$1 returned $RC" | tee $LOGDIR/err
duration=$((`date +%s` - $BEFORE))
- pass "(${duration}s)"
+ pass "$1" "(${duration}s)"
[ -f $LOGDIR/err ] && TEST_ERROR=$(cat $LOGDIR/err)
log_sub_test_end $TEST_STATUS $duration "$RC" "$TEST_ERROR"
echo \\\$(basename \\\$dv);
fi;"
}
+
+is_sanity_benchmark() {
+ local benchmarks="dbench bonnie iozone fsx"
+ local suite=$1
+ for b in $benchmarks; do
+ if [ "$b" == "$suite" ]; then
+ return 0
+ fi
+ done
+ return 1
+}
+