unset try notrun bad
}
+_global_log() {
+ echo "$1" >> $check.log
+ if $OPTIONS_HAVE_SECTIONS; then
+ echo "$1" >> ${REPORT_DIR}/check.log
+ fi
+}
+
_wrapup()
{
seq="check"
}' \
| sort -n >$tmp.out
mv $tmp.out $check.time
+ if $OPTIONS_HAVE_SECTIONS; then
+ cp $check.time ${REPORT_DIR}/check.time
+ fi
fi
- echo "" >>$check.log
- date >>$check.log
+ _global_log ""
+ _global_log "$(date)"
echo "SECTION -- $section" >>$tmp.summary
echo "=========================" >>$tmp.summary
echo "Ran:$try"
echo "Ran:$try" >>$tmp.summary
fi
- echo "Ran:$try" >>$check.log
+ _global_log "Ran:$try"
fi
$interrupt && echo "Interrupted!" | tee -a $check.log
+ if $OPTIONS_HAVE_SECTIONS; then
+ $interrupt && echo "Interrupted!" | tee -a \
+ ${REPORT_DIR}/check.log
+ fi
if [ ! -z "$notrun" ]; then
if [ $brief_test_summary == "false" ]; then
echo "Not run:$notrun"
echo "Not run:$notrun" >>$tmp.summary
fi
- echo "Not run:$notrun" >>$check.log
+ _global_log "Not run:$notrun"
fi
if [ ! -z "$n_bad" -a $n_bad != 0 ]; then
echo "Failures:$bad"
echo "Failed $n_bad of $n_try tests"
- echo "Failures:$bad" >>$check.log
- echo "Failed $n_bad of $n_try tests" >>$check.log
+ _global_log "Failures:$bad"
+ _global_log "Failed $n_bad of $n_try tests"
echo "Failures:$bad" >>$tmp.summary
echo "Failed $n_bad of $n_try tests" >>$tmp.summary
else
echo "Passed all $n_try tests"
- echo "Passed all $n_try tests" >>$check.log
+ _global_log "Passed all $n_try tests"
echo "Passed all $n_try tests" >>$tmp.summary
fi
echo "" >>$tmp.summary
touch ${RESULT_DIR}/check_dmesg
fi
_try_wipe_scratch_devs > /dev/null 2>&1
+
+ # clear the WARN_ONCE state to allow a potential problem
+ # to be reported for each test
+ (echo 1 > $DEBUGFS_MNT/clear_warn_once) > /dev/null 2>&1
+
if [ "$DUMP_OUTPUT" = true ]; then
_run_seq 2>&1 | tee $tmp.out
# Because $? would get tee's return code
_check_dmesg || err=true
fi
+ # Reload the module after each test to check for leaks or
+ # other problems.
+ if [ -n "${TEST_FS_MODULE_RELOAD}" ]; then
+ _test_unmount 2> /dev/null
+ _scratch_unmount 2> /dev/null
+ modprobe -r fs-$FSTYP
+ modprobe fs-$FSTYP
+ fi
+
# Scan for memory leaks after every test so that associating
# a leak to a particular test will be as accurate as possible.
_check_kmemleak || err=true