#474 write to report file

This commit is contained in:
Christian Rotzoll 2019-04-10 02:29:58 +01:00
parent f5a2b939b1
commit ecbfd82fc1

View file

@ -1,8 +1,18 @@
#!/bin/bash #!/bin/bash
# command info
if [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
echo "run stress test to measure heat and voltage"
echo "blitz.stresstest.sh [?filenameForReport]"
exit 1
fi
# Based on https://github.com/bamarni/pi64/issues/4#issuecomment-292707581 # Based on https://github.com/bamarni/pi64/issues/4#issuecomment-292707581
# sysbench manual: http://imysql.com/wp-content/uploads/2014/10/sysbench-manual.pdf # sysbench manual: http://imysql.com/wp-content/uploads/2014/10/sysbench-manual.pdf
# get parameter
filenameForReport=$1
# check if bechmarking tool is installed # check if bechmarking tool is installed
sysbenchInstalled=$(sysbench --version 2>/dev/null | grep -c 'sysbench 0.') sysbenchInstalled=$(sysbench --version 2>/dev/null | grep -c 'sysbench 0.')
if [ ${sysbenchInstalled} -eq 0 ];then if [ ${sysbenchInstalled} -eq 0 ];then
@ -72,10 +82,18 @@ for (( n=0; n<15; ++n )); do
sleep 5 sleep 5
done done
echo "# result of powertest script" if [ ${#filenameForReport} -eq 0 ]; then
echo "powerFAIL=${powerFAIL}" echo "powerFAIL=${powerFAIL}"
echo "powerWARN=${powerWARN}" echo "powerWARN=${powerWARN}"
echo "powerMIN=${powerMIN} microVolt" echo "powerMIN='${powerMIN} microVolt'"
echo "tempFAIL=${tempFAIL}" echo "tempFAIL=${tempFAIL}"
echo "tempWARN=${tempWARN}" echo "tempWARN=${tempWARN}"
echo "tempMAX=${tempMAX} centiGrad" echo "tempMAX='${tempMAX} centiGrad'"
else
echo "powerFAIL=${powerFAIL}" >${filenameForReport}
echo "powerWARN=${powerWARN}" >>${filenameForReport}
echo "powerMIN='${powerMIN} microVolt'" >>${filenameForReport}
echo "tempFAIL=${tempFAIL}" >>${filenameForReport}
echo "tempWARN=${tempWARN}" >>${filenameForReport}
echo "tempMAX='${tempMAX} centiGrad'" >>${filenameForReport}
fi