3 # Regression test using pazpar2 against z3950.indexdata.com/marc
4 # Reads Pazpar2 URLs from test_http_urls
5 # Outputs to test_http_<no>.log
6 # Matches against results in test_http_<no>.res
10 # srcdir might be set by make
15 if test -x /usr/bin/wget; then
18 if test -x /usr/bin/lynx; then
27 if test "x${PREFIX}" = "x"; then
28 echo Missing prefix for run_pazpar2.sh
34 if test "$usevalgrind"; then
35 valgrind --log-file=valgrind ../src/pazpar2 -X -l pazpar2.log -f ${CFG} -t ${srcdir}/test_http.xml >extra_pazpar2.log 2>&1 &
37 YAZ_LOG=zoom,zoomdetails,debug,log,fatal ../src/pazpar2 -d -X -l pazpar2.log -f ${srcdir}/${CFG} -t ${srcdir}/test_http.xml >extra_pazpar2.log 2>&1 &
43 # Give it a chance to start properly..
46 # Set to success by default.. Will be set to non-zero in case of failure
49 if ps -p $PP2PID >/dev/null 2>&1; then
54 echo "pazpar2 failed to start"
57 # We can start test for real
64 for f in `cat ${srcdir}/${URLS}`; do
65 if echo $f | grep '^http' >/dev/null; then
66 OUT1=${srcdir}/${PREFIX}_${testno}.res
67 OUT2=${PREFIX}_${testno}.log
68 DIFF=${PREFIX}_${testno}.dif
69 if test -f $OUT1; then
71 if test -n "${wget}"; then
72 ${wget} -q -O $OUT2 $f
73 elif test -n "${lynx}"; then
74 ${lynx} -dump $f >$OUT2
78 if diff $OUT1 $OUT2 >$DIFF; then
81 echo "Test $testno: Failed. See $OUT1, $OUT2 and $DIFF"
86 echo "Test $testno: Making for the first time"
87 ${wget} -q -O $OUT1 $f
90 testno=`expr $testno + 1`
94 if ps -p $PP2PID >/dev/null 2>&1; then
105 if test -n "$PP2PID"; then