2 # $Id: test_http.sh,v 1.8 2007-07-18 13:39:11 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
24 ln -s ${srcdir}/../etc/marc21.xsl
28 ../src/pazpar2 -X -l pazpar2.log -f ${srcdir}/test_http.cfg -t ${srcdir}/test_http.xml >extra_pazpar2.log 2>&1 &
31 # Give it a chance to start properly..
34 # Set to success by default.. Will be set to non-zero in case of failure
37 if ps -p $PP2PID >/dev/null 2>&1; then
42 echo "pazpar2 failed to start"
45 # We can start test for real
52 for f in `cat ${srcdir}/test_http_urls`; do
53 if echo $f | grep '^http' >/dev/null; then
54 OUT1=${srcdir}/test_http_${testno}.res
55 OUT2=test_http_${testno}.log
56 DIFF=test_http_${testno}.dif
57 if test -f $OUT1; then
59 if test -n "${wget}"; then
60 ${wget} -q -O $OUT2 $f
61 elif test -n "${lynx}"; then
62 ${lynx} -dump $f >$OUT2
66 if diff $OUT1 $OUT2 >$DIFF; then
69 echo "Test $testno: Failed. See $OUT1, $OUT2 and $DIFF"
73 echo "Test $testno: Making for the first time"
74 ${wget} -q -O $OUT1 $f
77 testno=`expr $testno + 1`
81 if ps -p $PP2PID >/dev/null 2>&1; then
92 if test -n "$PP2PID"; then