Debug values commented-out for release
This commit is contained in:
parent
d7ebf16f17
commit
dcef848a7e
5 changed files with 40 additions and 10 deletions
|
@ -86,7 +86,7 @@ fi
|
|||
# Hardcoded 13 MiB for debug
|
||||
#MEM_TESTABLE=16384
|
||||
# Hardcoded 130 MiB for debug
|
||||
MEM_TESTABLE=163840
|
||||
#MEM_TESTABLE=163840
|
||||
export MEM_TESTABLE
|
||||
|
||||
echo "$MEM_AVAILABLE kB available in system"
|
||||
|
|
|
@ -34,7 +34,7 @@ fi
|
|||
FAIL=0
|
||||
if [[ $SUMMARY == 0 ]] ; then
|
||||
if [[ -f $OUTPUT_DIR/memtester.fail ]] ; then
|
||||
echo "Previuos failed test faound on "
|
||||
echo -n "Previuos failed test faound on "
|
||||
tail -1 $OUTPUT_DIR/memtester.fail
|
||||
echo "Running memtester test again..."
|
||||
fi
|
||||
|
|
|
@ -12,7 +12,7 @@ while [[ $RUNNING == 0 ]] ; do
|
|||
fi
|
||||
done
|
||||
sleep 5
|
||||
tail -Fq run/*.badblocks.out &
|
||||
tail -Fq /run/*.badblocks.out &
|
||||
|
||||
TAIL_PID=`jobs -p %+`
|
||||
|
||||
|
@ -21,4 +21,5 @@ while [[ -f /run/badblocks.waiting ]] ; do
|
|||
done
|
||||
|
||||
kill $TAIL_PID
|
||||
rm -vf /run/*.badblocks.out
|
||||
|
||||
|
|
|
@ -42,10 +42,12 @@ fi
|
|||
|
||||
#TPATTERN=0x55
|
||||
TPATTERN=0xaa
|
||||
LST_BLCK=10000000 # TODO: Debug limit. Comment out for production
|
||||
#SMARTLOG=15
|
||||
SMARTLOG=60 # check every minute
|
||||
#SMARTLOG=300 # check every 5 minutes
|
||||
# TODO: Debug limit. Comment out for production
|
||||
#LST_BLCK=10000000
|
||||
SMARTLOG=300 # check every 5 minutes
|
||||
#SMARTLOG=60 # check every minute
|
||||
# TODO: Debug variable. Comment out for production
|
||||
#SMARTLOG=15 # Check every second
|
||||
BLK_SIZE=`cat /sys/block/$DISK/queue/physical_block_size`
|
||||
MAX_SAME=`cat /sys/block/$DISK/queue/write_same_max_bytes`
|
||||
CONCU=$(( MAX_SAME / ( BLK_SIZE / 2 ) ))
|
||||
|
@ -66,6 +68,8 @@ else
|
|||
| grep ERROR \
|
||||
| cut -d ':' -f 2
|
||||
`
|
||||
# TODO: Debug variable. Comment out for production
|
||||
#ERROR=
|
||||
if [[ -n $ERROR ]] ; then
|
||||
RAW_ERROR=$ERROR
|
||||
ERROR=''
|
||||
|
@ -97,11 +101,36 @@ if [[ -z $ERROR ]] ; then
|
|||
kill $TEST_PID
|
||||
sleep 5
|
||||
fi
|
||||
# TODO: Debug procedure. unnecessary for production
|
||||
#BADBLOCK=`cat $OUTPUT_DIR/disk/$SERIAL.badblocks`
|
||||
#if [[ -n $BADBLOCK ]] ; then
|
||||
# kill $TEST_PID
|
||||
# sleep 5
|
||||
#fi
|
||||
sleep $SMARTLOG
|
||||
done
|
||||
# Check smart attributes after the badblocks test
|
||||
ERROR=`smartctl -A -f brief /dev/$DISK \
|
||||
| parse-smart-attr \
|
||||
| grep ERROR \
|
||||
| cut -d ':' -f 2
|
||||
`
|
||||
# TODO: Debug variable. Comment out for production
|
||||
#ERROR=
|
||||
if [[ -n $ERROR ]] ; then
|
||||
RAW_ERROR=$ERROR
|
||||
ERROR=''
|
||||
for TOKEN in $RAW_ERROR ; do
|
||||
ERROR="$ERROR $TOKEN"
|
||||
done
|
||||
smartctl -A -f brief /dev/$DISK \
|
||||
| parse-smart-attr \
|
||||
| sed "s/ERROR/$RES_ERROR/g" \
|
||||
> $OUTPUT_DIR/disk/$SERIAL.smart.error
|
||||
fi
|
||||
#RET=$?
|
||||
#echo $RET > $OUTPUT_DIR/disk/$SERIAL.badblocks.ret
|
||||
rm /run/$SERIAL.badblocks.pid
|
||||
rm -f /run/$SERIAL.badblocks.pid
|
||||
fi
|
||||
END=`date +%s`
|
||||
|
||||
|
@ -157,7 +186,7 @@ if [[ -f /run/$SERIAL.badblocks.out ]] ; then
|
|||
>> $OUTPUT_DIR/disk/$SERIAL.badblocks.out
|
||||
ln -sf $OUTPUT_DIR/disk/$SERIAL.badblocks.out \
|
||||
$OUTPUT_DIR/disk/$DISK.badblocks.out
|
||||
rm -f /run/$SERIAL.badblocks.out
|
||||
# rm -f /run/$SERIAL.badblocks.out
|
||||
fi
|
||||
#ln -sf $OUTPUT_DIR/disk/$SERIAL.badblocks.ret \
|
||||
# $OUTPUT_DIR/disk/$DISK.badblocks.ret
|
||||
|
|
|
@ -18,7 +18,7 @@ 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
|
||||
# [[ $MY_PROC == 4 ]] && RET=128
|
||||
echo $RET > $OUTPUT_DIR/memtester_$MY_PROC.ret
|
||||
END=`date +%s`
|
||||
|
||||
|
|
Loading…
Reference in a new issue