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/09/19 13:26:19 UTC

svn commit: r1761438 - in /httpd/test/mod_h2/trunk: Makefile.am htdocs/test.example.org/mnot164.py test/test.sh test/test_common.sh test/test_flow.sh test/test_x.sh

Author: icing
Date: Mon Sep 19 13:26:19 2016
New Revision: 1761438

URL: http://svn.apache.org/viewvc?rev=1761438&view=rev
Log:
adding brute force tests for output suspend handling

Added:
    httpd/test/mod_h2/trunk/htdocs/test.example.org/mnot164.py
    httpd/test/mod_h2/trunk/test/test_flow.sh
    httpd/test/mod_h2/trunk/test/test_x.sh
Modified:
    httpd/test/mod_h2/trunk/Makefile.am
    httpd/test/mod_h2/trunk/test/test.sh
    httpd/test/mod_h2/trunk/test/test_common.sh

Modified: httpd/test/mod_h2/trunk/Makefile.am
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/Makefile.am?rev=1761438&r1=1761437&r2=1761438&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/Makefile.am (original)
+++ httpd/test/mod_h2/trunk/Makefile.am Mon Sep 19 13:26:19 2016
@@ -128,6 +128,11 @@ test-ser: $(MH2FUZZ) $(SERVER_DIR)/.test
 	@mkdir -p $(GEN)/tmp
 	$(TESTRUN) test/test_ser.sh test $(HTTP_PORT) $(HTTPS_PORT) $(HOST_NAME) $(HOST_NAME_2) $(HOST_SER_NAME)
 
+test-x: $(MH2FUZZ) $(SERVER_DIR)/.test-setup
+	@rm -rf $(GEN)/tmp
+	@mkdir -p $(GEN)/tmp
+	$(TESTRUN) test/test_x.sh test $(HTTP_PORT) $(HTTPS_PORT) $(HOST_NAME) $(HOST_NAME_2) $(HOST_SER_NAME)
+
 test: test-gets test-proxy fuzz
 
 ################################################################################

Added: httpd/test/mod_h2/trunk/htdocs/test.example.org/mnot164.py
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/htdocs/test.example.org/mnot164.py?rev=1761438&view=auto
==============================================================================
--- httpd/test/mod_h2/trunk/htdocs/test.example.org/mnot164.py (added)
+++ httpd/test/mod_h2/trunk/htdocs/test.example.org/mnot164.py Mon Sep 19 13:26:19 2016
@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+
+import cgi
+import cgitb; cgitb.enable()
+import os
+import sys
+
+sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
+
+try:
+    form = cgi.FieldStorage()
+    count = form['count'].value
+    text = form['text'].value
+except KeyError:
+    text="a"
+    count=77784
+    
+    
+print "Status: 200 OK"
+print "Content-Type: text/html"
+print
+sys.stdout.write(text*int(count))

Modified: httpd/test/mod_h2/trunk/test/test.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/test.sh?rev=1761438&r1=1761437&r2=1761438&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test.sh (original)
+++ httpd/test/mod_h2/trunk/test/test.sh Mon Sep 19 13:26:19 2016
@@ -32,8 +32,6 @@ HTTPS_AUTH=https://$HOST_NAME:$HTTPS_POR
 HTTPS_AUTH_2=https://$HOST_NAME_2:$HTTPS_PORT
 HTTPS_AUTH_SER=https://$HOST_NAME_SER:$HTTPS_PORT
 
