#!/bin/sh
-# $Id: test_http.sh,v 1.1 2007-05-15 15:50:48 adam Exp $
+# $Id: test_http.sh,v 1.3 2007-05-15 21:40:57 adam Exp $
#
# Regression test using pazpar2 against yaz-ztest
# Reads Pazpar2 URLs from test_http_urls
# Find a suitable yaz-ztest
yt=""
-for d in /usr/bin /usr/local/bin ../../yaz/ztest; do
+for d in /usr/bin /usr/local/bin ${srcdir}/../../yaz/ztest ${srcdir}/../../../yaz/ztest; do
yt=${d}/yaz-ztest
if test -x ${yt}; then
break
fi
done
-if test -z "${yt}"; then
+if test ! -x "${yt}"; then
echo "No yaz-ztest found. Skipping"
exit 0
fi
YTPID=$!
# Fire yp pazpar2
-../src/pazpar2 -f ${srcdir}/test_http.cfg -t ${srcdir}/test_http.xml >test_http_pp2.log 2>&1 &
+rm -f pazpar2.log
+../src/pazpar2 -l pazpar2.log -f ${srcdir}/test_http.cfg -t ${srcdir}/test_http.xml >extra_pazpar2.log 2>&1 &
PP2PID=$!
# Give both programs room to start properly..
testno=1
for f in `cat ${srcdir}/test_http_urls`; do
OUT1=${srcdir}/test_http_${testno}.res
- OUT2=${srcdir}/test_http_${testno}.log
- DIFF=${srcdir}/test_http_${testno}.dif
+ OUT2=test_http_${testno}.log
+ DIFF=test_http_${testno}.dif
if test -f $OUT1; then
rm -f $OUT2
wget -q -O $OUT2 $f
if diff $OUT1 $OUT2 >$DIFF; then
- echo "Test $testno: OK"
+ :
else
echo "Test $testno: Failed. See $OUT1, $OUT2 and $DIFF"
code=1