summaryrefslogtreecommitdiffstats
path: root/test/pyhttpd/nghttp.py
diff options
context:
space:
mode:
authorStefan Eissing <icing@apache.org>2022-02-14 14:52:55 +0100
committerStefan Eissing <icing@apache.org>2022-02-14 14:52:55 +0100
commitc0c21ea991012fb808d9f484c904927ed36f9b8d (patch)
treedccb2c05eb6176bdc9c6e238019f52697b009528 /test/pyhttpd/nghttp.py
parentfr doc rebuild. (diff)
downloadapache2-c0c21ea991012fb808d9f484c904927ed36f9b8d.tar.xz
apache2-c0c21ea991012fb808d9f484c904927ed36f9b8d.zip
*) test: capture and parse output from nghttp more reliably.
add repeat param to certain proxy tests. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898068 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/pyhttpd/nghttp.py')
-rw-r--r--test/pyhttpd/nghttp.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/test/pyhttpd/nghttp.py b/test/pyhttpd/nghttp.py
index bc10600a6e..3927bc34ff 100644
--- a/test/pyhttpd/nghttp.py
+++ b/test/pyhttpd/nghttp.py
@@ -84,11 +84,12 @@ class Nghttp:
if len(l) == 0:
body += '\n'
continue
- m = re.match(r'\[.*] recv \(stream_id=(\d+)\) (\S+): (\S*)', l)
+ m = re.match(r'(.*)\[.*] recv \(stream_id=(\d+)\) (\S+): (\S*)', l)
if m:
- s = self.get_stream(streams, m.group(1))
- hname = m.group(2)
- hval = m.group(3)
+ body += m.group(1)
+ s = self.get_stream(streams, m.group(2))
+ hname = m.group(3)
+ hval = m.group(4)
print("stream %d header %s: %s" % (s["id"], hname, hval))
header = s["header"]
if hname in header:
@@ -98,9 +99,10 @@ class Nghttp:
body = ''
continue
- m = re.match(r'\[.*] recv HEADERS frame <.* stream_id=(\d+)>', l)
+ m = re.match(r'(.*)\[.*] recv HEADERS frame <.* stream_id=(\d+)>', l)
if m:
- s = self.get_stream(streams, m.group(1))
+ body += m.group(1)
+ s = self.get_stream(streams, m.group(2))
if s:
print("stream %d: recv %d header" % (s["id"], len(s["header"])))
response = s["response"]
@@ -123,8 +125,8 @@ class Nghttp:
m = re.match(r'(.*)\[.*] recv DATA frame <length=(\d+), .*stream_id=(\d+)>', l)
if m:
- s = self.get_stream(streams, m.group(3))
body += m.group(1)
+ s = self.get_stream(streams, m.group(3))
blen = int(m.group(2))
if s:
print("stream %d: %d DATA bytes added" % (s["id"], blen))
@@ -140,9 +142,10 @@ class Nghttp:
skip_indents = True
continue
- m = re.match(r'\[.*] recv PUSH_PROMISE frame <.* stream_id=(\d+)>', l)
+ m = re.match(r'(.*)\[.*] recv PUSH_PROMISE frame <.* stream_id=(\d+)>', l)
if m:
- s = self.get_stream(streams, m.group(1))
+ body += m.group(1)
+ s = self.get_stream(streams, m.group(2))
if s:
# headers we have are request headers for the PUSHed stream
# these have been received on the originating stream, the promised
@@ -283,7 +286,7 @@ Content-Transfer-Encoding: binary
def _run(self, args) -> ExecResult:
print(("execute: %s" % " ".join(args)))
start = datetime.now()
- p = subprocess.run(args, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
+ p = subprocess.run(args, capture_output=True, text=False)
return ExecResult(args=args, exit_code=p.returncode,
stdout=p.stdout, stderr=p.stderr,
duration=datetime.now() - start)