Changeset 484 for trunk/testing
- Timestamp:
- Jun 2, 2014, 1:23:20 PM (11 years ago)
- Location:
- trunk/testing
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/testing/run.sh
r348 r484 24 24 WPSInstance=$1 25 25 ServiceName=$2 26 NBRequests=1000 27 NBConcurrents=50 26 28 27 29 function 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 70 function 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 " *********************************" 32 83 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 " *********************************" 42 85 if [ -z "$5" ]; then 43 86 echo "" 44 87 else 88 echo " * Schema: http://schemas.opengis.net/wps/1.0.0/wps${3}_response.xsd" 89 echo " *********************************" 45 90 xmllint --noout --schema http://schemas.opengis.net/wps/1.0.0/wps${3}_response.xsd "$(xsltproc ./extractStatusLocation.xsl $2)" 91 echo " *********************************" 46 92 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 98 function 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 116 function 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 # 146 kvpRequest "${WPSInstance}?REQUEST=GetCapabilities&SERVICE=WPS" "tmp/outputGC1.xml" "GetCapabilities" 147 148 params='"request=GetCapabilities" "service=WPS"' 149 150 suffix=$(kvpRequestWrite -1 "$params") 151 kvpRequest "${WPSInstance}?$suffix" "tmp/outputGC2.xml" "GetCapabilities" 152 153 for j in 0 1; do 154 suffix=$(kvpRequestWrite $j "$params") 155 kvpRequest "${WPSInstance}?$suffix" "tmp/outputGC$(expr $j + 3).xml" "owsExceptionReport" 156 done 157 158 paramsw='"request=GetCapabilitie" "service=WXS"' 159 for j in 0 1; do 160 suffix=$(kvpWrongRequestWrite $j "$params" "$paramsw") 161 kvpRequest "${WPSInstance}?$suffix" "tmp/outputGC$(expr $j + 5).xml" "owsExceptionReport" 162 done 56 163 57 164 echo "Check if differences between upper case and lower case parameter names" … … 69 176 kvpRequest "${WPSInstance}?request=DescribeProcess&service=WPS&version=1.0.0&Identifier=ALL" "tmp/outputDPall.xml" "DescribeProcess" 70 177 71 kvpRequest "${WPSInstance}?request=DescribeProcess&service=WPS&version=1.0.0&Identifier=${ServiceName}" "tmp/outputDPb1.xml" "DescribeProcess" 178 params='"request=DescribeProcess" "service=WPS" "version=1.0.0" "Identifier='${ServiceName}'"' 179 180 suffix=$(kvpRequestWrite -1 "$params") 181 kvpRequest "${WPSInstance}?$suffix" "tmp/outputDPb1.xml" "DescribeProcess" 182 183 for j in 0 1 2 3; do 184 suffix=$(kvpRequestWrite $j "$params") 185 kvpRequest "${WPSInstance}?$suffix" "tmp/outputDPb$(expr $j + 2).xml" "owsExceptionReport" 186 done 187 188 paramsw='"request=DescribeProces" "service=WXS" "version=1.2.0" "Identifier=Undefined"' 189 190 for j in 0 1 2 3; do 191 suffix=$(kvpWrongRequestWrite $j "$params") 192 kvpRequest "${WPSInstance}?$suffix" "tmp/outputDPb$(expr $j + 6).xml" "owsExceptionReport" 193 done 194 195 kvpRequest "${WPSInstance}?request=DescribeProcess&service=WPS&Identifier=${ServiceName}" "tmp/outputDPb10.xml" "DescribeProcess" 72 196 73 197 echo ""
Note: See TracChangeset
for help on using the changeset viewer.