httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ic...@apache.org
Subject svn commit: r1754916 - in /httpd/test/mod_h2/trunk: conf/sites/test.example.org.conf test/go/ test/go/get.go test/go/test_get.sh test/test.sh test/test_common.sh
Date Tue, 02 Aug 2016 13:42:26 GMT
Author: icing
Date: Tue Aug  2 13:42:26 2016
New Revision: 1754916

URL: http://svn.apache.org/viewvc?rev=1754916&view=rev
Log:
start of go test client, changed h2/state url

Added:
    httpd/test/mod_h2/trunk/test/go/
    httpd/test/mod_h2/trunk/test/go/get.go
    httpd/test/mod_h2/trunk/test/go/test_get.sh
Modified:
    httpd/test/mod_h2/trunk/conf/sites/test.example.org.conf
    httpd/test/mod_h2/trunk/test/test.sh
    httpd/test/mod_h2/trunk/test/test_common.sh

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=1754916&r1=1754915&r2=1754916&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 Tue Aug  2 13:42:26 2016
@@ -120,7 +120,7 @@
     </Location>
     ProxyPass /zeit http://www.zeit.de:80 max=20 ttl=120 retry=300
 
-    <Location "/http2-status">
+    <Location "/.well-known/h2/state">
         SetHandler http2-status
     </Location>
 
@@ -235,7 +235,7 @@
         RewriteRule /h2cproxy-rewrite(.*) h2c://test.example.org:SUBST_PORT_HTTP_SUBST$1
[P]
     </IfModule>
 
-    <Location "/http2-status">
+    <Location "/.well-known/h2/state">
         SetHandler http2-status
     </Location>
     

Added: httpd/test/mod_h2/trunk/test/go/get.go
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/go/get.go?rev=1754916&view=auto
==============================================================================
--- httpd/test/mod_h2/trunk/test/go/get.go (added)
+++ httpd/test/mod_h2/trunk/test/go/get.go Tue Aug  2 13:42:26 2016
@@ -0,0 +1,53 @@
+package main
+
+import (
+   "log"
+   "io"
+   "net/http"
+   "os"
+   "crypto/tls"
+
+   "golang.org/x/net/http2"
+)
+
+func main() {
+    args := os.Args[1:]
+    if args[0] == "--http1.1" {
+        c := &http.Client{ 
+            Transport: &http.Transport{
+                TLSClientConfig: &tls.Config{
+                    InsecureSkipVerify: true,
+                    NextProtos: []string{"http/1.1"},
+                },
+            },
+        }
+        res, err := c.Get(args[1])
+        if err != nil {
+            log.Fatal(err)
+        } else {
+            defer res.Body.Close()
+            _, err := io.Copy(os.Stdout, res.Body)
+            if err != nil {
+                log.Fatal(err)
+            }
+        }
+    } else {
+        c := &http.Client{ 
+            Transport: &http2.Transport{
+                TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
+            },
+        }
+        res, err := c.Get(args[0])
+        if err != nil {
+            log.Fatal(err)
+        } else {
+//            defer res.Body.Close()
+            res.Write(os.Stdout)
+            //io.Copy(os.Stdout, res.Body)
+//            if err != nil {
+//                log.Fatal(err)
+//            }
+        }
+    }
+}
+

