You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ic...@apache.org on 2016/02/10 16:46:46 UTC

svn commit: r1729633 - in /httpd/test/mod_h2/trunk: conf/httpd.conf mh2fuzz/mh2f_fuzzer.c test/test_fuzz.sh test/test_keepalive.sh

Author: icing
Date: Wed Feb 10 15:46:46 2016
New Revision: 1729633

URL: http://svn.apache.org/viewvc?rev=1729633&view=rev
Log:
some conf tweaks and fixed keepalive tests

Modified:
    httpd/test/mod_h2/trunk/conf/httpd.conf
    httpd/test/mod_h2/trunk/mh2fuzz/mh2f_fuzzer.c
    httpd/test/mod_h2/trunk/test/test_fuzz.sh
    httpd/test/mod_h2/trunk/test/test_keepalive.sh

Modified: httpd/test/mod_h2/trunk/conf/httpd.conf
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/conf/httpd.conf?rev=1729633&r1=1729632&r2=1729633&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/conf/httpd.conf (original)
+++ httpd/test/mod_h2/trunk/conf/httpd.conf Wed Feb 10 15:46:46 2016
@@ -23,6 +23,20 @@ LogLevel warn
 
 CoreDumpDirectory "/tmp"
 
+# unlimited connection reuse
+MaxKeepAliveRequests 0
+
+<IfModule event_module>
+    StartServers 2
+    ThreadsPerChild 64
+    AsyncRequestWorkerFactor 1
+</IfModule>
+<IfModule worker_module>
+    StartServers 2
+    ThreadsPerChild 64
+</IfModule>
+
+
 DocumentRoot "SUBST_SERVER_ROOT_SUBST/htdocs"
 <Directory "SUBST_SERVER_ROOT_SUBST/htdocs">
     Options Indexes FollowSymLinks 
@@ -75,9 +89,6 @@ DocumentRoot "SUBST_SERVER_ROOT_SUBST/ht
     SetHandler server-status
 </Location>
 
-# unlimited connection reuse
-MaxKeepAliveRequests 0
-
     #LogLevel core:debug
     #LogLevel ssl:trace1
     #LogLevel proxy:debug    

Modified: httpd/test/mod_h2/trunk/mh2fuzz/mh2f_fuzzer.c
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/mh2fuzz/mh2f_fuzzer.c?rev=1729633&r1=1729632&r2=1729633&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/mh2fuzz/mh2f_fuzzer.c (original)
+++ httpd/test/mod_h2/trunk/mh2fuzz/mh2f_fuzzer.c Wed Feb 10 15:46:46 2016
@@ -240,6 +240,8 @@ static h2c_conn_obs *sr_create(const cha
     h2c_session_obs obs;
     const char *name;
     int delay;
+    int count;
+    int min;
 } fuzzer_ds;
 
 static void ds_submit(h2c_session *s, h2c_stream *stream, h2c_request *r, 
@@ -247,6 +249,10 @@ static void ds_submit(h2c_session *s, h2
 {
     fuzzer_ds *f = obs->ctx;
     
+    ++f->count;
+    if (f->count <= f->min) {
+        return;
+    }
     if (s->c->verbose > 1) {
         fprintf(stderr, "h2c_conn(%ld): submit %d delay %d ms\n", s->c->id, stream->id, f->delay);
     }
@@ -268,10 +274,15 @@ static h2c_session_obs *ds_create(const
     f->obs.before_submit = ds_submit;
     
     if (strlen(f->name) > prelen) {
-        int n = (int)apr_atoi64(f->name+prelen);
+        const char *s = f->name + prelen;
+        int n = (int)apr_atoi64(s);
         if (n > 0) {
             f->delay = n;
         }
+        s = strchr(s, '-');
+        if (s && *s++) {
+            f->min = (int)apr_atoi64(s);
+        } 
     }
     return &f->obs;
 }

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=1729633&r1=1729632&r2=1729633&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_fuzz.sh (original)
+++ httpd/test/mod_h2/trunk/test/test_fuzz.sh Wed Feb 10 15:46:46 2016
@@ -61,10 +61,10 @@ fuzz-delay() {
     echo -n " * on $URL: "
 	for i in $*; do 
         echo -n "$i "
-        $MH2FUZZ -q -t 8 -c 8 -m 1 -n 32 -f random-delay$i $URL/ 2>&1 |
+        $MH2FUZZ -q -t 8 -c 8 -m 1 -n 24 -f random-delay$i $URL/ 2>&1 |
         while read numbers xxx; do
             case "$numbers" in
-              */0/0/0/0)
+              */0/0/0/*)
                 ;;
               *)
                 echo "unexpected result: $numbers $xxx"

Modified: httpd/test/mod_h2/trunk/test/test_keepalive.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/test_keepalive.sh?rev=1729633&r1=1729632&r2=1729633&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_keepalive.sh (original)
+++ httpd/test/mod_h2/trunk/test/test_keepalive.sh Wed Feb 10 15:46:46 2016
@@ -19,17 +19,31 @@ HTTPS_URL="$2"
 
 source $(dirname $0)/test_common.sh
 
-URL_PREFIX="$HTTP_URL"
-mh2fuzz_check_recv_frames index.html "timeout on $URL_PREFIX" -f submit-delay5500 <<EOF
+for i in "$HTTP_URL" "$HTTPS_URL"; do
+    URL_PREFIX="$i"
+
+# delay of the first request uses Timeout and not KeepAliveTimeout
+# should succeed
+mh2fuzz_check_recv_frames index.html "timeout on $URL_PREFIX" \
+        -f submit-delay5500 <<EOF
 0: recv SETTINGS[length=6, stream=0]
 0: recv WINDOW_UPDATE[stream=0, inc=2147418112]
-0: recv GOAWAY[error=0, last_stream=0, reason='timeout']
+0: recv HEADERS[count=0, hend=1, stream=1, eos=0]
+0: recv DATA[length=2005, flags=0, stream=1, padlen=0]
+0: recv DATA[length=0, flags=1, stream=1, padlen=0]
 EOF
 
-
-URL_PREFIX="$HTTPS_URL"
-mh2fuzz_check_recv_frames index.html "timeout on $URL_PREFIX" -f submit-delay5500 <<EOF
+# delay of second request uses KeepAliveTimeout
+# should GOAWAY
+mh2fuzz_check_recv_frames index.html "keepalive on $URL_PREFIX" \
+        -f submit-delay5500-1 $URL_PREFIX/index2.html <<EOF
 0: recv SETTINGS[length=6, stream=0]
 0: recv WINDOW_UPDATE[stream=0, inc=2147418112]
-0: recv GOAWAY[error=0, last_stream=0, reason='timeout']
+0: recv HEADERS[count=0, hend=1, stream=1, eos=0]
+0: recv DATA[length=2005, flags=0, stream=1, padlen=0]
+0: recv DATA[length=0, flags=1, stream=1, padlen=0]
+0: recv GOAWAY[error=0, last_stream=1, reason='timeout']
 EOF
+
+done
+