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 2018/10/10 11:32:14 UTC

svn commit: r1843425 - in /httpd/test/mod_h2/trunk: Makefile.am conf/httpd.conf configure.ac htdocs/test.example.org/upload.py test/go/test_get.sh test/test.sh test/test_common.sh test/test_curl_get.sh test/test_nghttp_get.sh

Author: icing
Date: Wed Oct 10 11:32:14 2018
New Revision: 1843425

URL: http://svn.apache.org/viewvc?rev=1843425&view=rev
Log:
some tweaks on cgi script and resulting resonse formatting

Modified:
    httpd/test/mod_h2/trunk/Makefile.am
    httpd/test/mod_h2/trunk/conf/httpd.conf
    httpd/test/mod_h2/trunk/configure.ac
    httpd/test/mod_h2/trunk/htdocs/test.example.org/upload.py
    httpd/test/mod_h2/trunk/test/go/test_get.sh
    httpd/test/mod_h2/trunk/test/test.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_nghttp_get.sh

Modified: httpd/test/mod_h2/trunk/Makefile.am
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/Makefile.am?rev=1843425&r1=1843424&r2=1843425&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/Makefile.am (original)
+++ httpd/test/mod_h2/trunk/Makefile.am Wed Oct 10 11:32:14 2018
@@ -128,6 +128,12 @@ test-gets-cont: $(MH2FUZZ) $(SERVER_DIR)
 	@mkdir -p $(GEN)/tmp
 	@$(TESTRUN) test/test.sh -c test $(HTTP_PORT) $(HTTPS_PORT) $(HOST_NAME) $(HOST_NAME_2) $(HOST_SER_NAME)
 
+test-posts: $(MH2FUZZ) $(SERVER_DIR)/.test-setup
+	@rm -rf $(GEN)/tmp
+	@mkdir -p $(GEN)/tmp
+	@$(TESTRUN) test/test.sh -s proxy_post test $(HTTP_PORT) $(HTTPS_PORT) \
+                                $(HOST_NAME) $(HOST_NAME_2) $(HOST_SER_NAME)
+
 test-proxy: $(MH2FUZZ) $(SERVER_DIR)/.test-setup
 	@rm -rf $(GEN)/tmp
 	@mkdir -p $(GEN)/tmp

Modified: httpd/test/mod_h2/trunk/conf/httpd.conf
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/conf/httpd.conf?rev=1843425&r1=1843424&r2=1843425&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/conf/httpd.conf (original)
+++ httpd/test/mod_h2/trunk/conf/httpd.conf Wed Oct 10 11:32:14 2018
@@ -23,6 +23,9 @@ LogLevel warn
 
 CoreDumpDirectory "/tmp"
 
+Timeout 10
+#KeepAliveTimeout 60
+
 # unlimited connection reuse
 MaxKeepAliveRequests 0
 
@@ -75,13 +78,13 @@ DocumentRoot "SUBST_SERVER_ROOT_SUBST/ht
 
 <IfModule proxy_module>
     ProxyStatus on
-    ProxyTimeout 30
+    ProxyTimeout 5
     SSLProxyEngine on
     <Proxy "balancer://http-local">
-        BalancerMember "http://127.0.0.1:SUBST_PORT_HTTP_SUBST" hcmethod=GET hcuri=/
+        BalancerMember "http://127.0.0.1:SUBST_PORT_HTTP_SUBST" hcmethod=GET hcuri=/ ttl=4
     </Proxy>
     <Proxy "balancer://https-local">
-        BalancerMember "https://127.0.0.1:SUBST_PORT_HTTPS_SUBST" hcmethod=GET hcuri=/
+        BalancerMember "https://127.0.0.1:SUBST_PORT_HTTPS_SUBST" hcmethod=GET hcuri=/ ttl=4
     </Proxy>
     ProxyPreserveHost on
 </IfModule>
@@ -93,12 +96,14 @@ DocumentRoot "SUBST_SERVER_ROOT_SUBST/ht
     #LogLevel trace8
     #LogLevel ssl:trace1
     #LogLevel proxy:debug    
+    #LogLevel proxy_http:debug    
     #DumpIOInput On
     #DumpIOOutput On
     #LogLevel dumpio:trace7
 
 <IfModule http2_module>
     LogLevel http2:info
