httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ic...@apache.org
Subject svn commit: r1742283 - /httpd/test/mod_h2/trunk/test/test_fuzz.sh
Date Wed, 04 May 2016 13:37:45 GMT
Author: icing
Date: Wed May  4 13:37:45 2016
New Revision: 1742283

URL: http://svn.apache.org/viewvc?rev=1742283&view=rev
Log:
adding repeated uploads to fuzzing

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

Modified: httpd/test/mod_h2/trunk/test/test_fuzz.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/test_fuzz.sh?rev=1742283&r1=1742282&r2=1742283&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_fuzz.sh (original)
+++ httpd/test/mod_h2/trunk/test/test_fuzz.sh Wed May  4 13:37:45 2016
@@ -36,6 +36,63 @@ MH2FUZZ=mh2fuzz/mh2fuzz
 
 source $(dirname $0)/test_common.sh
 
+do-upload() {
+    size=$1; shift;
+    n=$1; shift;
+    local i=0
+
+    echo -n "upload $n x $size"
+    while test $i -lt $n; do
+        result=$( nghttp_post_file upload.py $GEN/data-$size  "$size upload w/o c-len" --no-content-length
)
+        if test "$result" != " * nghttp /upload.py: $size upload w/o c-len...ok."; then
+            echo "$result"
+            exit 1
+        fi
+        echo -n "."
+        i=$[ i + 1 ]
+    done
+    echo "ok."
+}
+
+fuzz-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
+    
+    do-upload 1k 60
+    do-upload 10k 60
+    do-upload 100k 60
+    do-upload 1m 60
+}
+
 fuzz-close() {
     URL="$1"; shift;
     echo -n " * on $URL: "
@@ -78,6 +135,9 @@ fuzz-delay() {
     echo "ok."
 }
 
+echo "fuzz upload"
+fuzz-upload $HTTP_AUTH  
+
 echo "test frames sent/recv on GETs"
 $SHELL "$TEST_DIR"/test_frames.sh      $HTTP_AUTH  $HTTPS_AUTH      || fail
 



Mime
View raw message