projects
/
pazpar2-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Option --perf performs timing of pazpar2 process
[pazpar2-moved-to-github.git]
/
test
/
run_pazpar2.sh
diff --git
a/test/run_pazpar2.sh
b/test/run_pazpar2.sh
index
989e257
..
20395aa
100755
(executable)
--- a/
test/run_pazpar2.sh
+++ b/
test/run_pazpar2.sh
@@
-14,8
+14,9
@@
WAIT=120
kill_pazpar2()
{
kill_pazpar2()
{
- if test -n "$PP2PID"; then
+ if test -z "$SKIP_PAZPAR2" -a -n "$PP2PID"; then
kill $PP2PID
kill $PP2PID
+ PP2PID=""
fi
if test -f ztest.pid; then
kill `cat ztest.pid`
fi
if test -f ztest.pid; then
kill `cat ztest.pid`
@@
-27,6
+28,7
@@
kill_pazpar2()
fi
}
fi
}
+perf=false
ztest=false
icu=false
while test $# -gt 0; do
ztest=false
icu=false
while test $# -gt 0; do
@@
-41,6
+43,9
@@
while test $# -gt 0; do
--icu)
icu=true
;;
--icu)
icu=true
;;
+ --perf)
+ perf=true
+ ;;
-*)
echo "Bad option $1"
exit 1
-*)
echo "Bad option $1"
exit 1
@@
-84,6
+89,9
@@
if test "$icu" = "true"; then
fi
if test "$ztest" = "true" ; then
fi
if test "$ztest" = "true" ; then
+ YAZ_ZTEST_XML_FETCH=${srcdir}/${PREFIX}.
+ export YAZ_ZTEST_XML_FETCH
+
oIFS=$IFS
IFS=:
F=''
oIFS=$IFS
IFS=:
F=''
@@
-103,7
+111,7
@@
if test "$ztest" = "true" ; then
if test -x $p/ztest/yaz-ztest; then
VERSION=`$p/ztest/yaz-ztest -V 2>/dev/null|awk '{print $3;}'|awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
if test -n "$VERSION"; then
if test -x $p/ztest/yaz-ztest; then
VERSION=`$p/ztest/yaz-ztest -V 2>/dev/null|awk '{print $3;}'|awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
if test -n "$VERSION"; then
- if "$VERSION" -ge 4002052; then
+ if test "$VERSION" -ge 4002052; then
F=$p/ztest/yaz-ztest
break
fi
F=$p/ztest/yaz-ztest
break
fi
@@
-142,18
+150,24
@@
else
sec=1
maxrounds=10
fi
sec=1
maxrounds=10
fi
-LEVELS=loglevel,fatal,warn,log,debug,notime,zoom,zoomdetails
+LEVELS=loglevel,fatal,warn,log,debug,zoom,zoomdetails
if test -n "$PAZPAR2_USE_VALGRIND"; then
valgrind --num-callers=30 --show-reachable=yes --leak-check=full --log-file=$VALGRINDLOG ../src/pazpar2 -v $LEVELS -X -l ${PREFIX}_pazpar2.log -f ${CFG} >${PREFIX}_extra_pazpar2.log 2>&1 &
PP2PID=$!
if test -n "$PAZPAR2_USE_VALGRIND"; then
valgrind --num-callers=30 --show-reachable=yes --leak-check=full --log-file=$VALGRINDLOG ../src/pazpar2 -v $LEVELS -X -l ${PREFIX}_pazpar2.log -f ${CFG} >${PREFIX}_extra_pazpar2.log 2>&1 &
PP2PID=$!
- sleep 6
+ sleep 0.01
WAIT=400
elif test -n "$SKIP_PAZPAR2"; then
echo "${PREFIX}: not starting Pazpar2 (should be running already)"
WAIT=400
elif test -n "$SKIP_PAZPAR2"; then
echo "${PREFIX}: not starting Pazpar2 (should be running already)"
+elif $perf; then
+ /usr/bin/time -p ../src/pazpar2 -p pazpar2.pid -X -l ${PREFIX}_pazpar2.log -f ${srcdir}/${CFG} >${PREFIX}_extra_pazpar2.log 2>&1 &
+ PP2PID=$!
+ sleep 1
+ if test -f pazpar2.pid; then
+ PP2PID=`cat pazpar2.pid`
+ fi
else
../src/pazpar2 -v $LEVELS -d -X -l ${PREFIX}_pazpar2.log -f ${srcdir}/${CFG} >${PREFIX}_extra_pazpar2.log 2>&1 &
PP2PID=$!
else
../src/pazpar2 -v $LEVELS -d -X -l ${PREFIX}_pazpar2.log -f ${srcdir}/${CFG} >${PREFIX}_extra_pazpar2.log 2>&1 &
PP2PID=$!
- sleep 2
fi
if [ -z "$SKIP_PAZPAR2" -a -z "$WAIT_PAZPAR2" ] ; then
fi
if [ -z "$SKIP_PAZPAR2" -a -z "$WAIT_PAZPAR2" ] ; then
@@
-180,7
+194,8
@@
code=0
# We can start test for real
testno=1
# We can start test for real
testno=1
-rounds=1
+# set rounds to "wait" because pazpar2 might not be ready
+rounds=$maxrounds
for f in `cat ${srcdir}/${URLS}`; do
if echo $f | grep '^http' >/dev/null; then
OUT1=${srcdir}/${PREFIX}_${testno}.res
for f in `cat ${srcdir}/${URLS}`; do
if echo $f | grep '^http' >/dev/null; then
OUT1=${srcdir}/${PREFIX}_${testno}.res
@@
-213,10
+228,11
@@
for f in `cat ${srcdir}/${URLS}`; do
fi
fi
else
fi
fi
else
- if test $rounds -eq 0; then
+ if test $testno -eq 1 -o $rounds -eq 0; then
echo "${PREFIX} $testno: Making for the first time"
mv $OUT2 $OUT1
code=1
echo "${PREFIX} $testno: Making for the first time"
mv $OUT2 $OUT1
code=1
+ rounds=0
fi
fi
if test $rounds -gt 0; then
fi
fi
if test $rounds -gt 0; then
@@
-246,7
+262,9
@@
for f in `cat ${srcdir}/${URLS}`; do
else
echo "${PREFIX} $testno: pazpar2 died"
fi
else
echo "${PREFIX} $testno: pazpar2 died"
fi
- exit 1
+ PP2PID=""
+ code=1
+ break
fi
fi
done
fi
fi
done
@@
-260,15
+278,10
@@
if [ "$WAIT_PAZPAR2" ] ; then
done
echo "done"
fi
done
echo "done"
fi
-# Kill programs
-if test -f ztest.pid; then
- kill `cat ztest.pid`
- rm -f ztest.pid
-fi
-
-if [ -z "$SKIP_PAZPAR2" ] ; then
- kill_pazpar2
- sleep 2
+kill_pazpar2
+sleep 2
+if $perf; then
+ tail -3 ${PREFIX}_extra_pazpar2.log
fi
exit $code
fi
exit $code