more configuration options, README update and tests
This commit is contained in:
@ -2,4 +2,4 @@ add_executable(testlog testlog.c)
|
||||
add_executable(testorder testorder.c)
|
||||
target_link_libraries(testlog utils pthread log_manager)
|
||||
target_link_libraries(testorder utils pthread log_manager)
|
||||
add_test(NAME TestLogOrder COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/logorder.sh 500 0 500 logtest.log)
|
||||
add_test(NAME TestLogOrder COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/logorder.sh 500 0 500)
|
@ -1,6 +1,6 @@
|
||||
#! /bin/bash
|
||||
|
||||
if [[ $# -lt 4 ]]
|
||||
if [[ $# -lt 3 ]]
|
||||
then
|
||||
echo "Usage: logorder.sh <iterations> <frequency of flushes> <message size>"
|
||||
echo "To disable log flushing, use 0 for flush frequency"
|
||||
@ -12,7 +12,6 @@ rm *.log
|
||||
#Create large messages
|
||||
$PWD/testorder $1 $2 $3
|
||||
|
||||
TESTLOG=$4
|
||||
MCOUNT=$1
|
||||
|
||||
BLOCKS=`cat skygw_err1.log |tr -s ' '|grep -o 'block:[[:digit:]]\+'|cut -d ':' -f 2`
|
||||
@ -20,23 +19,24 @@ MESSAGES=`cat skygw_err1.log |tr -s ' '|grep -o 'message|[[:digit:]]\+'|cut -d '
|
||||
|
||||
prev=0
|
||||
error=0
|
||||
|
||||
all_errors=0
|
||||
for i in $BLOCKS
|
||||
do
|
||||
|
||||
if [[ $i -le $prev ]]
|
||||
then
|
||||
error=1
|
||||
echo "block mismatch: $i was after $prev." >> $TESTLOG
|
||||
all_errors=1
|
||||
echo "block mismatch: $i was after $prev."
|
||||
fi
|
||||
prev=$i
|
||||
done
|
||||
|
||||
if [[ error -eq 0 ]]
|
||||
then
|
||||
echo "Block buffers were in order" >> $TESTLOG
|
||||
echo "Block buffers were in order"
|
||||
else
|
||||
echo "Error: block buffers were written in the wrong order" >> $TESTLOG
|
||||
echo "Error: block buffers were written in the wrong order"
|
||||
fi
|
||||
|
||||
prev=0
|
||||
@ -48,14 +48,16 @@ do
|
||||
if [[ $i -ne $(( prev + 1 )) ]]
|
||||
then
|
||||
error=1
|
||||
echo "message mismatch: $i was after $prev." >> $TESTLOG
|
||||
all_errors=1
|
||||
echo "message mismatch: $i was after $prev."
|
||||
fi
|
||||
prev=$i
|
||||
done
|
||||
|
||||
if [[ error -eq 0 ]]
|
||||
then
|
||||
echo "Block buffer messages were in order" >> $TESTLOG
|
||||
echo "Block buffer messages were in order"
|
||||
else
|
||||
echo "Error: block buffer messages were written in the wrong order" >> $TESTLOG
|
||||
echo "Error: block buffer messages were written in the wrong order"
|
||||
fi
|
||||
exit $all_errors
|
||||
|
Reference in New Issue
Block a user