Added: httpd/test/mod_h2/trunk/test/go/test_get.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/go/test_get.sh?rev=1754916&view=auto
==============================================================================
--- httpd/test/mod_h2/trunk/test/go/test_get.sh (added)
+++ httpd/test/mod_h2/trunk/test/go/test_get.sh Tue Aug  2 13:42:26 2016
@@ -0,0 +1,146 @@
+#!/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
+
+GO=go
+GO_GET="$GO run $(dirname $0)/get.go"
+
+go_check_content() {
+    local DOC="$1"; shift;
+    local MSG="$1"; shift;
+    rm -rf $TMP
+    mkdir -p "$(dirname $TMP/$DOC)"
+    cat > $TMP/expected
+    echo -n " * go get /$DOC: $MSG..."
+    $GO_GET $@ $URL_PREFIX/$DOC > $TMP/$DOC 2>&1 || fail $(cat $TMP/$DOC)
+    diff  $TMP/expected $TMP/$DOC || fail
+    echo ok.
+}
+
+go_check_necho() {
+    local COUNT="$1"; shift;
+    local TEXT="$1"; shift;
+    local REF="$1"; shift;
+    local MSG="$1"; shift;
+    rm -rf $TMP
+    mkdir -p $TMP
+    echo -n " * go get /necho.py?count=$COUNT&text=$TEXT..."
+    $GO_GET $URL_PREFIX/necho.py?count="$COUNT"\&text="$TEXT" > $TMP/echo 2>&1
|| fail
+    diff  $REF $TMP/echo || fail
+    echo ok.
+}
+
+
+echo "go GET on: $@"
+
+################################################################################
+# check cgi generated content
+################################################################################
+
+# force HTTP/1.1 connection
+go_check_content hello.py "http/1.1" --http1.1 <<EOF
+<html>
+<body>
+<h2>Hello World!</h2>
+HTTPS=${EXP_HTTPS}<br/>
+PROTOCOL=${EXP_H1_PROTOCOL}<br/>
+SSL_PROTOCOL=${EXP_SSL_PROTOCOL}<br/>
+HTTP2=${EXP_H1_HTTP2}<br/>
+H2PUSH=${EXP_H1_H2PUSH}<br/>
+</body>
+</html>
+EOF
+
+# force HTTP/2 connection
+go_check_content hello.py "http2" <<EOF
+<html>
+<body>
+<h2>Hello World!</h2>
+HTTPS=${EXP_HTTPS}<br/>
+PROTOCOL=${EXP_PROTOCOL}<br/>
+SSL_PROTOCOL=${EXP_SSL_PROTOCOL}<br/>
+HTTP2=${EXP_HTTP2}<br/>
+H2PUSH=off<br/>
+</body>
+</html>
+EOF
+
+
+go_check_content upload.py "http/1.1" --http1.1 <<EOF
+    <html><body>
+    <p>        Upload File<form method="POST" enctype="multipart/form-data">
+        <input type="file" name="file">
+        <button type="submit">Upload</button></form>
+        </p>
+    </body></html>
+EOF
+
+go_check_content upload.py "http2" <<EOF
+    <html><body>
+    <p>        Upload File<form method="POST" enctype="multipart/form-data">
+        <input type="file" name="file">
+        <button type="submit">Upload</button></form>
+        </p>
+    </body></html>
+EOF
+
+
+################################################################################
+# check chunked content from cgi
+################################################################################
+
+if [ ! -f $GEN/necho-100 ]; then
+i=0; while [ $i -lt 10 ]; do
+echo "0123456789"
+i=$[ i + 1 ]
+done > $GEN/necho-100
+fi
+
+if [ ! -f $GEN/necho-1k ]; then
+i=0; while [ $i -lt 10 ]; do
+cat $GEN/necho-100
+i=$[ i + 1 ]
+done > $GEN/necho-1k
+fi
+
+if [ ! -f $GEN/necho-10k ]; then
+i=0; while [ $i -lt 10 ]; do
+cat $GEN/necho-1k
+i=$[ i + 1 ]
+done > $GEN/necho-10k
+fi
+
+if [ ! -f $GEN/necho-100k ]; then
+i=0; while [ $i -lt 10 ]; do
+cat $GEN/necho-10k
+i=$[ i + 1 ]
+done > $GEN/necho-100k
+fi
+
+if [ ! -f $GEN/necho-1m ]; then
+i=0; while [ $i -lt 10 ]; do
+cat $GEN/necho-100k
+i=$[ i + 1 ]
+done > $GEN/necho-1m
+fi
+
+go_check_necho 10 "0123456789" $GEN/necho-100 "http/2" --http2
+go_check_necho 100 "0123456789" $GEN/necho-1k "http/2" --http2
+go_check_necho 1000 "0123456789" $GEN/necho-10k "http/2" --http2
+go_check_necho 10000 "0123456789" $GEN/necho-100k "http/2" --http2
+go_check_necho 100000 "0123456789" $GEN/necho-1m "http/2" --http2
+

Modified: httpd/test/mod_h2/trunk/test/test.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/test.sh?rev=1754916&r1=1754915&r2=1754916&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test.sh (original)
+++ httpd/test/mod_h2/trunk/test/test.sh Tue Aug  2 13:42:26 2016
@@ -36,6 +36,10 @@ echo "curl is $CURL"
 
 export CURL="$CURL"
 
+# starting go client tests, still hangs with 1.7rc4, see
+# https://github.com/golang/go/issues/16572
+#$SHELL "$TEST_DIR"/go/test_get.sh $HTTPS_AUTH                &&
+
 $SHELL "$TEST_DIR"/test_curl_altsvc.sh $HTTP_AUTH  $HTTPS_AUTH                &&
 $SHELL "$TEST_DIR"/test_proto_order.sh $HTTPS_AUTH $HTTPS_AUTH_2              &&
 $SHELL "$TEST_DIR"/test_alt_host.sh    $HTTPS_AUTH $HTTPS_AUTH_2              &&

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=1754916&r1=1754915&r2=1754916&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_common.sh (original)
+++ httpd/test/mod_h2/trunk/test/test_common.sh Tue Aug  2 13:42:26 2016
@@ -327,7 +327,7 @@ mh2fuzz_check_cache_digest() {
     mkdir -p "$(dirname $TMP/$DOC)"
     cat > $TMP/expected
     echo -n " * mh2fuzz /$DOC: $MSG..."
-    ${MH2FUZZ} "$@" -f submit-delay100 -m 1 -op $URL_PREFIX/$DOC $URL_PREFIX/http2-status
2>&1 | fgrep 'cache_digest' > $TMP/$DOC
+    ${MH2FUZZ} "$@" -f submit-delay100 -m 1 -op $URL_PREFIX/$DOC $URL_PREFIX/.well-known/h2/state
2>&1 | fgrep 'cache_digest' > $TMP/$DOC
     diff  $TMP/expected $TMP/$DOC || fail
     echo ok.
 }



Mime
View raw message