httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ic...@apache.org
Subject svn commit: r1790784 - in /httpd/test/mod_h2/trunk: Makefile.am test/test.sh
Date Mon, 10 Apr 2017 07:49:19 GMT
Author: icing
Date: Mon Apr 10 07:49:18 2017
New Revision: 1790784

URL: http://svn.apache.org/viewvc?rev=1790784&view=rev
Log:
making test script more modular, calling individual suites per options

Modified:
    httpd/test/mod_h2/trunk/Makefile.am
    httpd/test/mod_h2/trunk/test/test.sh

Modified: httpd/test/mod_h2/trunk/Makefile.am
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/Makefile.am?rev=1790784&r1=1790783&r2=1790784&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/Makefile.am (original)
+++ httpd/test/mod_h2/trunk/Makefile.am Mon Apr 10 07:49:18 2017
@@ -116,7 +116,12 @@ fuzz: $(MH2FUZZ) $(SERVER_DIR)/.test-set
 test-gets: $(MH2FUZZ) $(SERVER_DIR)/.test-setup
 	@rm -rf $(GEN)/tmp
 	@mkdir -p $(GEN)/tmp
-	$(TESTRUN) test/test.sh test $(HTTP_PORT) $(HTTPS_PORT) $(HOST_NAME) $(HOST_NAME_2) $(HOST_SER_NAME)
+	@$(TESTRUN) test/test.sh test $(HTTP_PORT) $(HTTPS_PORT) $(HOST_NAME) $(HOST_NAME_2) $(HOST_SER_NAME)
+
+test-gets-cont: $(MH2FUZZ) $(SERVER_DIR)/.test-setup
+	@rm -rf $(GEN)/tmp
+	@mkdir -p $(GEN)/tmp
+	@$(TESTRUN) test/test.sh -c test $(HTTP_PORT) $(HTTPS_PORT) $(HOST_NAME) $(HOST_NAME_2)
$(HOST_SER_NAME)
 
 test-proxy: $(MH2FUZZ) $(SERVER_DIR)/.test-setup
 	@rm -rf $(GEN)/tmp
@@ -143,7 +148,13 @@ test-go: $(MH2FUZZ) $(SERVER_DIR)/.test-
 	@mkdir -p $(GEN)/tmp
 	$(TESTRUN) test/test_go.sh test $(HTTP_PORT) $(HTTPS_PORT) $(HOST_NAME) $(HOST_NAME_2) $(HOST_SER_NAME)
 
-test: test-gets test-go test-proxy fuzz
+test: $(MH2FUZZ) $(SERVER_DIR)/.test-setup 
+	@rm -rf $(GEN)/tmp
+	@mkdir -p $(GEN)/tmp
+	@$(TESTRUN) test/test.sh -s all test $(HTTP_PORT) $(HTTPS_PORT) \
+                                $(HOST_NAME) $(HOST_NAME_2) $(HOST_SER_NAME)
+
+test-continuous: test-gets-cont test-go test-proxy fuzz
 
 smoke:  fuzz h2load h2tx test-x
 

Modified: httpd/test/mod_h2/trunk/test/test.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/test.sh?rev=1790784&r1=1790783&r2=1790784&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test.sh (original)
+++ httpd/test/mod_h2/trunk/test/test.sh Mon Apr 10 07:49:18 2017
@@ -19,6 +19,179 @@
 ################################################################################
 
 
