X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;ds=inline;f=heikki%2Ftest1.sh;h=a742ce03fbaa7a0d771ccaa108c606da0dad7775;hb=b6b190610799a920163200fd5920406adcc3f6c0;hp=14032e91ee62535405b9503cbfcecdef14c2fa9e;hpb=d0fd447b713599adfb50f4b4c7a21efe7a3466e3;p=pazpar2-moved-to-github.git diff --git a/heikki/test1.sh b/heikki/test1.sh index 14032e9..a742ce0 100755 --- a/heikki/test1.sh +++ b/heikki/test1.sh @@ -5,24 +5,31 @@ # # (uses curl and xml-twig-tools) -DIR=`cd ..; pwd` -HDIR=$DIR/heikki -CFG="$DIR/etc/heikki-test1.cfg" +if [ "$1" == "clean" ] +then + echo "Cleaning up" + rm -f $PIDFILE $YAZPIDFILE *.out *.log *~ + exit +fi -PZ="$DIR/src/pazpar2" +URL="http://localhost:9017/" +CFG="test1.cfg" -PIDFILE=$HDIR/pz2.pid -YAZPIDFILE=$HDIR/yaz-ztest.pid +PZ="../src/pazpar2" + +PIDFILE=pz2.pid +YAZPIDFILE=yaz-ztest.pid yaz-ztest -p $YAZPIDFILE -l yaz-ztest.log & +rm -f *.out *.log -$PZ -f $CFG -w "$DIR/etc" -l $HDIR/pz2.log -p $PIDFILE & +$PZ -f $CFG -l pz2.log -p $PIDFILE & sleep 0.2 # make sure it has time to start echo "Init" -curl -s "http://localhost:9017/?command=init" > init.out +curl -s "$URL?command=init" > init.out SESSION=`xml_grep --text_only "//session" init.out ` -cat init.out +# cat init.out; echo echo "Got session $SESSION" SES="&session=$SESSION" @@ -32,19 +39,39 @@ QRY="query=computer" #SEARCH="command=search$SES&$QRY" SEARCH="command=search$SES&$QRY&sort=relevance" echo $SEARCH -curl -s "http://localhost:9017/?$SEARCH" > search.out -cat search.out +curl -s "$URL?$SEARCH" > search.out +cat search.out | grep search echo -SHOW="command=show$SES&sort=relevance" +STAT="command=stat&$SES" +echo "" > stat.out +LOOPING=1 +while [ $LOOPING = 1 ] +do + sleep 0.5 + curl -s "$URL?$STAT" > stat.out + ACT=`xml_grep --text_only "//activeclients" stat.out` + HIT=`xml_grep --text_only "//hits" stat.out` + REC=`xml_grep --text_only "//records" stat.out` + echo "$ACT $HIT $REC" + if grep -q "0" stat.out + then + LOOPING=0 + fi + echo >> stats.out + cat stat.out >> stats.out +done + + +SHOW="command=show$SES&sort=relevance_h&start=0&num=1000" echo $SHOW curl -s "http://localhost:9017/?$SHOW" > show.out -echo "md-score:" -grep "md-score" show.out -echo "relevance:" -grep "relevance" show.out +#grep "relevance" show.out | grep += | grep -v "(0)" +grep "round-robin" show.out echo echo "All done" kill `cat $PIDFILE` -kill `cat $YAZPIDFILE` \ No newline at end of file +kill `cat $YAZPIDFILE` +rm -f $PIDFILE $YAZPIDFILE +