Commit a00794a4 authored by Nils Goroll's avatar Nils Goroll

simplify regression tests, update checksums

parent 26c023d9
...@@ -32,6 +32,7 @@ src/test/test_writer ...@@ -32,6 +32,7 @@ src/test/test_writer
src/test/test_hdrtrie src/test/test_hdrtrie
src/test/output.log src/test/output.log
src/test/test.log src/test/test.log
src/test/vslarg.sh.trc.*
src/varnishevent src/varnishevent
src/vcs_version.h src/vcs_version.h
*.1 *.1
......
...@@ -16,7 +16,7 @@ rm -f $LOG $OUT ...@@ -16,7 +16,7 @@ rm -f $LOG $OUT
../varnishevent -f varnishevent.conf -r varnish-4.1.0-doc.log -w $OUT -v ../varnishevent -f varnishevent.conf -r varnish-4.1.0-doc.log -w $OUT -v
CKSUM=$( cksum $OUT ) CKSUM=$( cksum $OUT )
if [ "$CKSUM" != "54743924 442153 $OUT" ]; then if [ "$CKSUM" != "4160992159 443944 $OUT" ]; then
echo "ERROR: Regression test log output incorrect cksum: $CKSUM" echo "ERROR: Regression test log output incorrect cksum: $CKSUM"
exit 1 exit 1
fi fi
......
805680033 830 vslarg.sh.trc.dash-C
3453409010 443982 vslarg.sh.trc.no
805680033 830 vslarg.sh.trc.query
3267477005 21053 vslarg.sh.trc.raw
16969574 444977 vslarg.sh.trc.request
3453409010 443982 vslarg.sh.trc.vxid
...@@ -9,53 +9,25 @@ CONF=varnishevent.conf ...@@ -9,53 +9,25 @@ CONF=varnishevent.conf
LOG=/dev/null LOG=/dev/null
TRC=$(basename $0).trc TRC=$(basename $0).trc
rm -rf ${TRC} rm -rf ${TRC}.*
mkdir ${TRC}
# Ensure that the local time date formatters produce the same output # Ensure that the local time date formatters produce the same output
# wherever the test is run. # wherever the test is run.
export TZ=UTC export TZ=UTC
echo "... no VSL args" echo "... no VSL args"
CKSUM=$( ../varnishevent -r ${IN} -f ${CONF} -l ${LOG} | tee ${TRC}.no | cksum) ../varnishevent -r ${IN} -f ${CONF} -l ${LOG} > ${TRC}.no
if [ "$CKSUM" != '2542287168 442191' ]; then
echo "ERROR: no VSL args unexpected cksum: $CKSUM"
exit 1
fi
echo "... -g vxid" echo "... -g vxid"
CKSUM=$( ../varnishevent -g vxid -r ${IN} -f ${CONF} -l ${LOG} | ../varnishevent -g vxid -r ${IN} -f ${CONF} -l ${LOG} > ${TRC}.vxid
tee ${TRC}.vxid | cksum)
# Same as default (no -g arg)
if [ "$CKSUM" != '2542287168 442191' ]; then
echo "ERROR: -g vxid unexpected cksum: $CKSUM"
exit 1
fi
echo "... -g request" echo "... -g request"
CKSUM=$( ../varnishevent -g request -r ${IN} -f ${CONF} -l ${LOG} | ../varnishevent -g request -r ${IN} -f ${CONF} -l ${LOG} > ${TRC}.request
tee ${TRC}.request | cksum)
if [ "$CKSUM" != '3970366484 443186' ]; then
echo "ERROR: -g request unexpected cksum: $CKSUM"
exit 1
fi
echo "... -g raw" echo "... -g raw"
# Timestamps for raw grouping are always the time at which the tx was read, # Timestamps for raw grouping are always the time at which the tx was read,
# even for binary file reads. So we check against the last four columns. # even for binary file reads. So we check against the last four columns.
# The query restricts output to Begin records; the previous invocation # The query restricts output to Begin records; the previous invocation
# rendered every record with just the VXIDs. # rendered every record with just the VXIDs.
CKSUM=$( ../varnishevent -g raw -r ${IN} -f raw.conf -l ${LOG} -q 'Begin' | ../varnishevent -g raw -r ${IN} -f raw.conf -l ${LOG} -q 'Begin' |
cut -d' ' -f4- | tee ${TRC}.raw | cksum) cut -d' ' -f4- > ${TRC}.raw
if [ "$CKSUM" != '3267477005 21053' ]; then
echo "ERROR: -g raw with query unexpected cksum: $CKSUM"
exit 1
fi
# Cannot mix raw grouping with client and/or backend formats # Cannot mix raw grouping with client and/or backend formats
../varnishevent -g raw -f ${CONF} -l ${LOG} ../varnishevent -g raw -f ${CONF} -l ${LOG}
...@@ -73,13 +45,7 @@ if [ "$?" != "1" ]; then ...@@ -73,13 +45,7 @@ if [ "$?" != "1" ]; then
fi fi
echo "... -q query" echo "... -q query"
CKSUM=$( ../varnishevent -q 'ReqURL ~ "_static"' -r ${IN} -l ${LOG} | ../varnishevent -q 'ReqURL ~ "_static"' -r ${IN} -l ${LOG} > ${TRC}.query
tee ${TRC}.query | cksum)
if [ "$CKSUM" != '805680033 830' ]; then
echo "ERROR: -q query unexpected cksum: $CKSUM"
exit 1
fi
../varnishevent -q 'ReqURL ~' -l ${LOG} ../varnishevent -q 'ReqURL ~' -l ${LOG}
...@@ -89,12 +55,17 @@ if [ "$?" != "1" ]; then ...@@ -89,12 +55,17 @@ if [ "$?" != "1" ]; then
fi fi
echo "... -C" echo "... -C"
CKSUM=$( ../varnishevent -C -q 'ReqURL ~ "_STATIC"' -r ${IN} -l ${LOG} | ../varnishevent -C -q 'ReqURL ~ "_STATIC"' -r ${IN} -l ${LOG} > ${TRC}.dash-C
tee ${TRC}.dash-C | cksum)
set -eu
if [ "$CKSUM" != '805680033 830' ]; then tmpf=/tmp/$(basename $0).cmp.$$
echo "ERROR: -q query unexpected cksum: $CKSUM" cksum ${TRC}.* >${tmpf}
if diff $(basename $0 .sh).cksum ${tmpf} ; then
rm -rf ${TRC}.*
else
echo "ERROR: checksum diff"
exit 1 exit 1
fi fi
exit 0 rm -f ${tmpf}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment