Commit 399112b0 authored by Geoff Simmons's avatar Geoff Simmons

trackrdrd: Added option -f to read from a Varnish binary log dump

(from varnishlog -w), and a 'make check' target to run a
regression test.
parent 9803ab91
......@@ -17,3 +17,6 @@ trackrdrd_LDADD = \
$(VARNISHSRC)/lib/libvarnishapi/libvarnishapi.la \
$(VARNISHSRC)/lib/libvarnish/libvarnish.la \
${PTHREAD_LIBS}
check:
test/regress.sh
#!/bin/bash
# The regression test reads from a binary dump of the Varnish SHM log
# obtained from:
#
# $ varnishlog -w varnish.binlog
#
# Load was created from JMeter running 50 request in 100 threads.
#
# The regression runs trackrdrd, reading from the binary dump and
# logging to stdout in debug mode, and obtains a cksum from
# stdout. The cksum must match an expected value.
CKSUM=$(./trackrdrd -f test/varnish.binlog -l - -d | cksum)
if [ "$CKSUM" != '915150825 166426' ]; then
echo "ERROR: Regression test incorrect cksum: $CKSUM"
exit 1
fi
echo "*** Regression test ok ***"
exit 0
......@@ -197,7 +197,7 @@ main(int argc, char * const *argv)
vd = VSM_New();
VSL_Setup(vd);
while ((c = getopt(argc, argv, "DP:Vn:hl:d")) != -1) {
while ((c = getopt(argc, argv, "DP:Vn:hl:df:")) != -1) {
switch (c) {
case 'D':
D_flag = 1;
......@@ -217,6 +217,10 @@ main(int argc, char * const *argv)
case 'd':
d_flag = 1;
break;
case 'f':
if (VSL_Arg(vd, 'r', optarg) <= 0)
exit(1);
break;
case 'h':
default:
usage();
......
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