2 # $Id: run_pazpar2.sh,v 1.1 2007-09-10 08:18:19 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
28 if test "x${PREFIX}" = "x"; then
29 echo Missing prefix for run_pazpar2.sh
35 if test "$usevalgrind"; then
36 valgrind --log-file=valgrind ../src/pazpar2 -X -l pazpar2.log -f ${CFG} -t ${srcdir}/test_http.xml >extra_pazpar2.log 2>&1 &
38 ../src/pazpar2 -X -l pazpar2.log -f ${srcdir}/${CFG} -t ${srcdir}/test_http.xml >extra_pazpar2.log 2>&1 &
44 # Give it a chance to start properly..
47 # Set to success by default.. Will be set to non-zero in case of failure
50 if ps -p $PP2PID >/dev/null 2>&1; then
55 echo "pazpar2 failed to start"
58 # We can start test for real
65 for f in `cat ${srcdir}/${URLS}`; do
66 if echo $f | grep '^http' >/dev/null; then
67 OUT1=${srcdir}/${PREFIX}_${testno}.res
68 OUT2=${PREFIX}_${testno}.log
69 DIFF=${PREFIX}_${testno}.dif
70 if test -f $OUT1; then
72 if test -n "${wget}"; then
73 ${wget} -q -O $OUT2 $f
74 elif test -n "${lynx}"; then
75 ${lynx} -dump $f >$OUT2
79 if diff $OUT1 $OUT2 >$DIFF; then
82 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