X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=tests%2Fnon_regression_tests%2Fqizx.sh;h=763ed53b87a13f04fd9435e1bbafde3b6b867e5c;hb=2e74356449e2ea3ab50ccb96ec81e4cf657bae5f;hp=d9f56dda506cc8568bbc501c587850a35c009379;hpb=665d6da4926723b2f2e3a59ba27f614c6ba5cf34;p=SXSI%2Fxpathcomp.git diff --git a/tests/non_regression_tests/qizx.sh b/tests/non_regression_tests/qizx.sh index d9f56dd..763ed53 100755 --- a/tests/non_regression_tests/qizx.sh +++ b/tests/non_regression_tests/qizx.sh @@ -1,26 +1,151 @@ #!/bin/bash -QIZX="/usr/local/bin/alarm 600 22000000 /raid0/kn/qizx/qizx-fe-4.1p1/bin/qizx" +QIZX="/raid0/kn/qizx/qizx-fe-4.1p1/bin/qizx.alarm" + +source utils.sh + +function stop_qizx() { + sleep 2 +# rm -rf mat.xq count.xq + QIZXPIDS=`ps xwww --format "%p,%a" | grep java | grep qizx | cut -f 1 -d ' '` + for i in $QIZXPIDS + do + kill -TERM "$i" + sleep 2 + KILLED=`ps aux | grep '^'$i` + if [ "$KILLED" ] + then + kill -9 "$i" + fi + sleep 3 + rm -f /raid0/kn/qizxlib/*/lock + while true + do + o=/raid0/kn/qizx/qizx-fe-4.1p1/bin/qizx -g /raid0/kn/qizxlib/ -l xmark -check /tmp/log >/dev/null 2>&1 + sleep 2 + if [ -z "$o" ] + then + break + fi + done + done + +} + +trap stop_qizx INT TERM function do_qizx() { - + + stop_qizx + query="$1" - doc=`basename "$2" .xml` + doc=`basename "$2"` + repeat="$3" + count="$4" echo 'let $doc := collection("'"$doc"'") return count($doc'"$query"')' > count.xq echo 'let $doc := collection("'"$doc"'") return $doc'"$query" > mat.xq - { - read count; - } < <($QIZX -g /raid0/kn/qizxlib/ -l xmark count.xq 2>&1 ) - { - read time_count; - } < <($QIZX -g /raid0/kn/qizxlib/ -l xmark -mr 4 count.xq 2>&1 | grep evaluation | cut -f2 -d ',' | grep -o '[0-9.]*' | head -1 ) - - { - read time_mat; - } < <($QIZX -g /raid0/kn/qizxlib/ -l xmark -mr 2 mat.xq 2>&1 | grep evaluation | cut -f2 -d ',' | grep -o '[0-9.]*' | sort -g | head -1 ) - + + IT=0 + while true + do + OUTPUT=`$QIZX -g /raid0/kn/qizxlib/ -l xmark count.xq 2>&1` + if echo "$OUTPUT" | grep -q 'java' >/dev/null 2>&1 + then + if [ "$IT" = 5 ] + then + break + fi + IT=$(($IT + 1)) + continue + fi + + { + read count; + } < <(echo "$OUTPUT") + + stop_qizx + sleep 3 + tmp=`echo "$count" | grep -o '[0-9.]\+'` + if [ "$tmp" = "$count" ] + then + break + fi + done + + IT=0 + while true + do + + OUTPUT=`$QIZX -g /raid0/kn/qizxlib/ -l xmark -r "$repeat" count.xq 2>&1` + if echo "$OUTPUT" | grep -q 'java' >/dev/null 2>&1 + then + if [ "$IT" = 5 ] + then + break + fi + IT=$(($IT + 1)) + continue + fi + + { + read time_count; + } < <(echo "$OUTPUT" | grep 'display time' | cut -f 3 -d : | grep -o '[0-9]\+'| tail -n +1 | average ) + + + stop_qizx + sleep 3 + if [ -z "$time_count" ] + then + break + fi + tmp=`echo "$time_count" | grep -o '[0-9.]\+'` + if [ "$tmp" = "$time_count" ] + then + break + fi + done + + IT=0 + if [ -z "$count" ] + then + + while true + do + OUTPUT=`$QIZX -g /raid0/kn/qizxlib/ -l xmark -r "$repeat" mat.xq -out /dev/null 2>&1` + if echo "$OUTPUT" | grep -q 'java' >/dev/null 2>&1 + then + if [ "$IT" = 5 ] + then + break + fi + IT=$(($IT + 1)) + continue + fi + + { + read time_mat; + } < <(echo "$OUTPUT" 2>&1 | grep 'display time' | cut -f 3 -d : | grep -o '[0-9]\+'| tail -n +1 | average) + + stop_qizx + sleep 3 + if [ -z "$time_mat" ] + then + break + fi + + + tmp=`echo "$time_mat" | grep -o '[0-9.]\+'` + if [ "$tmp" = "$time_mat" ] + then + break + fi + done + else + time_mat="999999" + fi + echo $time_count echo 0 - echo $time_mat + echo $time_mat echo $count }