Commit 79811875 authored by Geoff Simmons's avatar Geoff Simmons

make the regression tests independent of local time zone in which they are run

parent add7c855
Pipeline #100 skipped
......@@ -372,6 +372,10 @@ reproduces the same value that was present in the log, while
varnishncsa performs floating point conversions, with some loss of
precision.
The date/time formatters ``%t`` and ``%{X}t`` assume the local time
zone, as set in varnishevent's environment. You can control the output
by setting the ``TZ`` environment variable.
REQUIREMENTS
============
......
......@@ -4,6 +4,10 @@ echo
echo "TEST: $0"
echo '... testing output and log against known checksums'
# Ensure that the local time date formatters produce the same output
# wherever the test is run.
export TZ=UTC
LOG=test.log
OUT=output.log
......@@ -12,7 +16,7 @@ rm -f $LOG $OUT
../varnishevent -f varnishevent.conf -r varnish-4.1.0-doc.log -w $OUT -v
CKSUM=$( cksum $OUT )
if [ "$CKSUM" != "1046111307 442153 $OUT" ]; then
if [ "$CKSUM" != "54743924 442153 $OUT" ]; then
echo "ERROR: Regression test log output incorrect cksum: $CKSUM"
exit 1
fi
......
......@@ -8,10 +8,14 @@ IN=varnish-4.1.0-doc.log
CONF=varnishevent.conf
LOG=/dev/null
# Ensure that the local time date formatters produce the same output
# wherever the test is run.
export TZ=UTC
echo "... no VSL args"
CKSUM=$( ../varnishevent -r ${IN} -f ${CONF} -l ${LOG} | cksum)
if [ "$CKSUM" != '2861633151 442191' ]; then
if [ "$CKSUM" != '2542287168 442191' ]; then
echo "ERROR: no VSL args unexpected cksum: $CKSUM"
exit 1
fi
......@@ -20,7 +24,7 @@ echo "... -g vxid"
CKSUM=$( ../varnishevent -g vxid -r ${IN} -f ${CONF} -l ${LOG} | cksum)
# Same as default (no -g arg)
if [ "$CKSUM" != '2861633151 442191' ]; then
if [ "$CKSUM" != '2542287168 442191' ]; then
echo "ERROR: -g vxid unexpected cksum: $CKSUM"
exit 1
fi
......@@ -28,7 +32,7 @@ fi
echo "... -g request"
CKSUM=$( ../varnishevent -g request -r ${IN} -f ${CONF} -l ${LOG} | cksum)
if [ "$CKSUM" != '519771253 443186' ]; then
if [ "$CKSUM" != '3970366484 443186' ]; then
echo "ERROR: -g request unexpected cksum: $CKSUM"
exit 1
fi
......@@ -64,7 +68,7 @@ fi
echo "... -q query"
CKSUM=$( ../varnishevent -q 'ReqURL ~ "_static"' -r ${IN} -l ${LOG} | cksum)
if [ "$CKSUM" != '3256944209 830' ]; then
if [ "$CKSUM" != '805680033 830' ]; then
echo "ERROR: -q query unexpected cksum: $CKSUM"
exit 1
fi
......@@ -79,7 +83,7 @@ fi
echo "... -C"
CKSUM=$( ../varnishevent -C -q 'ReqURL ~ "_STATIC"' -r ${IN} -l ${LOG} | cksum)
if [ "$CKSUM" != '3256944209 830' ]; then
if [ "$CKSUM" != '805680033 830' ]; then
echo "ERROR: -q query unexpected cksum: $CKSUM"
exit 1
fi
......
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