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/01/27 17:03:14 UTC

svn commit: r1780589 - in /httpd/test/mod_h2/trunk/test: test.sh test_common.sh test_shutdown.sh

Author: icing
Date: Fri Jan 27 17:03:14 2017
New Revision: 1780589

URL: http://svn.apache.org/viewvc?rev=1780589&view=rev
Log:
adding test case for graceful restart

Added:
    httpd/test/mod_h2/trunk/test/test_shutdown.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=1780589&r1=1780588&r2=1780589&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test.sh (original)
+++ httpd/test/mod_h2/trunk/test/test.sh Fri Jan 27 17:03:14 2017
@@ -60,7 +60,8 @@ $SHELL "$TEST_DIR"/test_push.sh        $
 $SHELL "$TEST_DIR"/test_interim.sh     $HTTPS_AUTH                            &&
 $SHELL "$TEST_DIR"/test_interim.sh     $HTTPS_AUTH/proxy                      &&
 $SHELL "$TEST_DIR"/test_interim.sh     $HTTPS_AUTH/rewrite                    &&
-$SHELL "$TEST_DIR"/test_interim.sh     $HTTPS_AUTH_SER                   || fail
+$SHELL "$TEST_DIR"/test_interim.sh     $HTTPS_AUTH_SER                        &&
+$SHELL "$TEST_DIR"/test_shutdown.sh    $HTTPS_AUTH                       || fail
 
 $SHELL "$TEST_DIR"/test_nghttp_get.sh  $HTTPS_AUTH                            &&
 $SHELL "$TEST_DIR"/test_nghttp_post.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=1780589&r1=1780588&r2=1780589&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_common.sh (original)
+++ httpd/test/mod_h2/trunk/test/test_common.sh Fri Jan 27 17:03:14 2017
@@ -55,7 +55,9 @@ fi
 
 GEN="gen"
 TMP="$GEN/tmp"
+APACHE_DIR="$GEN/apache"
 
+APACHECTL="${APACHECTL:-${BIN_DIR}/apachectl} -d $APACHE_DIR"  
 CURL="${CURL:-${BIN_DIR}/curl}  -sk --resolv ${HOST#*://}:127.0.0.1"
 NGHTTP="${NGHTTP:-${BIN_DIR}/nghttp}"
 H2LOAD="${H2LOAD:-${BIN_DIR}/h2load}"

Added: httpd/test/mod_h2/trunk/test/test_shutdown.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/test_shutdown.sh?rev=1780589&view=auto
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_shutdown.sh (added)
+++ httpd/test/mod_h2/trunk/test/test_shutdown.sh Fri Jan 27 17:03:14 2017
@@ -0,0 +1,38 @@
+#!/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
+
+
+# check that streams finish successfully on a graceful restart
+
+curl_long_necho() {
+    local COUNT="$1"; shift;
+    local TEXT="$1"; shift;
+    local MSG="$1"; shift;
+    local textlen=$( echo -n "$TEXT" | wc -c )
+    local total=$[ COUNT * ( textlen + 1 ) ]
+    rm -rf $TMP
+    mkdir -p $TMP
+    echo -n "$MSG..."
+    rlen=$( ${CURL} "$@" -F count="$COUNT" -F text="$TEXT" $URL_PREFIX/necho.py | wc -c | tr -d ' ')
+    test "$total" = "$rlen" || fail "expected $total bytes, got $rlen" 
+    echo "done."
+}
+
+
+( sleep 1; $APACHECTL -k graceful )&
+curl_long_necho 1000000 "123456789" "graceful restart during 10MB"