3 # Regression test using pazpar2 against z3950.indexdata.com/marc or gils
4 # Reads Pazpar2 URLs from $1
5 # Outputs to $1_<no>.log
6 # Matches against results in $1_<no>.res
9 # srcdir might be set by make
12 # look for curl in PATH
17 if test -x $p/curl; then
24 if test -z $curl; then
25 echo "curl not found. $PREFIX can not be tested"
28 GET='$curl --silent --output $OUT2 "$f"'
29 POST='$curl --silent --header "Content-Type: text/xml" --data-binary "@$postfile" --output $OUT2 "$f"'
35 if test "x${PREFIX}" = "x"; then
36 echo Missing prefix for run_pazpar2.sh
41 VALGRINDLOG=${PREFIX}_valgrind.log
43 if test -n "$PAZPAR2_USE_VALGRIND"; then
44 valgrind --leak-check=full --log-file=$VALGRINDLOG ../src/pazpar2 -X -l pazpar2.log -f ${CFG} >extra_pazpar2.log 2>&1 &
46 YAZ_LOG=zoom,zoomdetails,debug,log,fatal ../src/pazpar2 -d -X -l pazpar2.log -f ${srcdir}/${CFG} >extra_pazpar2.log 2>&1 &
52 # Give it a chance to start properly..
55 # Set to success by default.. Will be set to non-zero in case of failure
58 if ps -p $PP2PID >/dev/null 2>&1; then
63 echo "pazpar2 failed to start"
66 # We can start test for real
69 for f in `cat ${srcdir}/${URLS}`; do
70 if echo $f | grep '^http' >/dev/null; then
71 OUT1=${srcdir}/${PREFIX}_${testno}.res
72 OUT2=${PREFIX}_${testno}.log
73 DIFF=${PREFIX}_${testno}.dif
75 if test -n "${postfile}"; then
80 if test ! -f $OUT2; then
83 if test -f $OUT1; then
84 if diff $OUT1 $OUT2 >$DIFF; then
87 echo "Test $testno: Failed. See $OUT1, $OUT2 and $DIFF"
92 echo "Test $testno: Making for the first time"
96 testno=`expr $testno + 1`
98 elif echo $f | grep '^[0-9]' >/dev/null; then
104 echo "File $f does not exist"
108 if ps -p $PP2PID >/dev/null 2>&1; then
112 echo "Test $testno: pazpar2 died"
119 if test -n "$PP2PID"; then