httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ic...@apache.org
Subject svn commit: r1779974 - in /httpd/test/mod_h2/trunk/test: test.sh test_common.sh test_conditionals.sh
Date Mon, 23 Jan 2017 20:11:10 GMT
Author: icing
Date: Mon Jan 23 20:11:10 2017
New Revision: 1779974

URL: http://svn.apache.org/viewvc?rev=1779974&view=rev
Log:
adding tests for PR60599

Added:
    httpd/test/mod_h2/trunk/test/test_conditionals.sh
Modified:
    httpd/test/mod_h2/trunk/test/test.sh
    httpd/test/mod_h2/trunk/test/test_common.sh

Modified: httpd/test/mod_h2/trunk/test/test.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/test.sh?rev=1779974&r1=1779973&r2=1779974&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test.sh (original)
+++ httpd/test/mod_h2/trunk/test/test.sh Mon Jan 23 20:11:10 2017
@@ -67,6 +67,8 @@ $SHELL "$TEST_DIR"/test_nghttp_post.sh $
 $SHELL "$TEST_DIR"/test_curl_get.sh    $HTTPS_AUTH                            &&
 $SHELL "$TEST_DIR"/test_curl_post.sh   $HTTPS_AUTH                        ||fail
 
+$SHELL "$TEST_DIR"/test_conditionals.sh $HTTPS_AUTH                           &&
+$SHELL "$TEST_DIR"/test_conditionals.sh $HTTPS_AUTH_2                         &&
 $SHELL "$TEST_DIR"/test_vars.sh        $HTTPS_AUTH                            &&
 $SHELL "$TEST_DIR"/test_window_update.sh $HTTP_AUTH_2                         &&
 $SHELL "$TEST_DIR"/test_header.sh      $HTTPS_AUTH                            &&

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=1779974&r1=1779973&r2=1779974&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_common.sh (original)
+++ httpd/test/mod_h2/trunk/test/test_common.sh Mon Jan 23 20:11:10 2017
@@ -338,6 +338,44 @@ nghttp_check_recv_header() {
     echo ok.
 }
 
+nghttp_check_if_mod_since() {
+    local DOC="$1"; shift;
+    local MSG="$1"; shift;
+    rm -rf $TMP
+    mkdir -p "$(dirname $TMP/$DOC)"
+    rm -f $TMP/expected;
+    echo -n " * nghttp /$DOC: $MSG..."
+    ${NGHTTP} -v "$@"$ARG_UPGRADE $URL_PREFIX/$DOC > $TMP/$DOC 2>&1 || fail
+    local lastmod=$( fgrep ' last-modified: ' $TMP/$DOC )
+    lastmod=${lastmod##* last-modified: }
+    test -z "$lastmod" && fail "last-modified missing for $DOC"
+    ${NGHTTP} -v "$@"$ARG_UPGRADE -H 'Cache-Control: max-age=0' \
+        -H "if-modified-since: $lastmod" $URL_PREFIX/$DOC > $TMP/if-none-match 2>&1
|| fail
+    local status=$( fgrep ' :status: ' $TMP/if-none-match )
+    status=${status##* :status: }
+    test "$status" = 304 || fail "unexpected status: $status"
+    echo ok.
+}
+
+nghttp_check_if_etag() {
+    local DOC="$1"; shift;
+    local MSG="$1"; shift;
+    rm -rf $TMP
+    mkdir -p "$(dirname $TMP/$DOC)"
+    rm -f $TMP/expected;
+    echo -n " * nghttp /$DOC: $MSG..."
+    ${NGHTTP} -v "$@"$ARG_UPGRADE $URL_PREFIX/$DOC > $TMP/$DOC 2>&1 || fail
+    local etag=$( fgrep ' etag: ' $TMP/$DOC )
+    etag=${etag##* etag: }
+    test -z "$etag" && fail "etag missing for $DOC"
+    ${NGHTTP} -v "$@"$ARG_UPGRADE -H 'Cache-Control: max-age=0' \
+        -H "If-None-Match: $etag" $URL_PREFIX/$DOC > $TMP/if-none-match 2>&1 ||
fail
+    local status=$( fgrep ' :status: ' $TMP/if-none-match )
+    status=${status##* :status: }
+    test "$status" = 304 || fail "unexpected status: $status"
+    echo ok.
+}
+
 nghttp_check_promises() {
     local MSG="$1"; shift;
     rm -rf $TMP

Added: httpd/test/mod_h2/trunk/test/test_conditionals.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/test_conditionals.sh?rev=1779974&view=auto
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_conditionals.sh (added)
+++ httpd/test/mod_h2/trunk/test/test_conditionals.sh Mon Jan 23 20:11:10 2017
@@ -0,0 +1,26 @@
+#!/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 "check conditionals on: $@"
+
+################################################################################
+# check if header handling
+################################################################################
+
+# check https://bz.apache.org/bugzilla/show_bug.cgi?id=60599
+nghttp_check_if_mod_since  006/006.css "last-modified conditional"
+nghttp_check_if_etag       006/006.css "etag conditional"



Mime
View raw message