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
33 VALGRINDLOG=${PREFIX}_valgrind.log
37 valgrind --leak-check=full --log-file=$VALGRINDLOG ../src/pazpar2 -X -l pazpar2.log -f ${CFG} >extra_pazpar2.log 2>&1 &
39 YAZ_LOG=zoom,zoomdetails,debug,log,fatal ../src/pazpar2 -d -X -l pazpar2.log -f ${srcdir}/${CFG} >extra_pazpar2.log 2>&1 &
45 # Give it a chance to start properly..
48 # Set to success by default.. Will be set to non-zero in case of failure
51 if ps -p $PP2PID >/dev/null 2>&1; then
56 echo "pazpar2 failed to start"
59 # We can start test for real
66 for f in `cat ${srcdir}/${URLS}`; do
67 if echo $f | grep '^http' >/dev/null; then
68 OUT1=${srcdir}/${PREFIX}_${testno}.res
69 OUT2=${PREFIX}_${testno}.log
70 DIFF=${PREFIX}_${testno}.dif
72 if test -n "${wget}"; then
73 if test -n "${postfile}"; then
74 ${wget} -q -O $OUT2 --header="Content-Type: text/xml" --post-file=$postfile $f
76 ${wget} -q -O $OUT2 $f
78 elif test -n "${lynx}"; then
79 ${lynx} -dump $f >$OUT2
84 if test -f $OUT1; then
85 if diff $OUT1 $OUT2 >$DIFF; then
88 echo "Test $testno: Failed. See $OUT1, $OUT2 and $DIFF"
93 echo "Test $testno: Making for the first time"
97 testno=`expr $testno + 1`
99 elif echo $f | grep '^[0-9]' >/dev/null; then
105 echo "File $f does not exist"
109 if ps -p $PP2PID >/dev/null 2>&1; then
112 echo "Test $testno: pazpar2 died"
121 if test -n "$PP2PID"; then