"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "test/e2e/test_004_post.py" between
mod_http2-1.15.14.tar.gz and mod_http2-1.15.16.tar.gz

About: mod_h[ttp]2 is an Apache httpd module implementing the HTTP2 protocol. It uses nghttp2 as base engine and connects it with the Apache infrastructure. Hint: Module (previous name "mod_h2") now integrated into Apache httpd (since v2.4.17). Experimental release.

test_004_post.py  (mod_http2-1.15.14):test_004_post.py  (mod_http2-1.15.16)
# #
# mod-h2 test suite # mod-h2 test suite
# check POST variations # check POST variations
# #
import copy import copy
import json
import os import os
import re import re
import sys import sys
import time import time
import pytest import pytest
from datetime import datetime from datetime import datetime
from TestEnv import TestEnv from TestEnv import TestEnv
from TestHttpdConf import HttpdConf from TestHttpdConf import HttpdConf
skipping to change at line 175 skipping to change at line 176
def test_004_24(self): def test_004_24(self):
self.nghttp_upload_and_verify( "data-1k", [ "--expect-continue" ] ) self.nghttp_upload_and_verify( "data-1k", [ "--expect-continue" ] )
self.nghttp_upload_and_verify( "data-100k", [ "--expect-continue" ] ) self.nghttp_upload_and_verify( "data-100k", [ "--expect-continue" ] )
@pytest.mark.skipif(True, reason="python3 regresses in chunked inputs to cgi ") @pytest.mark.skipif(True, reason="python3 regresses in chunked inputs to cgi ")
def test_004_25(self): def test_004_25(self):
self.nghttp_upload_and_verify( "data-1k", [ "--no-content-length" ] ) self.nghttp_upload_and_verify( "data-1k", [ "--no-content-length" ] )
self.nghttp_upload_and_verify( "data-10k", [ "--no-content-length" ] ) self.nghttp_upload_and_verify( "data-10k", [ "--no-content-length" ] )
self.nghttp_upload_and_verify( "data-100k", [ "--no-content-length" ] ) self.nghttp_upload_and_verify( "data-100k", [ "--no-content-length" ] )
self.nghttp_upload_and_verify( "data-1m", [ "--no-content-length" ] ) self.nghttp_upload_and_verify( "data-1m", [ "--no-content-length" ] )
def test_004_30(self):
# issue: #203
resource = "data-1k"
full_length = 1000
chunk = 200
self.curl_upload_and_verify( resource, [ "-v", "--http2"] )
logfile = os.path.join(TestEnv.HTTPD_LOGS_DIR, "test_004_30")
if os.path.isfile(logfile):
os.remove(logfile)
HttpdConf().add_line("""
LogFormat "{ \\"request\\": \\"%r\\", \\"status\\": %>s, \\"bytes_resp_B\\": %B,
\\"bytes_tx_O\\": %O, \\"bytes_rx_I\\": %I, \\"bytes_rx_tx_S\\": %S }" issue_20
3
CustomLog logs/test_004_30 issue_203
""").add_vhost_cgi().install()
assert TestEnv.apache_restart() == 0
url = TestEnv.mkurl("https", "cgi", "/files/{0}".format(resource))
r = TestEnv.curl_get(url, 5, ["--http2"])
assert 200 == r["response"]["status"]
r = TestEnv.curl_get(url, 5, ["--http1.1", "-H", "Range: bytes=0-{0}".fo
rmat(chunk-1)])
assert 206 == r["response"]["status"]
assert chunk == len(r["response"]["body"].decode('utf-8'))
r = TestEnv.curl_get(url, 5, ["--http2", "-H", "Range: bytes=0-{0}".form
at(chunk-1)])
assert 206 == r["response"]["status"]
assert chunk == len(r["response"]["body"].decode('utf-8'))
# now check what response lengths have actually been reported
lines = open(logfile).readlines()
log_h2_full = json.loads(lines[-3])
log_h1 = json.loads(lines[-2])
log_h2 = json.loads(lines[-1])
assert log_h2_full['bytes_rx_I'] > 0
assert log_h2_full['bytes_resp_B'] == full_length
assert log_h2_full['bytes_tx_O'] > full_length
assert log_h1['bytes_rx_I'] > 0 # input bytes recieved
assert log_h1['bytes_resp_B'] == chunk # response bytes sent (payload)
assert log_h1['bytes_tx_O'] > chunk # output bytes sent
assert log_h2['bytes_rx_I'] > 0
assert log_h2['bytes_resp_B'] == chunk
assert log_h2['bytes_tx_O'] > chunk
 End of changes. 2 change blocks. 
0 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)