3 # Regression test using pazpar2 against z3950.indexdata.com/marc or gils
4 # Reads Pazpar2 URLs from $1
5 # Outputs to $1_<no>.log
6 # Matches against results in $1_<no>.res
9 # srcdir might be set by make
12 # look for curl in PATH
17 if test -x $p/curl; then
24 if test -z $curl; then
25 echo "curl not found. $PREFIX can not be tested"
28 GET='$curl --silent --output $OUT2 "$f"'
29 POST='$curl --silent --header "Content-Type: text/xml" --data-binary "@$postfile" --output $OUT2 "$f"'
31 if [ -z "$SKIP_PAZPAR2" ] ; then
36 if test "x${PREFIX}" = "x"; then
37 echo Missing prefix for run_pazpar2.sh
43 VALGRINDLOG=${PREFIX}_valgrind.log
45 if test -n "$PAZPAR2_USE_VALGRIND"; then
46 valgrind --leak-check=full --log-file=$VALGRINDLOG ../src/pazpar2 -X -l pazpar2.log -f ${CFG} >extra_pazpar2.log 2>&1 &
47 elif test -n "$SKIP_PAZPAR2"; then
48 echo "Skipping pazpar2. Must already be running with correct config!!! "
50 YAZ_LOG=zoom,zoomdetails,debug,log,fatal ../src/pazpar2 -d -X -l pazpar2.log -f ${srcdir}/${CFG} >extra_pazpar2.log 2>&1 &
56 # Give it a chance to start properly..
59 # Set to success by default.. Will be set to non-zero in case of failure
62 if [ -z "$SKIP_PAZPAR2" ] ; then
63 if ps -p $PP2PID >/dev/null 2>&1; then
68 echo "pazpar2 failed to start"
72 # We can start test for real
75 for f in `cat ${srcdir}/${URLS}`; do
76 if echo $f | grep '^http' >/dev/null; then
77 OUT1=${srcdir}/${PREFIX}_${testno}.res
78 OUT2=${PREFIX}_${testno}.log
79 DIFF=${PREFIX}_${testno}.dif
81 if test -n "${postfile}"; then
86 if test ! -f $OUT2; then
89 if test -f $OUT1; then
90 if diff $OUT1 $OUT2 >$DIFF; then
93 echo "Test $testno: Failed. See $OUT1, $OUT2 and $DIFF"
98 echo "Test $testno: Making for the first time"
102 testno=`expr $testno + 1`
104 elif echo $f | grep '^[0-9]' >/dev/null; then
107 if test -f $srcdir/$f; then
110 echo "File $f does not exist"
114 if [ -z "$SKIP_PAZPAR2" ] ; then
115 if ps -p $PP2PID >/dev/null 2>&1; then
119 echo "Test $testno: pazpar2 died"
127 if [ -z "$SKIP_PAZPAR2" ] ; then
128 if test -n "$PP2PID"; then