+    #LogLevel core:trace6
     
     # max parallel streams per session, default 100
     #H2MaxSessionStreams

Modified: httpd/test/mod_h2/trunk/configure.ac
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/configure.ac?rev=1843425&r1=1843424&r2=1843425&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/configure.ac (original)
+++ httpd/test/mod_h2/trunk/configure.ac Wed Oct 10 11:32:14 2018
@@ -128,7 +128,7 @@ TEST_DEP=""
 ################################################################################
 # curl 
 ################################################################################
-CURL_VERSION=7.61.0
+CURL_VERSION=7.61.1
 
 AC_PATH_PROG([CURL], [curl])
 CURL=""
@@ -272,7 +272,7 @@ fi
 ################################################################################
 
 #OPENSSL_VERSION=1.0.2l
-OPENSSL_VERSION=1.1.1-pre9
+OPENSSL_VERSION=1.1.1
 LIBEVENT_VERSION=2.0.22-stable
 LIBEV_VERSION=4.24
 ZLIB_VERSION=1.2.11

Modified: httpd/test/mod_h2/trunk/htdocs/test.example.org/upload.py
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/htdocs/test.example.org/upload.py?rev=1843425&r1=1843424&r2=1843425&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/htdocs/test.example.org/upload.py (original)
+++ httpd/test/mod_h2/trunk/htdocs/test.example.org/upload.py Wed Oct 10 11:32:14 2018
@@ -4,6 +4,10 @@ import cgitb; cgitb.enable()
 
 status = '200 Ok'
 
+
+def mk_body(s):
+    return ("<html><body>\n<p>%s</p>\n</body></html>" % (s))
+
 try: # Windows needs stdio set for binary mode.
     import msvcrt
     msvcrt.setmode (0, os.O_BINARY) # stdin  = 0
@@ -12,6 +16,7 @@ except ImportError:
     pass
 
 form = cgi.FieldStorage()
+body=''
 
 # Test if the file was uploaded
 if 'file' in form:
@@ -23,7 +28,7 @@ if 'file' in form:
     f = open('./files/' + fn, 'wb');
     f.write(fileitem.file.read())
     f.close()
-    message = 'The file "' + fn + '" was uploaded successfully'
+    body = mk_body('The file "%s" was uploaded successfully' %fn)
 
 elif 'remove' in form:
     remove = form['remove'].value
@@ -35,15 +40,12 @@ elif 'remove' in form:
         message = 'Error removing ' + fn + ': ' + e.strerror
         status = '404 File Not Found'
 else:
-    message = '''\
-        Upload File<form method="POST" enctype="multipart/form-data">
-        <input type="file" name="file">
-        <button type="submit">Upload</button></form>
-        '''
-
-print "Status: %s" % (status,)
-print """\
-Content-Type: text/html\n
-    <html><body>
-    <p>%s</p>
-    </body></html>""" % (message,)
+    body = mk_body('''Upload File<form method="POST" enctype="multipart/form-data">
+<input type="file" name="file">
+<button type="submit">Upload</button></form>''')
+
+print "Status: %s" % (status)
+print "Content-Type: text/html"
+print "Content-Length: %d"  % (len(body) + 1)
+print ""
+print "%s" % (body)

Modified: httpd/test/mod_h2/trunk/test/go/test_get.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/go/test_get.sh?rev=1843425&r1=1843424&r2=1843425&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/go/test_get.sh (original)
+++ httpd/test/mod_h2/trunk/test/go/test_get.sh Wed Oct 10 11:32:14 2018
@@ -82,21 +82,19 @@ EOF
 
 
 go_check_content upload.py "http/1.1" --http1.1 <<EOF
-    <html><body>
-    <p>        Upload File<form method="POST" enctype="multipart/form-data">
-        <input type="file" name="file">
-        <button type="submit">Upload</button></form>
-        </p>
-    </body></html>
+<html><body>
+<p>Upload File<form method="POST" enctype="multipart/form-data">
+<input type="file" name="file">
+<button type="submit">Upload</button></form></p>
+</body></html>
 EOF
 
 go_check_content upload.py "http2" <<EOF
