2 # $Id: test_http.sh,v 1.7 2007-05-23 21:58:29 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
25 ../src/pazpar2 -X -l pazpar2.log -f ${srcdir}/test_http.cfg -t ${srcdir}/test_http.xml >extra_pazpar2.log 2>&1 &
28 # Give it a chance to start properly..
31 # Set to success by default.. Will be set to non-zero in case of failure
34 if ps -p $PP2PID >/dev/null 2>&1; then
39 echo "pazpar2 failed to start"
42 # We can start test for real
49 for f in `cat ${srcdir}/test_http_urls`; do
50 if echo $f | grep '^http' >/dev/null; then
51 OUT1=${srcdir}/test_http_${testno}.res
52 OUT2=test_http_${testno}.log
53 DIFF=test_http_${testno}.dif
54 if test -f $OUT1; then
56 if test -n "${wget}"; then
57 ${wget} -q -O $OUT2 $f
58 elif test -n "${lynx}"; then
59 ${lynx} -dump $f >$OUT2
63 if diff $OUT1 $OUT2 >$DIFF; then
66 echo "Test $testno: Failed. See $OUT1, $OUT2 and $DIFF"
70 echo "Test $testno: Making for the first time"
71 ${wget} -q -O $OUT1 $f
74 testno=`expr $testno + 1`
78 if ps -p $PP2PID >/dev/null 2>&1; then
89 if test -n "$PP2PID"; then