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/12/31 13:15:43 UTC

svn commit: r1776736 - in /httpd/test/mod_h2/trunk: Makefile.am conf/sites/test.example.org.conf test/go/h2fuzz.go test/go/test_fuzz.sh test/go/trace-trailer.fuzz test/test.sh test/test_frames.sh test/test_go.sh

Author: icing
Date: Sat Dec 31 13:15:43 2016
New Revision: 1776736

URL: http://svn.apache.org/viewvc?rev=1776736&view=rev
Log:
 * go test cases can be executed directly
 * fixed expected DATA frame sizes for new alignments

Added:
    httpd/test/mod_h2/trunk/test/go/trace-trailer.fuzz
    httpd/test/mod_h2/trunk/test/test_go.sh
Modified:
    httpd/test/mod_h2/trunk/Makefile.am
    httpd/test/mod_h2/trunk/conf/sites/test.example.org.conf
    httpd/test/mod_h2/trunk/test/go/h2fuzz.go
    httpd/test/mod_h2/trunk/test/go/test_fuzz.sh
    httpd/test/mod_h2/trunk/test/test.sh
    httpd/test/mod_h2/trunk/test/test_frames.sh

Modified: httpd/test/mod_h2/trunk/Makefile.am
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/Makefile.am?rev=1776736&r1=1776735&r2=1776736&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/Makefile.am (original)
+++ httpd/test/mod_h2/trunk/Makefile.am Sat Dec 31 13:15:43 2016
@@ -138,7 +138,12 @@ test-proxy-x: $(MH2FUZZ) $(SERVER_DIR)/.
 	@mkdir -p $(GEN)/tmp
 	$(TESTRUN) test/test_proxy_x.sh test $(HTTP_PORT) $(HTTPS_PORT) $(HOST_NAME) $(HOST_NAME_2) $(HOST_SER_NAME)
 
-test: test-gets test-proxy fuzz
+test-go: $(MH2FUZZ) $(SERVER_DIR)/.test-setup
+	@rm -rf $(GEN)/tmp
+	@mkdir -p $(GEN)/tmp
+	$(TESTRUN) test/test_go.sh test $(HTTP_PORT) $(HTTPS_PORT) $(HOST_NAME) $(HOST_NAME_2) $(HOST_SER_NAME)
+
+test: test-gets test-go test-proxy fuzz
 
 smoke:  fuzz h2load h2tx test-x
 

Modified: httpd/test/mod_h2/trunk/conf/sites/test.example.org.conf
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/conf/sites/test.example.org.conf?rev=1776736&r1=1776735&r2=1776736&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/conf/sites/test.example.org.conf (original)
+++ httpd/test/mod_h2/trunk/conf/sites/test.example.org.conf Sat Dec 31 13:15:43 2016
@@ -53,6 +53,10 @@
         Header unset Upgrade
     </IfModule>
 
+    <IfVersion >= 2.4.26>
+        H2TLSFlushCount 2
+    </IfVersion>
+
     <IfVersion >= 2.4.24>
     <Location /006>
         H2CopyFiles On

Modified: httpd/test/mod_h2/trunk/test/go/h2fuzz.go
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/go/h2fuzz.go?rev=1776736&r1=1776735&r2=1776736&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/go/h2fuzz.go (original)
+++ httpd/test/mod_h2/trunk/test/go/h2fuzz.go Sat Dec 31 13:15:43 2016
@@ -319,15 +319,22 @@ func (app *h2fuzz) cmdStreamGet(args []s
         "end": false,
         "eos": false,
     }
+    method := "GET"
+    path := ""
     args = getFlags(args, flags)
