Changeset 484


Ignore:
Timestamp:
Jun 2, 2014, 1:23:20 PM (11 years ago)
Author:
djay
Message:

Update testing script for the WPS Benchmarking.

Location:
trunk/testing
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/testing/run.sh

    r348 r484  
    2424WPSInstance=$1
    2525ServiceName=$2
     26NBRequests=1000
     27NBConcurrents=50
    2628
    2729function kvpRequest {
    28     echo "Simple KVP request "
    29     echo "$1"
    30     curl -o "$2" "$1"
    31     echo "Checking for ${3} response XML validity..."
     30    echo " **"
     31    echo " * Simple KVP request start on $(date)"
     32    echo " * [$1] "
     33    echo " **"
     34   
     35    RESP=$(curl -v -o "$2" "$1" 2> tmp/temp.log; grep "< HTTP" tmp/temp.log | cut -d' ' -f3)
     36    if [ "${3}" == "owsExceptionReport" ]; then
     37        echo " *********************************"
     38        if [ "$RESP" == "200" ]; then
     39            echo " ! Invalid response code ($RESP)"
     40        else
     41            echo " * Valid response code ($RESP)"
     42        fi
     43        echo " *********************************"
     44        echo " * Checking for ${3} response XML validity..."
     45        echo " * Schema: [http://schemas.opengis.net/ows/1.1.0/${3}.xsd]"
     46        echo " *********************************"
     47        xmllint --noout --schema http://schemas.opengis.net/ows/1.1.0/${3}.xsd "$2"
     48        echo " *********************************"
     49        echo "Verifying that the missing / wrong argument was referenced in locator and the exceptionCode take the corresponding value ..."
     50        echo -n " *********************************"
     51        xsltproc ./extractExceptionInfo.xsl "$2"
     52        echo " *********************************"
     53    else
     54        if [ "$RESP" == "200" ]; then
     55            echo " * Valid response code ($RESP)"
     56        else
     57            echo " ! Invalid response code ($RESP)"
     58        fi
     59        echo " * Checking for ${3} response XML validity..."
     60        echo " * Schema: [http://schemas.opengis.net/wps/1.0.0/wps${3}_response.xsd]"
     61        xmllint --noout --schema http://schemas.opengis.net/wps/1.0.0/wps${3}_response.xsd "$2"
     62    fi
     63    echo " **"
     64    echo " * Sending 10000 ${3} requests starting on $(date) ..."
     65    echo " **"
     66    ab -n "$NBRequests" -c "$NBConcurrents" "$1"
     67    echo " ** Ending on $(date)"
     68}
     69
     70function postRequest {
     71    echo " **"
     72    echo " * Simple POST request started on $(date)"
     73    echo " **"
     74    echo " * Checking for ${3} request XML validity..."
     75    echo " * Schema: http://schemas.opengis.net/wps/1.0.0/wps${3}_request.xsd"
     76    echo " *********************************"
     77    xmllint --noout --schema http://schemas.opengis.net/wps/1.0.0/wps${3}_request.xsd "$4"
     78    echo " *********************************"
     79    curl -H "Content-type: text/xml" -d@"$4" -o "$2" "$1"
     80    echo " * Checking for ${3} response XML validity on $(date) ..."
     81    echo " * Schema: http://schemas.opengis.net/wps/1.0.0/wps${3}_response.xsd"
     82    echo " *********************************"
    3283    xmllint --noout --schema http://schemas.opengis.net/wps/1.0.0/wps${3}_response.xsd "$2"
    33 }
    34 
    35 function postRequest {
    36     echo "Simple POST request "
    37     echo "Checking for ${3} request XML validity..."
    38     xmllint --noout --schema http://schemas.opengis.net/wps/1.0.0/wps${3}_request.xsd "$4"
    39     curl -H "Content-type: text/xml" -d@"$4" -o "$2" "$1"
    40     echo "Checking for ${3} response XML validity..."
    41     xmllint --noout --schema http://schemas.opengis.net/wps/1.0.0/wps${3}_response.xsd "$2"
     84    echo " *********************************"
    4285    if [ -z "$5" ]; then
    4386        echo ""
    4487    else
     88        echo " * Schema: http://schemas.opengis.net/wps/1.0.0/wps${3}_response.xsd"
     89        echo " *********************************"
    4590        xmllint --noout --schema http://schemas.opengis.net/wps/1.0.0/wps${3}_response.xsd "$(xsltproc ./extractStatusLocation.xsl $2)"
     91        echo " *********************************"
    4692    fi
    47 }
    48 
    49 
    50 #
    51 # Tests for GetCapabilities using KVP and POST requests
    52 #
    53 kvpRequest "${WPSInstance}?request=GetCapabilities&service=WPS" "tmp/outputGC1.xml" "GetCapabilities"
    54 
    55 kvpRequest "${WPSInstance}?REQUEST=GetCapabilities&SERVICE=WPS" "tmp/outputGC2.xml" "GetCapabilities"
     93    echo " * Sending 10000 ${3} XML requests on $(date) ..."
     94    ab -T "text/xml" -p "$4" -n "$NBRequests" -c "$NBConcurrents" "$1"
     95    echo " ** Ending on $(date)"
     96}
     97
     98function kvpRequestWrite {
     99    suffix=""
     100    cnt=0
     101    cnt0=0
     102    for i in $2; do
     103        if [ ! $1 -eq $cnt0 ]; then
     104            if [ $cnt -gt 0 ]; then
     105                suffix="$suffix&$(echo $i | sed 's:\"::g')"
     106            else
     107                suffix="$(echo $i | sed 's:\"::g')"
     108            fi
     109            cnt=$(expr $cnt + 1)
     110        fi
     111        cnt0=$(expr $cnt0 + 1)
     112    done
     113    echo $suffix
     114}
     115
     116function kvpWrongRequestWrite {
     117    suffix=""
     118    cnt=0
     119    cnt0=0
     120    for i in $2; do
     121        if [ ! $1 -eq $cnt0 ]; then
     122            if [ $cnt -gt 0 ]; then
     123                suffix="$suffix&$(echo $i | sed 's:\"::g')"
     124            else
     125                suffix="$(echo $i | sed 's:\"::g')"
     126            fi
     127            cnt=$(expr $cnt + 1)
     128        else
     129            cnt1=0
     130            for j in $3; do
     131                if [ $cnt1 -eq $1 ]; then
     132                    suffix="$suffix&$(echo $j | sed 's:\"::g')"
     133                fi
     134                cnt1=$(expr $cnt1 + 1)
     135            done
     136        fi
     137        cnt0=$(expr $cnt0 + 1)
     138    done
     139    echo $suffix
     140}
     141
     142
     143#
     144# Tests for GetCapabilities using KVP (including wrong requests) and POST requests
     145#
     146kvpRequest "${WPSInstance}?REQUEST=GetCapabilities&SERVICE=WPS" "tmp/outputGC1.xml" "GetCapabilities"
     147
     148params='"request=GetCapabilities" "service=WPS"'
     149
     150suffix=$(kvpRequestWrite -1 "$params")
     151kvpRequest "${WPSInstance}?$suffix" "tmp/outputGC2.xml" "GetCapabilities"
     152
     153for j in 0 1; do
     154    suffix=$(kvpRequestWrite $j "$params")
     155    kvpRequest "${WPSInstance}?$suffix" "tmp/outputGC$(expr $j + 3).xml" "owsExceptionReport"
     156done
     157
     158paramsw='"request=GetCapabilitie" "service=WXS"'
     159for j in 0 1; do
     160    suffix=$(kvpWrongRequestWrite $j "$params" "$paramsw")
     161    kvpRequest "${WPSInstance}?$suffix" "tmp/outputGC$(expr $j + 5).xml" "owsExceptionReport"
     162done
    56163
    57164echo "Check if differences between upper case and lower case parameter names"
     
    69176kvpRequest "${WPSInstance}?request=DescribeProcess&service=WPS&version=1.0.0&Identifier=ALL" "tmp/outputDPall.xml" "DescribeProcess"
    70177
    71 kvpRequest "${WPSInstance}?request=DescribeProcess&service=WPS&version=1.0.0&Identifier=${ServiceName}" "tmp/outputDPb1.xml" "DescribeProcess"
     178params='"request=DescribeProcess" "service=WPS" "version=1.0.0" "Identifier='${ServiceName}'"'
     179
     180suffix=$(kvpRequestWrite -1 "$params")
     181kvpRequest "${WPSInstance}?$suffix" "tmp/outputDPb1.xml" "DescribeProcess"
     182
     183for j in 0 1 2 3; do
     184    suffix=$(kvpRequestWrite $j "$params")
     185    kvpRequest "${WPSInstance}?$suffix" "tmp/outputDPb$(expr $j + 2).xml" "owsExceptionReport"
     186done
     187
     188paramsw='"request=DescribeProces" "service=WXS" "version=1.2.0" "Identifier=Undefined"'
     189
     190for j in 0 1 2 3; do
     191    suffix=$(kvpWrongRequestWrite $j "$params")
     192    kvpRequest "${WPSInstance}?$suffix" "tmp/outputDPb$(expr $j + 6).xml" "owsExceptionReport"
     193done
     194
     195kvpRequest "${WPSInstance}?request=DescribeProcess&service=WPS&Identifier=${ServiceName}" "tmp/outputDPb10.xml" "DescribeProcess"
    72196
    73197echo ""
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png