Skip to content

Commit

Permalink
test: update http2 test 008_03 for curl allowing the server to send a…
Browse files Browse the repository at this point in the history
…lmost all data

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910995 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
icing committed Jul 14, 2023
1 parent bb9b477 commit b4c42dc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/modules/http2/test_008_ranges.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import inspect
import json
import logging
import os
import pytest

from .env import H2Conf, H2TestEnv


log = logging.getLogger(__name__)


@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
class TestRanges:

Expand Down Expand Up @@ -115,14 +119,17 @@ def test_h2_008_03(self, env, repeat):
'--limit-rate', '2k', '-m', '2'
])
assert r.exit_code != 0, f'{r}'
# Restart for logs to be flushed out
assert env.apache_restart() == 0
found = False
for line in open(TestRanges.LOGFILE).readlines():
e = json.loads(line)
log.info(f'inspecting logged request: {e["request"]}')
if e['request'] == f'GET {path}?03broken HTTP/2.0':
assert e['bytes_rx_I'] > 0
assert e['bytes_resp_B'] == 100*1024*1024
assert e['bytes_tx_O'] > 1024
assert e['bytes_tx_O'] < 10*1024*1024 # curl buffers, but not that much
assert e['bytes_tx_O'] < 100*1024*1024 # curl buffers, but not that much
found = True
break
assert found, f'request not found in {self.LOGFILE}'
Expand Down

0 comments on commit b4c42dc

Please sign in to comment.