httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ic...@apache.org
Subject svn commit: r1748165 - /httpd/test/mod_h2/trunk/test/test_proxy.sh
Date Mon, 13 Jun 2016 09:48:08 GMT
Author: icing
Date: Mon Jun 13 09:48:08 2016
New Revision: 1748165

URL: http://svn.apache.org/viewvc?rev=1748165&view=rev
Log:
adding upload flow tests

Modified:
    httpd/test/mod_h2/trunk/test/test_proxy.sh

Modified: httpd/test/mod_h2/trunk/test/test_proxy.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/test_proxy.sh?rev=1748165&r1=1748164&r2=1748165&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_proxy.sh (original)
+++ httpd/test/mod_h2/trunk/test/test_proxy.sh Mon Jun 13 09:48:08 2016
@@ -62,28 +62,66 @@ requests: 10000 total, 10000 started, 10
 EOF
 }
 
-two_engines() {
-    URL_PREFIX="$1"
-    cat > $TMP/urls.txt << EOF
-$URL_PREFIX/h2proxy/004.html
-$URL_PREFIX/h2proxy/004/gophertiles_002.jpg
-$URL_PREFIX/h2proxy/004/gophertiles_003.jpg
-$URL_PREFIX/h2proxy/004/gophertiles_004.jpg
-$URL_PREFIX/h2proxy/004/gophertiles_005.jpg
-$URL_PREFIX/h2cproxy/004.html
-$URL_PREFIX/h2cproxy/004/gophertiles_002.jpg
-$URL_PREFIX/h2cproxy/004/gophertiles_003.jpg
-$URL_PREFIX/h2cproxy/004/gophertiles_004.jpg
-$URL_PREFIX/h2cproxy/004/gophertiles_005.jpg
-EOF
-    h2load_check_requests "loading from 2 proxied locations" \
-        -i $TMP/urls.txt -n 10000 -c 1 -t 1 -m 100  <<EOF
-requests: 10000 total, 10000 started, 10000 done, 10000 succeeded, 0 failed, 0 errored, 0
timeout
-EOF
+do-upload() {
+    size=$1; shift;
+    n=$1; shift;
+    proto=$1; shift
+    local i=0
+
+    echo -n "upload $n x $size using $proto"
+    while test $i -lt $n; do
+        result=$( curl_post_file upload.py $GEN/data-$size  "$size upload" $proto )
+        if test "$result" != " * curl /upload.py: $size upload...ok."; then
+            echo "$result"
+            exit 1
+        fi
+        echo -n "."
+        i=$[ i + 1 ]
+    done
+    echo "ok."
 }
 
+large-upload() {
+    URL_PREFIX="$1"
+    local CHR100="012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678
+"
+
+    if [ ! -f $GEN/data-1k ]; then
+        i=0; while [ $i -lt 10 ]; do
+            echo -n "$CHR100"
+            i=$[ i + 1 ]
+        done > $GEN/data-1k
+    fi
+
+    if [ ! -f $GEN/data-10k ]; then
+        i=0; while [ $i -lt 10 ]; do
+            cat $GEN/data-1k
+            i=$[ i + 1 ]
+        done  > $GEN/data-10k
+    fi
+
+    if [ ! -f $GEN/data-100k ]; then
+        i=0; while [ $i -lt 10 ]; do
+            cat $GEN/data-10k
+            i=$[ i + 1 ]
+        done > $GEN/data-100k
+    fi
+
+    if [ ! -f $GEN/data-1m ]; then
+        i=0; while [ $i -lt 10 ]; do
+            cat $GEN/data-100k
+            i=$[ i + 1 ]
+        done > $GEN/data-1m
+    fi
+    
+    echo "curl upload to $URL_PREFIX"
+    do-upload 1m 8 --http2
+    do-upload 1m 8 --http1.1
+}
 
 if min_version 2.4.21; then
+large-upload $HTTPS_AUTH/h2cproxy                                             &&
+large-upload $HTTPS_AUTH/h2proxy                                              &&
 $SHELL "$TEST_DIR"/test_nghttp_get.sh  $HTTPS_AUTH/h2cproxy-rewrite           &&
 $SHELL "$TEST_DIR"/test_nghttp_post.sh $HTTPS_AUTH/h2cproxy-rewrite           &&
 $SHELL "$TEST_DIR"/test_curl_get.sh    $HTTPS_AUTH/h2cproxy-rewrite           &&



Mime
View raw message