-echo "curl is $CURL"
-
 export CURL="$CURL"
 
 fail() {

Modified: httpd/test/mod_h2/trunk/test/test_common.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/test_common.sh?rev=1761438&r1=1761437&r2=1761438&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_common.sh (original)
+++ httpd/test/mod_h2/trunk/test/test_common.sh Mon Sep 19 13:26:19 2016
@@ -151,6 +151,17 @@ case "$OPT_DIRECT" in
         ;;
 esac
 
+curl_get_doc() {
+    local DOC="$1"; shift;
+    local MSG="$1"; shift;
+    ARGS="$@"
+    echo -n " * curl /$DOC: $MSG..."
+    rm -rf $TMP
+    mkdir -p $TMP
+    ${CURL} $ARGS -D $TMP/header $URL_PREFIX/$DOC > $TMP/body 2>&1 || fail
+    echo ok.
+}
+
 curl_check_doc() {
     local DOC="$1"; shift;
     local MSG="$1"; shift;
@@ -267,6 +278,16 @@ nghttp_check_rst_error() {
     echo ok.
 }
 
+nghttp_get_doc() {
+    local DOC="$1"; shift;
+    local MSG="$1"; shift;
+    rm -rf $TMP
+    mkdir -p "$TMP"
+    echo -n " * nghttp get /$DOC: $MSG..."
+    ${NGHTTP} "$@"$ARG_UPGRADE $URL_PREFIX/$DOC > $TMP/body 2>&1 || fail
+    echo ok.
+}
+
 nghttp_check_content() {
     local DOC="$1"; shift;
     local MSG="$1"; shift;

Added: httpd/test/mod_h2/trunk/test/test_flow.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/test_flow.sh?rev=1761438&view=auto
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_flow.sh (added)
+++ httpd/test/mod_h2/trunk/test/test_flow.sh Mon Sep 19 13:26:19 2016
@@ -0,0 +1,42 @@
+#!/bin/bash
+# Copyright 2015 greenbytes GmbH (https://www.greenbytes.de)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+source $(dirname $0)/test_common.sh
+echo "flow checks on: $@"
+
+text='X'
+start=80000
+end=90000
+
+echo -n "init ref file..."
+rm -f gen/ref
+touch gen/ref
+
+n=0
+while test $n -lt $start; do
+    echo -n "$text"
+    n=$[ n + 1 ]
+done >> gen/ref
+echo "done."
+
+n=$start
+while test $n -lt $end; do
+    #curl_get_doc mnot164.py"?count=${n}&text=${text}" "test mnot #164 - $n" --http2
+    nghttp_get_doc mnot164.py"?count=${n}&text=${text}" "test mnot #164 - $n"
+    diff -u gen/ref gen/tmp/body > gen/tmp/body.diff || fail "mismatch for n=$n"
+    n=$[ n + 1 ]
+    echo -n "$text" >> gen/ref
+done

Added: httpd/test/mod_h2/trunk/test/test_x.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/test_x.sh?rev=1761438&view=auto
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_x.sh (added)
+++ httpd/test/mod_h2/trunk/test/test_x.sh Mon Sep 19 13:26:19 2016
@@ -0,0 +1,42 @@
+#!/bin/bash
+# Copyright 2015 greenbytes GmbH (https://www.greenbytes.de)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+################################################################################
+# check announcements of upgrade: possibilities
+################################################################################
+
+
+export TEST_DIR="$1"; shift
+HTTP_PORT="$1"; shift
+HTTPS_PORT="$1"; shift
+HOST_NAME="$1"; shift
+HOST_NAME_2="$1"; shift
+HOST_NAME_SER="$1"; shift
+
+HTTP_AUTH=http://$HOST_NAME:$HTTP_PORT
+HTTP_AUTH_2=http://$HOST_NAME_2:$HTTP_PORT
+HTTPS_AUTH=https://$HOST_NAME:$HTTPS_PORT
+HTTPS_AUTH_2=https://$HOST_NAME_2:$HTTPS_PORT
+HTTPS_AUTH_SER=https://$HOST_NAME_SER:$HTTPS_PORT
+
+export CURL="$CURL"
+
+fail() {
+    echo "$@"
+    exit 1
+}
+
+$SHELL "$TEST_DIR"/test_flow.sh        $HTTPS_AUTH                       ||fail