-    if len(args) != 1 {
+    if len(args) == 2 {
+        method = args[0]
+        path = args[1]
+    } else if len(args) == 1 {
+        path = args[0]
+    } else {
         app.logf("Error: stream-get needs a path.")
         return nil
     }
     app.startHeaders()
     app.writeHeader(":authority", app.host)
-    app.writeHeader(":method", "GET")
-    app.writeHeader(":path", args[0])
+    app.writeHeader(":method", method)
+    app.writeHeader(":path", path)
     app.writeHeader(":scheme", "https")
     err := app.readHeaders()
     if err != nil {

Modified: httpd/test/mod_h2/trunk/test/go/test_fuzz.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/go/test_fuzz.sh?rev=1776736&r1=1776735&r2=1776736&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/go/test_fuzz.sh (original)
+++ httpd/test/mod_h2/trunk/test/go/test_fuzz.sh Sat Dec 31 13:15:43 2016
@@ -54,7 +54,8 @@ check_traffic "$TOP"/in-get.fuzz "checki
 -->[CONTINUATION stream=1, eoh=true, eos=false]
 <--[FrameHeader HEADERS flags=END_HEADERS stream=1 len=XXX]
     :status = "200"
-<--[FrameHeader DATA flags=END_STREAM stream=1 len=2005]
+<--[FrameHeader DATA stream=1 len=1291]
+<--[FrameHeader DATA flags=END_STREAM stream=1 len=714]
 -->[GOAWAY
 EOF
 
@@ -115,7 +116,8 @@ check_traffic "$TOP"/in-footer.fuzz "che
 -->[HEADER stream=1: eoh=true, eos=true]
 <--[FrameHeader HEADERS flags=END_HEADERS stream=1 len=XXX]
     :status = "200"
-<--[FrameHeader DATA flags=END_STREAM stream=1 len=2005]
+<--[FrameHeader DATA stream=1 len=1291]
+<--[FrameHeader DATA flags=END_STREAM stream=1 len=714]
 -->[GOAWAY
 EOF
 

Added: httpd/test/mod_h2/trunk/test/go/trace-trailer.fuzz
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/go/trace-trailer.fuzz?rev=1776736&view=auto
==============================================================================
--- httpd/test/mod_h2/trunk/test/go/trace-trailer.fuzz (added)
+++ httpd/test/mod_h2/trunk/test/go/trace-trailer.fuzz Sat Dec 31 13:15:43 2016
@@ -0,0 +1,12 @@
+wait 1ms
+stream-get TRACE / end
+trailer: x
+content-length: 0
+
+data
+headers-add end
+x: y
+
+wait 100ms
+goaway
+wait

Modified: httpd/test/mod_h2/trunk/test/test.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/test.sh?rev=1776736&r1=1776735&r2=1776736&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test.sh (original)
+++ httpd/test/mod_h2/trunk/test/test.sh Sat Dec 31 13:15:43 2016
@@ -109,31 +109,4 @@ $SHELL "$TEST_DIR"/test_curl_post.sh   $
 $SHELL "$TEST_DIR"/test_trailer.sh     $HTTPS_AUTH_SER                        ||
 fail
 
-export TEST_GO=no
-GO=${GO:-go}
-export GO
-case "$(type -p go)" in
-    *go)
-        goversion=$($GO version)
-        goversion=${goversion##go version go}
-        goversion=${goversion%% *}
-        gov=${goversion%%rc*} # trim release candidates
-        if min_version2 1.6 "$gov"; then
-            echo "go tests: enabled, version=$goversion"
-            export TEST_GO=yes
-        else
-            echo "go tests: disabled, version $goversion < 1.7"
-        fi
-        ;;
-    *)
-        echo "go tests: disabled, go executable not found"
-        ;;
-esac
-
-if test "$TEST_GO" = "yes"; then
-    # starting go client tests, still hangs with 1.7rc4, see
-    $SHELL "$TEST_DIR"/go/test_get.sh $HTTPS_AUTH                             &&
-    $SHELL "$TEST_DIR"/go/test_fuzz.sh $HTTPS_AUTH                            ||
-    fail
-fi
 

Modified: httpd/test/mod_h2/trunk/test/test_frames.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/test_frames.sh?rev=1776736&r1=1776735&r2=1776736&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_frames.sh (original)
+++ httpd/test/mod_h2/trunk/test/test_frames.sh Sat Dec 31 13:15:43 2016
@@ -53,7 +53,8 @@ ALPN: selected h2
 0: send WINDOW_UPDATE[stream=0, inc=1073676288]
 0: send HEADERS[count=4, hend=1, stream=1, eos=1]
 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=1291, flags=0, stream=1, padlen=0]
+0: recv DATA[length=714, flags=0, stream=1, padlen=0]
 0: recv DATA[length=0, flags=1, stream=1, padlen=0]
 -->     0:00001 GET /index.html -> 200 2005
 0: send GOAWAY[error=0, last_stream=0, reason='']
@@ -74,4 +75,4 @@ ALPN: selected h2
 EOF
 
 
-fi
\ No newline at end of file
+fi

Added: httpd/test/mod_h2/trunk/test/test_go.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/test_go.sh?rev=1776736&view=auto
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_go.sh (added)
+++ httpd/test/mod_h2/trunk/test/test_go.sh Sat Dec 31 13:15:43 2016
@@ -0,0 +1,78 @@
+#!/bin/bash
+# Copyright 2016 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
+}
+
+min_version2()
+{
+    local version1="$1"
+    local version2="$2"
+    
+    local winner=$(echo -e "$version2\n$version1" | sort -t. -k1,1n -k2,2n | head -1)
+    test "$winner" = "$version1" && return 0
+    return 1
+}
+
+export TEST_GO=no
+GO=${GO:-go}
+export GO
+case "$(type -p go)" in
+    *go)
+        goversion=$($GO version)
+        goversion=${goversion##go version go}
+        goversion=${goversion%% *}
+        gov=${goversion%%rc*} # trim release candidates
+        if min_version2 1.6 "$gov"; then
+            echo "go tests: enabled, version=$goversion"
+            export TEST_GO=yes
+        else
+            echo "go tests: disabled, version $goversion < 1.7"
+        fi
+        ;;
+    *)
+        echo "go tests: disabled, go executable not found"
+        ;;
+esac
+
+if test "$TEST_GO" = "yes"; then
+    # starting go client tests, still hangs with 1.7rc4, see
+    $SHELL "$TEST_DIR"/go/test_get.sh $HTTPS_AUTH                             &&
+    $SHELL "$TEST_DIR"/go/test_fuzz.sh $HTTPS_AUTH                            ||
+    fail
+fi