"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "test/e2e/TestEnv.py" between
mod_http2-1.15.16.tar.gz and mod_http2-1.15.17.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.

TestEnv.py  (mod_http2-1.15.16):TestEnv.py  (mod_http2-1.15.17)
skipping to change at line 30 skipping to change at line 30
from datetime import timedelta from datetime import timedelta
from configparser import ConfigParser from configparser import ConfigParser
from shutil import copyfile from shutil import copyfile
from urllib.parse import urlparse from urllib.parse import urlparse
from TestNghttp import Nghttp from TestNghttp import Nghttp
class TestEnv: class TestEnv:
initialized = False initialized = False
PREFIX = "/usr"
GEN_DIR = "gen"
WEBROOT = "gen/apache"
CURL = "curl"
TEST_DIR = "test"
NGHTTP = "nghttp"
H2LOAD = "h2load"
HTTP_PORT = 42001
HTTPS_PORT = 42002
HTTP_TLD = "tests.httpd.apache.org"
APACHECTL = os.path.join(PREFIX, 'bin', 'apachectl')
HTTPD_ADDR = "127.0.0.1"
HTTP_URL = "http://{0}:{1}".format(HTTPD_ADDR, HTTP_PORT)
HTTPS_URL = "https://{0}:{1}".format(HTTPD_ADDR, HTTPS_PORT)
HTTPD_CONF_DIR = os.path.join(WEBROOT, "conf")
HTTPD_DOCS_DIR = os.path.join(WEBROOT, "htdocs")
HTTPD_LOGS_DIR = os.path.join(WEBROOT, "logs")
HTTPD_TEST_CONF = os.path.join(HTTPD_CONF_DIR, "test.conf")
E2E_DIR = os.path.join(TEST_DIR, "e2e")
VERIFY_CERTIFICATES = False
@classmethod @classmethod
def init( cls ) : def init( cls ) :
if TestEnv.initialized: if TestEnv.initialized:
return return
cls.config = ConfigParser() cls.config = ConfigParser()
cls.config.read('config.ini') cls.config.read('config.ini')
cls.PREFIX = cls.config.get('global', 'prefix') cls.PREFIX = cls.config.get('global', 'prefix')
cls.GEN_DIR = cls.config.get('global', 'gen_dir') cls.GEN_DIR = cls.config.get('global', 'gen_dir')
cls.WEBROOT = cls.config.get('global', 'server_dir') cls.WEBROOT = cls.config.get('global', 'server_dir')
skipping to change at line 230 skipping to change at line 256
conf_src = os.path.join("conf", "test.conf") conf_src = os.path.join("conf", "test.conf")
elif os.path.isabs(conf): elif os.path.isabs(conf):
conf_src = conf conf_src = conf
else: else:
conf_src = os.path.join("data", conf + ".conf") conf_src = os.path.join("data", conf + ".conf")
copyfile(conf_src, cls.HTTPD_TEST_CONF) copyfile(conf_src, cls.HTTPD_TEST_CONF)
################################################################################ ################### ################################################################################ ###################
# curl # curl
# #
@classmethod @classmethod
def curl_raw( cls, urls, timeout, options ) : def curl_complete_args( cls, urls, timeout, options ):
if not isinstance(urls, list): if not isinstance(urls, list):
urls = [ urls ] urls = [ urls ]
u = urlparse(urls[0]) u = urlparse(urls[0])
headerfile = ("%s/curl.headers" % cls.GEN_DIR) headerfile = ("%s/curl.headers" % cls.GEN_DIR)
if os.path.isfile(headerfile): if os.path.isfile(headerfile):
os.remove(headerfile) os.remove(headerfile)
args = [ args = [
cls.CURL, cls.CURL,
"-ks", "-D", headerfile, "-ks", "-D", headerfile,
"--resolve", ("%s:%s:%s" % (u.hostname, u.port, cls.HTTPD_ADDR)), "--resolve", ("%s:%s:%s" % (u.hostname, u.port, cls.HTTPD_ADDR)),
"--connect-timeout", ("%d" % timeout) "--connect-timeout", ("%d" % timeout)
] ]
if options: if options:
args.extend(options) args.extend(options)
args += urls args += urls
return args, headerfile
@classmethod
def curl_raw( cls, urls, timeout, options ):
args, headerfile = cls.curl_complete_args(urls, timeout, options)
r = cls.run( args ) r = cls.run( args )
if r["rv"] == 0: if r["rv"] == 0:
lines = open(headerfile).readlines() lines = open(headerfile).readlines()
exp_stat = True exp_stat = True
header = {} header = {}
for line in lines: for line in lines:
if exp_stat: if exp_stat:
print("reading 1st response line: %s" % line) print("reading 1st response line: %s" % line)
m = re.match(r'^(\S+) (\d+) (.*)$', line) m = re.match(r'^(\S+) (\d+) (.*)$', line)
assert m assert m
 End of changes. 4 change blocks. 
1 lines changed or deleted 33 lines changed or added

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