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
45 valgrind --leak-check=full --log-file=$VALGRINDLOG ../src/pazpar2 -X -l pazpar2.log -f ${CFG} >extra_pazpar2.log 2>&1 &
47 YAZ_LOG=zoom,zoomdetails,debug,log,fatal ../src/pazpar2 -d -X -l pazpar2.log -f ${srcdir}/${CFG} >extra_pazpar2.log 2>&1 &
53 # Give it a chance to start properly..
56 # Set to success by default.. Will be set to non-zero in case of failure
59 if ps -p $PP2PID >/dev/null 2>&1; then
64 echo "pazpar2 failed to start"
67 # We can start test for real
74 for f in `cat ${srcdir}/${URLS}`; do
75 if echo $f | grep '^http' >/dev/null; then
76 OUT1=${srcdir}/${PREFIX}_${testno}.res
77 OUT2=${PREFIX}_${testno}.log
78 DIFF=${PREFIX}_${testno}.dif
80 if test -n "${postfile}"; then
85 if test ! -f $OUT2; then
88 if test -f $OUT1; then
89 if diff $OUT1 $OUT2 >$DIFF; then
92 echo "Test $testno: Failed. See $OUT1, $OUT2 and $DIFF"
97 echo "Test $testno: Making for the first time"
101 testno=`expr $testno + 1`
103 elif echo $f | grep '^[0-9]' >/dev/null; then
109 echo "File $f does not exist"
113 if ps -p $PP2PID >/dev/null 2>&1; then
117 echo "Test $testno: pazpar2 died"
125 if test -n "$PP2PID"; then