stop mgs
fi
-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 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
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 25 "Create new pool and restart MDS ======================="
-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 17485"
-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 22 "double open|creat in replay with open orphan from two mntp"
-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 87 "MDS should not assign same objid to different files "
-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
-#SLEEP=$((`date +%s` - $NOW))
-#[ $SLEEP -lt $TIMEOUT ] && sleep $SLEEP
+complete $(basename $0) $SECONDS
check_and_cleanup_lustre
-[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true
+exit_status
done
racer_cleanup
-echo "$0: completed $RC"
+complete $(basename $0) $SECONDS
exit $RC
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_with_stat 99 "Quota off ==============================="
-
-log "cleanup: ======================================================"
cd $ORIG_PWD
+complete $(basename $0) $SECONDS
check_and_cleanup_lustre
-echo '=========================== finished ==============================='
-[ -f "$QUOTALOG" ] && cat $QUOTALOG && grep -q FAIL $QUOTALOG && exit 1 || true
-echo "$0: completed"
+exit_status
[ "$SLOW" = "no" ] && EXCEPT_SLOW="24o 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=${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"
-SANITYLOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
FAIL_ON_ERROR=${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`
}
run_test 39 "direct I/O writes should update mtime ========="
-log "cleanup: ======================================================"
-
+complete $(basename $0) $SECONDS
check_and_cleanup_lustre
-
-echo '=========================== finished ==============================='
-[ -f "$SANITYLOG" ] && cat $SANITYLOG && grep -q FAIL $SANITYLOG && exit 1 || true
-echo "$0: completed"
-
+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" == "lfscktest" ] && 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 $TESTSUITE_LIST; do
- local skipped=""
- local slow=""
+ [ "${!O}" = "no" ] && continue || true
local o=$(echo $O | tr "[:upper:]" "[:lower:]")
o=${o//_/-}
o=${o//tyn/tyN}
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"
-
+ [ "$o" = lfsck ] && log=${TMP}/lfscktest.log
+ [ "$o" = racer ] && log=${TMP}/runracer.log
+ 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 $TESTSUITE_LIST; do
fi
done
- for O in $TESTSUITE_LIST; do
- [ "${!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
}
TEST_FAILED=true
}
+exit_status () {
+ local status=0
+ local log=$TESTSUITELOG
+
+ [ -f "$log" ] && grep -q FAIL $log && status=1
+ exit $status
+}
+
error() {
error_noexit "$@"
if $FAIL_ON_ERROR; then
return 1
}
+complete () {
+ equals_msg $1 test complete, duration $2 sec
+ [ -f "$TESTSUITELOG" ] && egrep .FAIL $TESTSUITELOG || true
+ echo duration $2 >>$TESTSUITELOG
+}
+
pass() {
- $TEST_FAILED && echo -n "FAIL " || echo -n "PASS "
- echo $@
+ local status=PASS
+ $TEST_FAILED && status=FAIL
+ echo "$status $testnum $@" 2>&1 | tee -a $TESTSUITELOG
}
check_mds() {