Commit b1a07c6c authored by Geoff Simmons's avatar Geoff Simmons

add regression test

parent 690377bd
AM_CPPFLAGS = @VARNISH_CFLAGS@ -I ${ac_varnish_pkgdataincludedir}
TESTS = test_data test_strfTIM test_format test_writer # regress.sh ncsa.sh vslarg.sh
TESTS = test_data test_strfTIM test_format test_writer regress.sh # ncsa.sh vslarg.sh
check_PROGRAMS = test_data test_strfTIM test_format test_writer
......
#!/bin/bash
echo
echo "TEST: $0"
echo '... testing output and log against known checksums (long)'
LOG=test.log
OUT=output.log
rm -f $LOG $OUT
../varnishevent -f varnishevent.conf -r sw-doc.log -w $OUT -v
CKSUM=$( cksum $OUT )
if [ "$CKSUM" != "4102580059 20793538 $OUT" ]; then
echo "ERROR: Regression test log output incorrect cksum: $CKSUM"
exit 1
fi
# sed removes the version/revision from the "initializing" line.
# grep removes logs from the writer thread about returns to free lists,
# which are not relevant to the regression, and may appear at different
# places in the log (due to multi-threading).
CKSUM=$( sed -e 's/\(initializing\) \(.*\)/\1/' $LOG | grep -v 'Writer: returned' | cksum )
if [ "$CKSUM" != '214907488 66951871' ]; then
echo "ERROR: Regression test varnishevent log incorrect cksum: $CKSUM"
exit 1
fi
exit 0
# varnishevent test configuration
monitor.interval = 0
cformat=%b %d %D %H %h %I %{Host}i %{Connection}i %{User-Agent}i %{X-Forwarded-For}i %{Accept-Ranges}o %{Age}o %{Connection}o %{Content-Encoding}o %{Content-Length}o %{Content-Type}o %{Date}o %{Last-Modified}o %{Server}o %{Transfer-Encoding}o %{Via}o %{X-Varnish}o %l %m %O %q %r %s %t %{%F-%T}t %U %u %{Varnish:time_firstbyte}x %{Varnish:hitmiss}x %{Varnish:handling}x %{tag:Begin}x %{tag:Debug}x %{tag:End}x %{tag:Gzip}x %{tag:Hit}x %{tag:Length}x %{tag:Link}x %{tag:ReqAcct}x %{tag:ReqStart}x %{tag:RespProtocol}x %{tag:ReqMethod}x %{tag:ReqURL}x %{tag:ReqProtocol}x %{tag:RespReason}x %{tag:RespStatus}x
bformat=%b %d %D %H %h %I %{Accept-Encoding}i %{Host}i %{User-Agent}i %{X-Forwarded-For}i %{X-Varnish}i %{Accept-Ranges}o %{Connection}o %{Content-Encoding}o %{Content-Length}o %{Content-Type}o %{Date}o %{ETag}o %{Last-Modified}o %{Server}o %{Transfer-Encoding}o %{Vary}o %l %m %O %q %r %s %t %{%F-%T}t %U %u %{Varnish:time_firstbyte}x %{tag:Backend}x %{tag:BackendOpen}x %{tag:BackendClose}x %{tag:BackendReuse}x %{tag:Begin}x %{tag:BereqAcct}x %{tag:Length}x %{tag:BerespProtocol}x %{tag:BerespReason}x %{tag:BerespStatus}x %{tag:BereqProtocol}x %{tag:BereqMethod}x %{tag:BereqURL}x %{tag:Debug}x %{tag:End}x
log.file = test.log
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