hw-test/scripts/wrapper-memtester

42 lines
1.1 KiB
Bash
Executable file

#!/bin/bash
source test-variables
MEM_TESTABLE=$1
if [[ -z $MEM_TESTABLE ]] ; then
echo "Missing parameter 1: MEM_TESTABLE"
exit 8
fi
MY_PROC=$2
if [[ -z $MY_PROC ]] ; then
echo "Missing parameter 2: MY_PROC"
exit 9
fi
BEGIN=`date +%s`
memtester ${MEM_TESTABLE}K 1 \
> $OUTPUT_DIR/memtester_$MY_PROC.out
RET=$?
# TODO: Comment out this hardcoded value used for DEBUG
# [[ $MY_PROC == 4 ]] && RET=128
echo $RET > $OUTPUT_DIR/memtester_$MY_PROC.ret
END=`date +%s`
DURATION=$(( END - BEGIN ))
echo -n "${BLD}Process $MY_PROC${OFF} : ${MEM_TESTABLE}kB tested in ${DURATION}s : " \
> $OUTPUT_DIR/memtester_$MY_PROC.result
echo -n "$SERVER_SERIAL|$MY_PROC|${MEM_TESTABLE}kB|${DURATION}s|" \
> $OUTPUT_DIR/memtester_$MY_PROC.csv
if [[ "$RET" == "0" ]] ; then
echo $RES_OK \
>> $OUTPUT_DIR/memtester_$MY_PROC.result
echo 'OK|' >> $OUTPUT_DIR/memtester_$MY_PROC.csv
else
cat $OUTPUT_DIR/memtester_$MY_PROC.out \
>> $OUTPUT_DIR/memtester_$MY_PROC.result
echo $RES_FAIL_BIG \
>> $OUTPUT_DIR/memtester_$MY_PROC.result
echo "FAIL|Return code: $RET" >> $OUTPUT_DIR/memtester_$MY_PROC.csv
fi
cat $OUTPUT_DIR/memtester_$MY_PROC.result