-    <html><body>
-    <p>        Upload File<form method="POST" enctype="multipart/form-data">
-        <input type="file" name="file">
-        <button type="submit">Upload</button></form>
-        </p>
-    </body></html>
+<html><body>
+<p>Upload File<form method="POST" enctype="multipart/form-data">
+<input type="file" name="file">
+<button type="submit">Upload</button></form></p>
+</body></html>
 EOF
 
 

Modified: httpd/test/mod_h2/trunk/test/test.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/test.sh?rev=1843425&r1=1843424&r2=1843425&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test.sh (original)
+++ httpd/test/mod_h2/trunk/test/test.sh Wed Oct 10 11:32:14 2018
@@ -112,10 +112,10 @@ run_interim() {
 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/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/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                         &&
@@ -132,6 +132,11 @@ run_post() {
     fail
 }
 
+run_proxy_post() {
+    $SHELL "$TEST_DIR"/test_nghttp_post.sh $HTTPS_AUTH/proxy 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                                ||

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=1843425&r1=1843424&r2=1843425&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_common.sh (original)
+++ httpd/test/mod_h2/trunk/test/test_common.sh Wed Oct 10 11:32:14 2018
@@ -631,7 +631,7 @@ nghttp_remove_file() {
     fname="$(basename $FILE)"
     rm -rf $TMP
     mkdir -p $TMP
-    cat > $TMP/updata <<EOF
+    cat > $TMP/updata.remove <<EOF
 --DSAJKcd9876
 Content-Disposition: form-data; name="remove";
 Content-Type: text/plain
@@ -640,7 +640,7 @@ $fname
 --DSAJKcd9876--
 EOF
     echo -n " * nghttp /$DOC: rm $fname..."
-    ${NGHTTP} -v "$@"$ARG_UPGRADE --data=$TMP/updata -H'Content-Type: multipart/form-data; boundary=DSAJKcd9876' $URL_PREFIX/$DOC > $TMP/$DOC 2>&1 || fail "error removing $fname"
+    ${NGHTTP} -v "$@"$ARG_UPGRADE --data=$TMP/updata.remove -H'Content-Type: multipart/form-data; boundary=DSAJKcd9876' $URL_PREFIX/$DOC > $TMP/$DOC 2>&1 || fail "error removing $fname"
     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=1843425&r1=1843424&r2=1843425&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_curl_get.sh (original)
+++ httpd/test/mod_h2/trunk/test/test_curl_get.sh Wed Oct 10 11:32:14 2018
@@ -67,21 +67,19 @@ EOF
 
 
 curl_check_content upload.py "http/1.1" --http1.1 <<EOF
-    <html><body>
-    <p>        Upload File<form method="POST" enctype="multipart/form-data">
-        <input type="file" name="file">
-        <button type="submit">Upload</button></form>
-        </p>
-    </body></html>
+<html><body>
+<p>Upload File<form method="POST" enctype="multipart/form-data">
+<input type="file" name="file">
+<button type="submit">Upload</button></form></p>
+</body></html>
 EOF
 
 curl_check_content upload.py "http2"    --http2 <<EOF
-    <html><body>
-    <p>        Upload File<form method="POST" enctype="multipart/form-data">
-        <input type="file" name="file">
-        <button type="submit">Upload</button></form>
-        </p>
-    </body></html>
+<html><body>
+<p>Upload File<form method="POST" enctype="multipart/form-data">
+<input type="file" name="file">
+<button type="submit">Upload</button></form></p>
+</body></html>
 EOF
 
 

Modified: httpd/test/mod_h2/trunk/test/test_nghttp_get.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/test_nghttp_get.sh?rev=1843425&r1=1843424&r2=1843425&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_nghttp_get.sh (original)
+++ httpd/test/mod_h2/trunk/test/test_nghttp_get.sh Wed Oct 10 11:32:14 2018
@@ -239,7 +239,7 @@ $URL_PATH/007.html 808 200
 EOF
 
 nghttp_check_assets upload.py "with assets" <<EOF
-$URL_PATH/upload.py 219 200
+$URL_PATH/upload.py 174 200
 EOF
 
 #nghttp_check_assets 009.php "with assets" <<EOF