#!/bin/bash

echo
echo "TEST: $0"
echo "... testing output against a known checksum"
CMD="../varnishevent -G varnishevent.conf -r varnish.binlog"

# sed removes the version/revision from the "initializing" line
CKSUM=$( $CMD | sed -e 's/\(initializing\) \(.*\)/\1/' | cksum)

if [ "$CKSUM" != '561362531 23303920' ]; then
    echo "ERROR: Regression test incorrect cksum: $CKSUM"
    exit 1
fi

exit 0
