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 2017/03/12 13:35:17 UTC

svn commit: r1786572 - in /httpd/test/mod_h2/trunk: configure.ac test/test_alt_host.sh test/test_common.sh test/test_curl_get.sh test/test_debug.sh

Author: icing
Date: Sun Mar 12 13:35:17 2017
New Revision: 1786572

URL: http://svn.apache.org/viewvc?rev=1786572&view=rev
Log:
curl now at 7.53.1, adapated response since push indicator changed, fixed head interim response filter

Modified:
    httpd/test/mod_h2/trunk/configure.ac
    httpd/test/mod_h2/trunk/test/test_alt_host.sh
    httpd/test/mod_h2/trunk/test/test_common.sh
    httpd/test/mod_h2/trunk/test/test_curl_get.sh
    httpd/test/mod_h2/trunk/test/test_debug.sh

Modified: httpd/test/mod_h2/trunk/configure.ac
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/configure.ac?rev=1786572&r1=1786571&r2=1786572&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/configure.ac (original)
+++ httpd/test/mod_h2/trunk/configure.ac Sun Mar 12 13:35:17 2017
@@ -130,7 +130,7 @@ TEST_DEP=""
 ################################################################################
 # curl 
 ################################################################################
-CURL_VERSION=7.52.1
+CURL_VERSION=7.53.1
 
 AC_PATH_PROG([CURL], [curl])
 if test "x${CURL}" != "x"; then

Modified: httpd/test/mod_h2/trunk/test/test_alt_host.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/test_alt_host.sh?rev=1786572&r1=1786571&r2=1786572&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_alt_host.sh (original)
+++ httpd/test/mod_h2/trunk/test/test_alt_host.sh Sun Mar 12 13:35:17 2017
@@ -53,7 +53,7 @@ HTTPS=on<br/>
 PROTOCOL=${HTTP2_PROTOCOL}<br/>
 SSL_PROTOCOL=${EXP_SSL_PROTOCOL}<br/>
 HTTP2=${EXP_HTTP2}<br/>
-H2PUSH=${EXP_H2PUSH}<br/>
+H2PUSH=${EXP_H2PUSH_CURL}<br/>
 </body>
 </html>
 EOF
@@ -69,7 +69,7 @@ HTTPS=on<br/>
 PROTOCOL=${HTTP2_PROTOCOL}<br/>
 SSL_PROTOCOL=${EXP_SSL_PROTOCOL}<br/>
 HTTP2=${EXP_HTTP2}<br/>
-H2PUSH=${EXP_H2PUSH}<br/>
+H2PUSH=${EXP_H2PUSH_CURL}<br/>
 </body>
 </html>
 EOF

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=1786572&r1=1786571&r2=1786572&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_common.sh (original)
+++ httpd/test/mod_h2/trunk/test/test_common.sh Sun Mar 12 13:35:17 2017
@@ -67,6 +67,10 @@ MH2FUZZ=mh2fuzz/mh2fuzz
 
 HTTPD_VERSION="$($APXS -q HTTPD_VERSION)"
 