+fail() {
+    echo "$@" >&2
+    exit 1
+}
+
+usage() {
+    echo "$@" >&2
+    echo <<EOF >&2
+usage: $0 [option]
+    while option can be
+        -c  continuous, run the test suite continously, forver
+EOF
+    exit 2
+}
+
+min_version2()
+{
+    local version1="$1"
+    local version2="$2"
+    
+    local winner=$(echo -e "$version2\n$version1" | sort -t. -k1,1n -k2,2n | head -1)
+    test "$winner" = "$version1" && return 0
+    return 1
+}
+
+run_alt() {
+    $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          &&
+    $SHELL "$TEST_DIR"/test_ssl.sh         $HTTPS_AUTH                        &&
+    $SHELL "$TEST_DIR"/test_vars.sh        $HTTPS_AUTH                        &&
+    $SHELL "$TEST_DIR"/test_upgrade.sh     $HTTP_AUTH  $HTTPS_AUTH       || fail
+}
+
+run_debug() {
+    $SHELL "$TEST_DIR"/test_debug.sh       $HTTPS_AUTH                   || fail
+}
+
+run_fuzz() {
+    $SHELL "$TEST_DIR"/test_fuzz.sh "$TEST_DIR" $HTTP_PORT $HTTPS_PORT \
+        $HOST_NAME $HOST_NAME_2 $HOST_NAME_SER                           || fail
+}
+
+run_get() {
+    $SHELL "$TEST_DIR"/test_curl_get.sh    $HTTPS_AUTH                        &&
+    $SHELL "$TEST_DIR"/test_nghttp_get.sh  $HTTPS_AUTH                        &&
                  
+    $SHELL "$TEST_DIR"/test_nghttp_get.sh  $HTTPS_AUTH/proxy alpn "HTTP/1.1"  &&
+    $SHELL "$TEST_DIR"/test_curl_get.sh    $HTTPS_AUTH/proxy alpn "HTTP/1.1"  &&
+    $SHELL "$TEST_DIR"/test_nghttp_get.sh  $HTTPS_AUTH/redirect alpn          &&
+    $SHELL "$TEST_DIR"/test_curl_get.sh    $HTTPS_AUTH/redirect alpn          &&
+    $SHELL "$TEST_DIR"/test_nghttp_get.sh  $HTTPS_AUTH/rewrite alpn "HTTP/1.1"&&
+    $SHELL "$TEST_DIR"/test_curl_get.sh    $HTTPS_AUTH/rewrite alpn "HTTP/1.1"&&
+    $SHELL "$TEST_DIR"/test_nghttp_get.sh  $HTTP_AUTH                         &&
+    $SHELL "$TEST_DIR"/test_curl_get.sh    $HTTP_AUTH                         &&
+    $SHELL "$TEST_DIR"/test_nghttp_get.sh  $HTTP_AUTH direct                  &&
+    $SHELL "$TEST_DIR"/test_nghttp_get.sh  $HTTP_AUTH/proxy alpn "HTTP/1.1"   &&
+    $SHELL "$TEST_DIR"/test_curl_get.sh    $HTTP_AUTH/proxy alpn "HTTP/1.1"   &&
+    $SHELL "$TEST_DIR"/test_nghttp_get.sh  $HTTP_AUTH/redirect alpn           &&
+    $SHELL "$TEST_DIR"/test_curl_get.sh    $HTTP_AUTH/redirect alpn           &&
+    $SHELL "$TEST_DIR"/test_nghttp_get.sh  $HTTP_AUTH/rewrite alpn "HTTP/1.1" &&
+    $SHELL "$TEST_DIR"/test_curl_get.sh    $HTTP_AUTH/rewrite alpn "HTTP/1.1" &&
+    $SHELL "$TEST_DIR"/test_nghttp_get.sh  $HTTPS_AUTH_SER alpn "HTTP/1.1"    &&
+    $SHELL "$TEST_DIR"/test_curl_get.sh    $HTTPS_AUTH_SER alpn "HTTP/1.1"    ||
+    fail
+}
+
+run_go() {
+    $SHELL "$TEST_DIR"/test_go.sh "$TEST_DIR" $HTTP_PORT $HTTPS_PORT \
+        $HOST_NAME $HOST_NAME_2 $HOST_NAME_SER                                ||
+    fail
+}
+
+run_header() {
+    $SHELL "$TEST_DIR"/test_header.sh      $HTTPS_AUTH                        &&
+    $SHELL "$TEST_DIR"/test_conditionals.sh $HTTPS_AUTH                       &&
+    $SHELL "$TEST_DIR"/test_conditionals.sh $HTTPS_AUTH_2                     &&
+    $SHELL "$TEST_DIR"/test_trailer.sh     $HTTPS_AUTH                        &&
+    $SHELL "$TEST_DIR"/test_trailer.sh     $HTTP_AUTH                         &&
+    $SHELL "$TEST_DIR"/test_trailer.sh     $HTTPS_AUTH_SER                    ||
+    fail
+}
+
+run_interim() {
+    $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
+}
+
+run_post() {
+    $SHELL "$TEST_DIR"/test_curl_post.sh   $HTTPS_AUTH                        &&
+    $SHELL "$TEST_DIR"/test_nghttp_post.sh $HTTPS_AUTH                        &&
+    $SHELL "$TEST_DIR"/test_nghttp_post.sh $HTTPS_AUTH/proxy alpn "HTTP/1.1"  &&
+    $SHELL "$TEST_DIR"/test_curl_post.sh   $HTTPS_AUTH/proxy alpn "HTTP/1.1"  &&
+    $SHELL "$TEST_DIR"/test_nghttp_post.sh $HTTPS_AUTH/redirect alpn          &&
+    $SHELL "$TEST_DIR"/test_curl_post.sh   $HTTPS_AUTH/redirect alpn          &&
+    $SHELL "$TEST_DIR"/test_nghttp_post.sh $HTTPS_AUTH/rewrite alpn "HTTP/1.1"&&
+    $SHELL "$TEST_DIR"/test_curl_post.sh   $HTTPS_AUTH/rewrite alpn "HTTP/1.1"&&
+    $SHELL "$TEST_DIR"/test_nghttp_post.sh $HTTP_AUTH                         &&
+    $SHELL "$TEST_DIR"/test_curl_post.sh   $HTTP_AUTH                         &&
+    $SHELL "$TEST_DIR"/test_nghttp_post.sh $HTTP_AUTH direct                  &&
+    $SHELL "$TEST_DIR"/test_nghttp_post.sh $HTTP_AUTH/proxy alpn "HTTP/1.1"   &&
+    $SHELL "$TEST_DIR"/test_curl_post.sh   $HTTP_AUTH/proxy alpn "HTTP/1.1"   &&
+    $SHELL "$TEST_DIR"/test_nghttp_post.sh $HTTP_AUTH/redirect alpn           &&
+    $SHELL "$TEST_DIR"/test_curl_post.sh   $HTTP_AUTH/redirect alpn           &&
+    $SHELL "$TEST_DIR"/test_nghttp_post.sh $HTTP_AUTH/rewrite alpn "HTTP/1.1" &&
+    $SHELL "$TEST_DIR"/test_curl_post.sh   $HTTP_AUTH/rewrite alpn "HTTP/1.1" &&
+    $SHELL "$TEST_DIR"/test_nghttp_post.sh $HTTPS_AUTH_SER alpn "HTTP/1.1"    &&
+    $SHELL "$TEST_DIR"/test_curl_post.sh   $HTTPS_AUTH_SER alpn "HTTP/1.1"    ||
+    fail
+}
+
+run_proxy() {
+    $SHELL "$TEST_DIR"/test_proxy.sh "$TEST_DIR" $HTTP_PORT $HTTPS_PORT \
+        $HOST_NAME $HOST_NAME_2 $HOST_NAME_SER                                ||
+    fail
+}
+
+run_push() {
+    $SHELL "$TEST_DIR"/test_push.sh        $HTTPS_AUTH $HTTP_AUTH             ||
+    fail
+}
+
+run_restart() {
+    $SHELL "$TEST_DIR"/test_shutdown.sh    $HTTPS_AUTH                        ||
+    fail
+}
+
+run_upload() {
+    $SHELL "$TEST_DIR"/test_window_update.sh $HTTP_AUTH_2                     ||
+    fail
+}
+
+run_all() {
+    run_alt
+    run_header
+    run_debug
+    
+    run_get
+    run_post
+    run_upload
+    run_interim
+    run_push
+    
+    if test "${continuous:-0}" -eq 0; then
+        run_restart
+    fi
+
+    run_go
+    run_proxy
+    run_fuzz
+}
+
+continuous=0
+suites=""
+
+while getopts "cs:" opt; do
+    case "$opt" in
+        c)
+            continuous=1
+            echo "continous mode, no restarts" >&2
+            ;;
+        s)
+            suites="$suites $OPTARG"
+            ;;
+        *)
+            usage "Invalid option: -$OPTARG"
+            ;;
+    esac
+done
+shift $((OPTIND-1))
+
 export TEST_DIR="$1"; shift
 HTTP_PORT="$1"; shift
 HTTPS_PORT="$1"; shift
