2 # $Id: test_http.sh,v 1.10 2007-08-13 12:51:00 adam Exp $
4 # Regression test using pazpar2 against z3950.indexdata.com/marc
5 # Reads Pazpar2 URLs from test_http_urls
6 # Outputs to test_http_<no>.log
7 # Matches against results in test_http_<no>.res
11 # srcdir might be set by make
16 if test -x /usr/bin/wget; then
19 if test -x /usr/bin/lynx; then
26 if test "$usevalgrind"; then
27 valgrind --log-file=valgrind ../src/pazpar2 -X -l pazpar2.log -f ${srcdir}/test_http.cfg -t ${srcdir}/test_http.xml >extra_pazpar2.log 2>&1 &
29 ../src/pazpar2 -X -l pazpar2.log -f ${srcdir}/test_http.cfg -t ${srcdir}/test_http.xml >extra_pazpar2.log 2>&1 &
35 # Give it a chance to start properly..
38 # Set to success by default.. Will be set to non-zero in case of failure
41 if ps -p $PP2PID >/dev/null 2>&1; then
46 echo "pazpar2 failed to start"
49 # We can start test for real
56 for f in `cat ${srcdir}/test_http_urls`; do
57 if echo $f | grep '^http' >/dev/null; then
58 OUT1=${srcdir}/test_http_${testno}.res
59 OUT2=test_http_${testno}.log
60 DIFF=test_http_${testno}.dif
61 if test -f $OUT1; then
63 if test -n "${wget}"; then
64 ${wget} -q -O $OUT2 $f
65 elif test -n "${lynx}"; then
66 ${lynx} -dump $f >$OUT2
70 if diff $OUT1 $OUT2 >$DIFF; then
73 echo "Test $testno: Failed. See $OUT1, $OUT2 and $DIFF"
77 echo "Test $testno: Making for the first time"
78 ${wget} -q -O $OUT1 $f
81 testno=`expr $testno + 1`
85 if ps -p $PP2PID >/dev/null 2>&1; then
96 if test -n "$PP2PID"; then