+CURL_VERSION=$( $CURL --version )
+CURL_VERSION=${CURL_VERSION##curl }
+CURL_VERSION=${CURL_VERSION%% *}
+
 min_version()
 {
     local version1="$1"
@@ -81,10 +85,15 @@ min_version()
 min_httpd_version()
 {
     local version="$1"
-    
     min_version "$version" "$HTTPD_VERSION"
 }
 
+# return 0 if HTTPD_VERSION is equal or greater than given version
+min_curl_version()
+{
+    local version="$1"
+    min_version "$version" "$CURL_VERSION"
+}
 
 fail() {
     echo "$@"
@@ -128,6 +137,13 @@ if min_httpd_version 2.4.19; then
     esac
 fi
 
+EXP_H2PUSH_CURL="$EXP_H2PUSH"
+if test -n "$EXP_H2PUSH"; then
+    if min_curl_version 7.53.1; then
+        EXP_H2PUSH_CURL="off"
+    fi
+fi
+
 case "$URL_PREFIX" in 
     */proxy|*/rewrite)
         EXP_PROTOCOL="HTTP/1.1"
@@ -434,6 +450,22 @@ curl_check_upgrade() {
     echo ok.
 }
 
+remove_interim() {
+    ( IFS=''
+    while read line; do
+        if test "$line" = "HTTP/1.1 101 Switching Protocols"; then 
+            while read line; do
+                if test -z "$line"; then
+                    break
+                fi
+            done
+        else 
+            echo "$line"
+        fi
+    done
+    )
+}
+
 curl_check_head() {
     local MSG="$1"; shift;
     local DOCS="$*"; shift;
@@ -447,8 +479,9 @@ curl_check_head() {
     done
     ${CURL} --http2 -I $URLS  > $TMP/received 2>&1 || fail
     fgrep -v -e 'date: ' -e 'last-modified: ' -e 'accept-' -e 'server: ' \
-        -e 'etag: ' -e 'via: ' -e 'alt-svc: ' < $TMP/received |
-        tr -d '\r' > $TMP/filtered
+        -e 'etag: ' -e 'via: ' -e 'alt-svc: ' < $TMP/received | tr -d '\r' |
+        remove_interim > $TMP/filtered
+        
     diff -u  $TMP/expected $TMP/filtered || fail
     echo ok.
 }

Modified: httpd/test/mod_h2/trunk/test/test_curl_get.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/test_curl_get.sh?rev=1786572&r1=1786571&r2=1786572&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_curl_get.sh (original)
+++ httpd/test/mod_h2/trunk/test/test_curl_get.sh Sun Mar 12 13:35:17 2017
@@ -60,7 +60,7 @@ HTTPS=${EXP_HTTPS}<br/>
 PROTOCOL=${EXP_PROTOCOL}<br/>
 SSL_PROTOCOL=${EXP_SSL_PROTOCOL}<br/>
 HTTP2=${EXP_HTTP2}<br/>
-H2PUSH=${EXP_H2PUSH}<br/>
+H2PUSH=${EXP_H2PUSH_CURL}<br/>
 </body>
 </html>
 EOF
@@ -151,26 +151,15 @@ EOF
 fi
 ################################################################################
 # github issue #133
-EXP_PRE=""
-case "$URL_PREFIX" in
-    http://*)
-        EXP_PRE="HTTP/1.1 101 Switching Protocols
-Upgrade: h2c
-Connection: Upgrade
-
-"
-        ;;
-esac
-
 curl_check_head "head index.html" index.html <<EOF
-${EXP_PRE}HTTP/2 200 
+HTTP/2 200 
 content-length: 2005
 content-type: text/html
 
 EOF
 
 curl_check_head "head 2 x index.html" index.html index.html <<EOF
-${EXP_PRE}HTTP/2 200 
+HTTP/2 200 
 content-length: 2005
 content-type: text/html
 

Modified: httpd/test/mod_h2/trunk/test/test_debug.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/test_debug.sh?rev=1786572&r1=1786571&r2=1786572&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_debug.sh (original)
+++ httpd/test/mod_h2/trunk/test/test_debug.sh Sun Mar 12 13:35:17 2017
@@ -84,18 +84,23 @@ curl_check_status .well-known/h2/state "
 HTTP/2 200
 EOF
 
+EXP_PUSH=1
+if min_curl_version 7.53.1; then
+    EXP_PUSH=0
+fi
+
 curl_check_debug .well-known/h2/state "check h2state" <<EOF
 {
   "version": "draft-01",
   "settings": {
     "SETTINGS_MAX_CONCURRENT_STREAMS": 100,
     "SETTINGS_MAX_FRAME_SIZE": 16384,
-    "SETTINGS_ENABLE_PUSH": 1
+    "SETTINGS_ENABLE_PUSH": $EXP_PUSH
   },
   "peerSettings": {
     "SETTINGS_MAX_CONCURRENT_STREAMS": 100,
     "SETTINGS_MAX_FRAME_SIZE": 16384,
-    "SETTINGS_ENABLE_PUSH": 1,
+    "SETTINGS_ENABLE_PUSH": $EXP_PUSH,
     "SETTINGS_HEADER_TABLE_SIZE": 4096,
     "SETTINGS_MAX_HEADER_LIST_SIZE": -1
   },