@@ -34,82 +207,13 @@ HTTPS_AUTH_SER=https://$HOST_NAME_SER:$H
 
 export CURL="$CURL"
 
-fail() {
-    echo "$@"
-    exit 1
-}
-
-min_version2()
-{
-    local version1="$1"
-    local version2="$2"
-    
-    local winner=$(echo -e "$version2\n$version1" | sort -t. -k1,1n -k2,2n | head -1)
-    test "$winner" = "$version1" && return 0
-    return 1
-}
-
-$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              &&
-$SHELL "$TEST_DIR"/test_ssl.sh         $HTTPS_AUTH                            &&
-$SHELL "$TEST_DIR"/test_upgrade.sh     $HTTP_AUTH  $HTTPS_AUTH                &&
-$SHELL "$TEST_DIR"/test_header.sh      $HTTPS_AUTH                            &&
-$SHELL "$TEST_DIR"/test_debug.sh       $HTTPS_AUTH                            &&
-$SHELL "$TEST_DIR"/test_push.sh        $HTTPS_AUTH $HTTP_AUTH                 &&
-$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_shutdown.sh    $HTTPS_AUTH                       || fail
-
-$SHELL "$TEST_DIR"/test_curl_get.sh    $HTTPS_AUTH                            &&
-$SHELL "$TEST_DIR"/test_curl_post.sh   $HTTPS_AUTH                            &&
-$SHELL "$TEST_DIR"/test_nghttp_get.sh  $HTTPS_AUTH                            &&
-$SHELL "$TEST_DIR"/test_nghttp_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                            &&
-$SHELL "$TEST_DIR"/test_trailer.sh     $HTTPS_AUTH                            &&
-$SHELL "$TEST_DIR"/test_nghttp_get.sh  $HTTPS_AUTH/proxy alpn "HTTP/1.1"      &&
-$SHELL "$TEST_DIR"/test_nghttp_post.sh $HTTPS_AUTH/proxy alpn "HTTP/1.1"      &&
-$SHELL "$TEST_DIR"/test_curl_get.sh    $HTTPS_AUTH/proxy alpn "HTTP/1.1"      &&
-$SHELL "$TEST_DIR"/test_curl_post.sh   $HTTPS_AUTH/proxy alpn "HTTP/1.1"      &&
-$SHELL "$TEST_DIR"/test_nghttp_get.sh  $HTTPS_AUTH/redirect alpn              &&
-$SHELL "$TEST_DIR"/test_nghttp_post.sh $HTTPS_AUTH/redirect alpn              &&
-$SHELL "$TEST_DIR"/test_curl_get.sh    $HTTPS_AUTH/redirect alpn              &&
-$SHELL "$TEST_DIR"/test_curl_post.sh   $HTTPS_AUTH/redirect alpn              &&
-$SHELL "$TEST_DIR"/test_nghttp_get.sh  $HTTPS_AUTH/rewrite alpn "HTTP/1.1"    &&
-$SHELL "$TEST_DIR"/test_nghttp_post.sh $HTTPS_AUTH/rewrite alpn "HTTP/1.1"    &&
-$SHELL "$TEST_DIR"/test_curl_get.sh    $HTTPS_AUTH/rewrite alpn "HTTP/1.1"    &&
-$SHELL "$TEST_DIR"/test_curl_post.sh   $HTTPS_AUTH/rewrite alpn "HTTP/1.1"    &&
-$SHELL "$TEST_DIR"/test_nghttp_get.sh  $HTTP_AUTH                             &&
-$SHELL "$TEST_DIR"/test_nghttp_post.sh $HTTP_AUTH                             &&
-$SHELL "$TEST_DIR"/test_curl_get.sh    $HTTP_AUTH                             &&
-$SHELL "$TEST_DIR"/test_curl_post.sh   $HTTP_AUTH                             &&
-$SHELL "$TEST_DIR"/test_trailer.sh     $HTTP_AUTH                             &&
-$SHELL "$TEST_DIR"/test_nghttp_get.sh  $HTTP_AUTH direct                      &&
-$SHELL "$TEST_DIR"/test_nghttp_post.sh $HTTP_AUTH direct                      &&
-$SHELL "$TEST_DIR"/test_nghttp_get.sh  $HTTP_AUTH/proxy alpn "HTTP/1.1"       &&
-$SHELL "$TEST_DIR"/test_nghttp_post.sh $HTTP_AUTH/proxy alpn "HTTP/1.1"       &&
-$SHELL "$TEST_DIR"/test_curl_get.sh    $HTTP_AUTH/proxy alpn "HTTP/1.1"       &&
-$SHELL "$TEST_DIR"/test_curl_post.sh   $HTTP_AUTH/proxy alpn "HTTP/1.1"       &&
-$SHELL "$TEST_DIR"/test_nghttp_get.sh  $HTTP_AUTH/redirect alpn               &&
-$SHELL "$TEST_DIR"/test_nghttp_post.sh $HTTP_AUTH/redirect alpn               &&
-$SHELL "$TEST_DIR"/test_curl_get.sh    $HTTP_AUTH/redirect alpn               &&
-$SHELL "$TEST_DIR"/test_curl_post.sh   $HTTP_AUTH/redirect alpn               &&
-$SHELL "$TEST_DIR"/test_nghttp_get.sh  $HTTP_AUTH/rewrite alpn "HTTP/1.1"     &&
-$SHELL "$TEST_DIR"/test_nghttp_post.sh $HTTP_AUTH/rewrite alpn "HTTP/1.1"     &&
-$SHELL "$TEST_DIR"/test_curl_get.sh    $HTTP_AUTH/rewrite alpn "HTTP/1.1"     &&
-$SHELL "$TEST_DIR"/test_curl_post.sh   $HTTP_AUTH/rewrite alpn "HTTP/1.1"     &&
-$SHELL "$TEST_DIR"/test_nghttp_get.sh  $HTTPS_AUTH_SER alpn "HTTP/1.1"        &&
-$SHELL "$TEST_DIR"/test_nghttp_post.sh $HTTPS_AUTH_SER alpn "HTTP/1.1"        &&
-$SHELL "$TEST_DIR"/test_curl_get.sh    $HTTPS_AUTH_SER alpn "HTTP/1.1"        &&
-$SHELL "$TEST_DIR"/test_curl_post.sh   $HTTPS_AUTH_SER alpn "HTTP/1.1"        &&
-$SHELL "$TEST_DIR"/test_trailer.sh     $HTTPS_AUTH_SER                        ||
-fail
+if test -n "$suites"; then
+    echo "suites: $suites" >&2
+    for suite in $( echo $suites | tr , ' ' ); do
+        eval run_$suite || fail
+    done
+else
+    run_all
+fi
 
 



Mime
View raw message