|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | + |
| 17 | +import sys |
| 18 | + |
| 19 | +Test.Sumary = ''' |
| 20 | +Verify Concurrent Streams Handling |
| 21 | +''' |
| 22 | + |
| 23 | + |
| 24 | +class Http2ConcurrentStreamsTest: |
| 25 | + replayFile = "replay/http2_concurrent_streams.replay.yaml" |
| 26 | + |
| 27 | + def __init__(self): |
| 28 | + self.__setupOriginServer() |
| 29 | + self.__setupTS() |
| 30 | + |
| 31 | + def __setupOriginServer(self): |
| 32 | + self._server = Test.MakeVerifierServerProcess("verifier-server", self.replayFile) |
| 33 | + |
| 34 | + def __setupTS(self): |
| 35 | + self._ts = Test.MakeATSProcess(f"ts", enable_tls=True, enable_cache=True) |
| 36 | + self._ts.addDefaultSSLFiles() |
| 37 | + self._ts.Disk.records_config.update( |
| 38 | + { |
| 39 | + 'proxy.config.diags.debug.enabled': 1, |
| 40 | + 'proxy.config.diags.debug.tags': 'http2', |
| 41 | + 'proxy.config.ssl.server.cert.path': f"{self._ts.Variables.SSLDir}", |
| 42 | + 'proxy.config.ssl.server.private_key.path': f"{self._ts.Variables.SSLDir}", |
| 43 | + 'proxy.config.http.insert_response_via_str': 2, |
| 44 | + }) |
| 45 | + self._ts.Disk.remap_config.AddLine(f"map / http://127.0.0.1:{self._server.Variables.http_port}") |
| 46 | + self._ts.Disk.ssl_multicert_config.AddLine('dest_ip=* ssl_cert_name=server.pem ssl_key_name=server.key') |
| 47 | + |
| 48 | + def run(self): |
| 49 | + tr = Test.AddTestRun() |
| 50 | + tr.AddVerifierClientProcess( |
| 51 | + "verifier-client", self.replayFile, http_ports=[self._ts.Variables.port], https_ports=[self._ts.Variables.ssl_port]) |
| 52 | + tr.Processes.Default.StartBefore(self._ts) |
| 53 | + tr.Processes.Default.StartBefore(self._server) |
| 54 | + tr.StillRunningAfter = self._ts |
| 55 | + tr.StillRunningAfter = self._server |
| 56 | + |
| 57 | + |
| 58 | +Http2ConcurrentStreamsTest().run() |
0 commit comments