2 # $Id: test_http.sh,v 1.3 2007-05-15 21:40:57 adam Exp $
4 # Regression test using pazpar2 against yaz-ztest
5 # Reads Pazpar2 URLs from test_http_urls
6 # Outputs to test_http_<no>.log
7 # Matches against results in test_htttp_<no>.res
11 # srcdir might be set by make
14 # Find a suitable yaz-ztest
16 for d in /usr/bin /usr/local/bin ${srcdir}/../../yaz/ztest ${srcdir}/../../../yaz/ztest; do
18 if test -x ${yt}; then
22 if test ! -x "${yt}"; then
23 echo "No yaz-ztest found. Skipping"
27 # Fire up yaz-ztest (should match port in test_http.xml)
28 $yt -l test_http_ztest.log tcp:@:9764 &
33 ../src/pazpar2 -l pazpar2.log -f ${srcdir}/test_http.cfg -t ${srcdir}/test_http.xml >extra_pazpar2.log 2>&1 &
36 # Give both programs room to start properly..
39 # Set to success by default.. Will be set to non-zero in case of failure
42 if ps -p $PP2PID >/dev/null 2>&1; then
47 echo "pazpar2 failed to start"
50 if ps -p $YTPID >/dev/null 2>&1; then
55 echo "yaz-ztest failed to start"
57 # We can start test for real
60 for f in `cat ${srcdir}/test_http_urls`; do
61 OUT1=${srcdir}/test_http_${testno}.res
62 OUT2=test_http_${testno}.log
63 DIFF=test_http_${testno}.dif
64 if test -f $OUT1; then
67 if diff $OUT1 $OUT2 >$DIFF; then
70 echo "Test $testno: Failed. See $OUT1, $OUT2 and $DIFF"
74 echo "Test $testno: Making for the first time"
78 testno=`expr $testno + 1`
83 if test -n "$YTPID"; then
87 if test -n "$PP2PID"; then