2 # $Id: test_http.sh,v 1.1 2007-05-15 15:50:48 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 ../../yaz/ztest; do
18 if test -x ${yt}; then
22 if test -z "${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 &
32 ../src/pazpar2 -f ${srcdir}/test_http.cfg -t ${srcdir}/test_http.xml >test_http_pp2.log 2>&1 &
35 # Give both programs room 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 if ps -p $YTPID >/dev/null 2>&1; then
54 echo "yaz-ztest failed to start"
56 # We can start test for real
59 for f in `cat ${srcdir}/test_http_urls`; do
60 OUT1=${srcdir}/test_http_${testno}.res
61 OUT2=${srcdir}/test_http_${testno}.log
62 DIFF=${srcdir}/test_http_${testno}.dif
63 if test -f $OUT1; then
66 if diff $OUT1 $OUT2 >$DIFF; then
67 echo "Test $testno: OK"
69 echo "Test $testno: Failed. See $OUT1, $OUT2 and $DIFF"
73 echo "Test $testno: Making for the first time"
77 testno=`expr $testno + 1`
82 if test -n "$YTPID"; then
86 if test -n "$PP2PID"; then