Made releng/run_all_auto ready for FreeBSD ("bash" linked to /bin/sh)

This commit is contained in:
Thomas Schmitt 2011-08-10 10:04:56 +00:00
parent 7d8770cea6
commit 6e428ec665
1 changed files with 36 additions and 26 deletions

View File

@ -110,19 +110,22 @@ fi
fi fi
> ${CLOG} > ${CLOG}
if [ -x "${RELENG_XORRISO}" ]; then if [ -x "${RELENG_XORRISO}" ]; then
echo -e "_OVERVIEW_______________________________________________________________" >> ${CLOG} echo "_OVERVIEW_______________________________________________________________" >> ${CLOG}
date --utc >> ${CLOG} date -u >> ${CLOG}
${RELENG_XORRISO} --version >> ${CLOG} ${RELENG_XORRISO} --version >> ${CLOG}
echo -e "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${CLOG} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${CLOG}
fi fi
DSTART=`date --utc` DSTART=`date -u`
echo -ne "${SELF}: Started at ${DSTART}" | tee -a ${CLOG} echo -n "${SELF}: Started at ${DSTART}" | tee -a ${CLOG}
E1=`date '+%s'` E1=`date '+%s'`
exit_value=0
# require ^auto_, avoid running (your)self explicitly # require ^auto_, avoid running (your)self explicitly
for s in `ls | grep ^auto_ | grep -v ${SELF} | sort -n`; do for s in `ls | grep ^auto_ | grep -v ${SELF} | sort -n`; do
if [ -x ${s} -a ! -d ${s} ]; then if [ -x ${s} -a ! -d ${s} ]; then
echo -ne "\n\n_STARTING_TEST_________________________________________________________" >> ${CLOG} echo >> ${CLOG}
echo -ne "\n${SELF}: Running ./${s} ${PASSED_OPTIONS} :\n" \ echo >> ${CLOG}
echo "_STARTING_TEST_________________________________________________________" >> ${CLOG}
echo "${SELF}: Running ./${s} ${PASSED_OPTIONS} :" \
| tee -a ${CLOG} | tee -a ${CLOG}
T1=`date '+%s'` T1=`date '+%s'`
set +e set +e
@ -147,6 +150,7 @@ fi
printf "done in ${TS} sec. ok." printf "done in ${TS} sec. ok."
;; ;;
*) *)
exit_value=2
printf "done in ${TS} sec. " printf "done in ${TS} sec. "
which tput >/dev/null 2>&1 && tput smso which tput >/dev/null 2>&1 && tput smso
printf "FAIL -> EXIT CODE $RET" printf "FAIL -> EXIT CODE $RET"
@ -157,70 +161,76 @@ fi
fi fi
done done
DEND=`date --utc` DEND=`date -u`
echo -ne "\n${SELF}: Stopped at ${DEND}." | tee -a ${CLOG} echo | tee -a ${CLOG}
echo -n "${SELF}: Stopped at ${DEND}." | tee -a ${CLOG}
if [ "${CLEANUP_LOG}" -eq 1 ]; then if [ "${CLEANUP_LOG}" -eq 1 ]; then
if [ -f "${CLOG}" ]; then if [ -f "${CLOG}" ]; then
rm -f "${CLOG}" rm -f "${CLOG}"
echo -ne "\n${SELF}: Removed my own log ${CLOG}." # | tee -a ${CLOG} echo # | tee -a ${CLOG}
echo -n "${SELF}: Removed my own log ${CLOG}." # | tee -a ${CLOG}
fi fi
if [ -f "${CLOG}".prev ]; then if [ -f "${CLOG}".prev ]; then
rm -f "${CLOG}".prev rm -f "${CLOG}".prev
echo -e "\n${SELF}: Removed my own log ${CLOG}.prev." # | tee -a ${CLOG} echo # | tee -a ${CLOG}
echo "${SELF}: Removed my own log ${CLOG}.prev." # | tee -a ${CLOG}
fi fi
else else
E2=`date '+%s'` E2=`date '+%s'`
if [ ${E2} -eq ${E1} ]; then if [ ${E2} -eq ${E1} ]; then
echo -e " Total elapsed 0 sec." | tee -a ${CLOG} echo " Total elapsed 0 sec." | tee -a ${CLOG}
else else
let ES="${E2} - ${E1}" let ES="${E2} - ${E1}"
echo -e " Total elapsed ${ES} sec." | tee -a ${CLOG} echo " Total elapsed ${ES} sec." | tee -a ${CLOG}
fi fi
##### #####
echo -e "\n_SUMMARY________________________________________________________________" >> ${CLOG} echo >> ${CLOG}
echo -e "${SELF}: Trivial log examination: ${CLOG}" | tee -a ${CLOG} echo "_SUMMARY________________________________________________________________" >> ${CLOG}
echo -e "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" | tee -a ${CLOG} echo "${SELF}: Trivial log examination: ${CLOG}" | tee -a ${CLOG}
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" | tee -a ${CLOG}
# severity classes of libdax_msgs.h in libburn and libisofs # severity classes of libdax_msgs.h in libburn and libisofs
# List of boring keywords: # List of boring keywords:
# 'UPDATE|NOTE|DEBUG|ALL' - not considered interesting for lazy log inspection. # 'UPDATE|NOTE|DEBUG|ALL' - not considered interesting for lazy log inspection.
# List of interesting keywords: # List of interesting keywords:
# thrown by xorriso and underlying libraries # thrown by xorriso and underlying libraries
LIST_KWD="(NEVER|ABORT|FATAL|FAILURE|MISHAP|SORRY|WARNING|HINT" LIST_KWD="NEVER|ABORT|FATAL|FAILURE|MISHAP|SORRY|WARNING|HINT"
# thrown by others # thrown by others
LIST_KWD+="|FAIL|ERROR|WRONG)" LIST_KWD="${LIST_KWD}|FAIL|ERROR|WRONG"
if [ -f "${CLOG}" ]; then if [ -f "${CLOG}" ]; then
set +e set +e
# lines, perl regex, leading tabs # lines, perl regex, leading tabs
grep -n -P "${LIST_KWD}" "${CLOG}" grep -n -E "${LIST_KWD}" "${CLOG}"
RET_GREP="$?" RET_GREP="$?"
case ${RET_GREP} in case ${RET_GREP} in
0) # found 0) # found
;; ;;
1) # not found 1) # not found
echo -e "${SELF}: Log file looks clear." # | tee -a ${CLOG} echo "${SELF}: Log file looks clear." # | tee -a ${CLOG}
;; ;;
*) # *) #
echo -e "${SELF}: grep returned EXIT CODE: ${RET_GREP}." # | tee -a ${CLOG} echo "${SELF}: grep returned EXIT CODE: ${RET_GREP}." # | tee -a ${CLOG}
;; ;;
esac esac
set -e set -e
fi fi
echo -e "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" | tee -a ${CLOG} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" | tee -a ${CLOG}
##### TODO: work out a less noisy diff'ing technique! ##### TODO: work out a less noisy diff'ing technique!
if [ -f "${CLOG}".prev -a -f "${CLOG}" ]; then if [ -f "${CLOG}".prev -a -f "${CLOG}" ]; then
echo -e "${SELF}: See diff against previous log file (might be long):" | tee -a ${CLOG} echo "${SELF}: See diff against previous log file (might be long):" | tee -a ${CLOG}
echo -e "diff -Naur ${CLOG}.prev ${CLOG} | less" | tee -a ${CLOG} echo "diff -Naur ${CLOG}.prev ${CLOG} | less" | tee -a ${CLOG}
fi fi
fi fi
# #
which tput >/dev/null 2>&1 && tput smso which tput >/dev/null 2>&1 && tput smso
echo -e "\n${SELF}: Leaving the following cruft in ${GEN_DATA_DIR}:" # | tee -a ${CLOG} echo # | tee -a ${CLOG}
echo "${SELF}: Leaving the following cruft in ${GEN_DATA_DIR}:" # | tee -a ${CLOG}
which tput >/dev/null 2>&1 && tput rmso which tput >/dev/null 2>&1 && tput rmso
ls -lth "${GEN_DATA_DIR}" # | tee -a ${CLOG} ls -lth "${GEN_DATA_DIR}" # | tee -a ${CLOG}
# Fin # Fin
exit 0 exit $exit_value