httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ic...@apache.org
Subject svn commit: r1786565 - in /httpd/test/mod_h2/trunk/test: test_common.sh test_curl_get.sh
Date Sun, 12 Mar 2017 11:55:19 GMT
Author: icing
Date: Sun Mar 12 11:55:19 2017
New Revision: 1786565

URL: http://svn.apache.org/viewvc?rev=1786565&view=rev
Log:
adding HEAD tests for checking github #133

Modified:
    httpd/test/mod_h2/trunk/test/test_common.sh
    httpd/test/mod_h2/trunk/test/test_curl_get.sh

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=1786565&r1=1786564&r2=1786565&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_common.sh (original)
+++ httpd/test/mod_h2/trunk/test/test_common.sh Sun Mar 12 11:55:19 2017
@@ -307,6 +307,18 @@ nghttp_check_content() {
     echo ok.
 }
 
+nghttp_check_head() {
+    local DOC="$1"; shift;
+    local MSG="$1"; shift;
+    rm -rf $TMP
+    mkdir -p "$(dirname $TMP/$DOC)"
+    cat > $TMP/expected
+    echo -n " * nghttp /$DOC: $MSG..."
+    ${NGHTTP} "$@"$ARG_UPGRADE -H ':method: HEAD' $URL_PREFIX/$DOC > $TMP/$DOC 2>&1
|| fail
+    diff -u  $TMP/expected $TMP/$DOC || fail
+    echo ok.
+}
+
 nghttp_check_fcontent() {
     local DOC="$1"; shift;
     local MSG="$1"; shift;
@@ -422,6 +434,25 @@ curl_check_upgrade() {
     echo ok.
 }
 
+curl_check_head() {
+    local MSG="$1"; shift;
+    local DOCS="$*"; shift;
+    rm -rf $TMP
+    mkdir -p "$TMP"
+    cat > $TMP/expected
+    echo -n " * curl /$DOC: $MSG..."
+    local URLS=""
+    for doc in $DOCS; do
+        URLS="$URLS $URL_PREFIX/$doc"
+    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
+    diff -u  $TMP/expected $TMP/filtered || fail
+    echo ok.
+}
+
 curl_check_content() {
     local DOC="$1"; shift;
     local MSG="$1"; shift;

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=1786565&r1=1786564&r2=1786565&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 11:55:19 2017
@@ -150,4 +150,32 @@ curl_check_content 006/ "autoindex w. in
 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 
+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 
+content-length: 2005
+content-type: text/html
+
+HTTP/2 200 
+content-length: 2005
+content-type: text/html
+
+EOF



Mime
View raw message