Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions tests/gold_tests/cache/replay/cache-read-retry.replay.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,6 @@ sessions:
- [Host, example.com]
- [X-Request, second-exhausted]

proxy-request:
headers:
fields:
- [X-Request, {value: 'second-exhausted', as: equal}]

# This request should NOT reach the server if read-while-writer works
# It should be served from Request 1's response
server-response:
Expand Down Expand Up @@ -177,11 +172,6 @@ sessions:
- [Host, example.com]
- [X-Request, third-concurrent]

proxy-request:
headers:
fields:
- [X-Request, {value: 'third-concurrent', as: equal}]

# This request will also be served via read-while-writer
server-response:
status: 400
Expand Down
5 changes: 0 additions & 5 deletions tests/gold_tests/cache/replay/varied_transactions.replay.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,6 @@ sessions:
# transaction.
delay: 100ms

proxy-request:
headers:
fields:
- [ X-Vary-On-This, { value: sixth, as: equal } ]

# This should be served out of the cache and not reach the origin.
server-response:
<<: *404_response
Expand Down
6 changes: 0 additions & 6 deletions tests/gold_tests/h2/http2_close_connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,3 @@ sessions:
encoding: plain
data: server_test_2
size: 13

proxy-response:
content:
encoding: plain
data: server_test_2
verify: {as: equal}
7 changes: 5 additions & 2 deletions tests/gold_tests/h2/http2_flow_control.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,10 @@ def _configure_dns(self, tr: 'TestRun') -> 'Process':
Http2FlowControlTest._dns_counter += 1
return dns

def _configure_server(self, tr: 'TestRun', server_type: ServerType) -> 'Process':
def _configure_server(self, tr: 'TestRun', server_type: ServerType) -> Optional['Process']:
"""Configure the test server."""
if self._flow_control_policy_is_malformed:
return None
if server_type == self.ServerType.HTTP1_CHUNKED:
replay_file = self._replay_chunked_file
else:
Expand Down Expand Up @@ -166,7 +168,8 @@ def _configure_trafficserver(self, tr: 'TestRun', is_outbound: bool, server_type

ts.Disk.ssl_multicert_config.AddLine('dest_ip=* ssl_cert_name=server.pem ssl_key_name=server.key')

ts.Disk.remap_config.AddLine(f'map / https://127.0.0.1:{self._server.Variables.https_port}')
if self._server is not None:
ts.Disk.remap_config.AddLine(f'map / https://127.0.0.1:{self._server.Variables.https_port}')

if self._flow_control_policy_is_malformed:
if is_outbound:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ sessions:
- RST_STREAM:
error-code: INTERNAL_ERROR

proxy-request:
content:
encoding: plain
data: client_test
verify: {as: equal}

server-response:
headers:
fields:
Expand All @@ -47,9 +41,3 @@ sessions:
encoding: plain
data: server_test
size: 11

proxy-response:
content:
encoding: plain
data: server_test
verify: {as: equal}
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ sessions:
data: client_test
size: 11

proxy-request:
content:
encoding: plain
data: client_test
verify: {as: equal}

server-response:
headers:
fields:
Expand All @@ -47,9 +41,3 @@ sessions:
encoding: plain
data: server_test
size: 11

proxy-response:
content:
encoding: plain
data: server_test
verify: {as: equal}
32 changes: 32 additions & 0 deletions tests/gold_tests/headers/normalized_ae_match_vary_cache.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,38 @@
"uuid: 38", "Verify br;q=1.1 request (uuid 38) is a cache hit and doesn't reach the server.")
server.Streams.stdout += Testers.ExcludesExpression(
"uuid: 39", "Verify br,gzip;q=0.8 request (uuid 39) is a cache hit and doesn't reach the server.")
# Case 5 (normalize_ae:4) cache hits
server.Streams.stdout += Testers.ExcludesExpression(
"uuid: 42", "Verify empty Accept-Encoding (uuid 42) is a cache hit and doesn't reach the server.")
server.Streams.stdout += Testers.ExcludesExpression(
"uuid: 43", "Verify deflate request (uuid 43) is a cache hit and doesn't reach the server.")
server.Streams.stdout += Testers.ExcludesExpression(
"uuid: 47", "Verify zstd,br,compress,gzip request (uuid 47) is a cache hit and doesn't reach the server.")
server.Streams.stdout += Testers.ExcludesExpression(
"uuid: 48", "Verify br,compress,gzip request (uuid 48) is a cache hit and doesn't reach the server.")
server.Streams.stdout += Testers.ExcludesExpression(
"uuid: 49", "Verify compress,zstd request (uuid 49) is a cache hit and doesn't reach the server.")
server.Streams.stdout += Testers.ExcludesExpression(
"uuid: 410", "Verify compress,gzip request (uuid 410) is a cache hit and doesn't reach the server.")
# Case 6 (normalize_ae:5) cache hits
server.Streams.stdout += Testers.ExcludesExpression(
"uuid: 52", "Verify empty Accept-Encoding (uuid 52) is a cache hit and doesn't reach the server.")
server.Streams.stdout += Testers.ExcludesExpression(
"uuid: 53", "Verify deflate request (uuid 53) is a cache hit and doesn't reach the server.")
server.Streams.stdout += Testers.ExcludesExpression(
"uuid: 510", "Verify compress,zstd request (uuid 510) is a cache hit and doesn't reach the server.")
server.Streams.stdout += Testers.ExcludesExpression(
"uuid: 511", "Verify compress,br request (uuid 511) is a cache hit and doesn't reach the server.")
server.Streams.stdout += Testers.ExcludesExpression(
"uuid: 512", "Verify compress,gzip request (uuid 512) is a cache hit and doesn't reach the server.")
server.Streams.stdout += Testers.ExcludesExpression(
"uuid: 513", "Verify zstd;q=1.1 request (uuid 513) is a cache hit and doesn't reach the server.")
server.Streams.stdout += Testers.ExcludesExpression(
"uuid: 514", "Verify br;q=1.1 request (uuid 514) is a cache hit and doesn't reach the server.")
server.Streams.stdout += Testers.ExcludesExpression(
"uuid: 515", "Verify zstd,br;q=0.8 request (uuid 515) is a cache hit and doesn't reach the server.")
server.Streams.stdout += Testers.ExcludesExpression(
"uuid: 516", "Verify zstd,gzip;q=0.8 request (uuid 516) is a cache hit and doesn't reach the server.")

ts = Test.MakeATSProcess("ts", enable_cache=True)
ts.Disk.remap_config.AddLine(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1046,11 +1046,6 @@ sessions:
- [ Accept-Encoding, "zstd, br, compress, gzip" ]
delay: 100ms

proxy-request:
headers:
fields:
- [Accept-Encoding, { value: zstd, as: equal }]

server-response:
<<: *404_response

Expand All @@ -1074,11 +1069,6 @@ sessions:
- [ Accept-Encoding, "br, compress, gzip" ]
delay: 100ms

proxy-request:
headers:
fields:
- [Accept-Encoding, { value: br, as: equal }]

server-response:
<<: *404_response

Expand All @@ -1102,11 +1092,6 @@ sessions:
- [ Accept-Encoding, "compress, zstd" ]
delay: 100ms

proxy-request:
headers:
fields:
- [Accept-Encoding, { value: zstd, as: equal }]

server-response:
<<: *404_response

Expand All @@ -1130,11 +1115,6 @@ sessions:
- [ Accept-Encoding, "compress, gzip" ]
delay: 100ms

proxy-request:
headers:
fields:
- [Accept-Encoding, { value: gzip, as: equal }]

server-response:
<<: *404_response

Expand Down Expand Up @@ -1474,11 +1454,6 @@ sessions:
- [ Accept-Encoding, "compress, zstd" ]
delay: 100ms

proxy-request:
headers:
fields:
- [Accept-Encoding, { value: zstd, as: equal }]

server-response:
<<: *404_response

Expand All @@ -1502,11 +1477,6 @@ sessions:
- [ Accept-Encoding, "compress, br" ]
delay: 100ms

proxy-request:
headers:
fields:
- [Accept-Encoding, { value: br, as: equal }]

server-response:
<<: *404_response

Expand All @@ -1530,11 +1500,6 @@ sessions:
- [ Accept-Encoding, "compress, gzip" ]
delay: 100ms

proxy-request:
headers:
fields:
- [Accept-Encoding, { value: gzip, as: equal }]

server-response:
<<: *404_response

Expand All @@ -1558,11 +1523,6 @@ sessions:
- [ Accept-Encoding, "zstd;q=1.1" ]
delay: 100ms

proxy-request:
headers:
fields:
- [Accept-Encoding, { value: zstd, as: equal }]

server-response:
<<: *404_response

Expand All @@ -1586,11 +1546,6 @@ sessions:
- [ Accept-Encoding, "br;q=1.1" ]
delay: 100ms

proxy-request:
headers:
fields:
- [Accept-Encoding, { value: br, as: equal }]

server-response:
<<: *404_response

Expand All @@ -1613,11 +1568,6 @@ sessions:
- [ Accept-Encoding, "zstd, br;q=0.8" ]
delay: 100ms

proxy-request:
headers:
fields:
- [Accept-Encoding, { value: "zstd, br", as: equal }]

server-response:
<<: *404_response

Expand All @@ -1640,11 +1590,6 @@ sessions:
- [ Accept-Encoding, "zstd, gzip;q=0.8" ]
delay: 100ms

proxy-request:
headers:
fields:
- [Accept-Encoding, { value: "zstd, gzip", as: equal }]

server-response:
<<: *404_response

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ def __init__(self, disable_pristine_host_hdr=True):
TestUpdateHostHeader.test_counter += 1
self.disable_pristine_host_hdr = disable_pristine_host_hdr
self.replay_file = f'disable_pristine_host_hdr_{"true" if disable_pristine_host_hdr else "false"}.replay.yaml'
self.canary_replay_file = (
'disable_pristine_host_hdr_server_canary_true.replay.yaml'
if disable_pristine_host_hdr else 'disable_pristine_host_hdr_server_canary_false.replay.yaml')
self.stable_replay_file = 'disable_pristine_host_hdr_server_stable.replay.yaml'
self._setupDns()
self._setupServers()
self._setupTS(disable_pristine_host_hdr)
Expand All @@ -68,11 +72,11 @@ def _setupServers(self):

Creates two servers to simulate canary and stable environments.
"""
self._server_canary = Test.MakeVerifierServerProcess(f"server_canary_{self.test_id}", self.replay_file)
self._server_canary = Test.MakeVerifierServerProcess(f"server_canary_{self.test_id}", self.canary_replay_file)
expected_host = 'canary.com' if self.disable_pristine_host_hdr else 'example.com'
self._server_canary.Streams.All += Testers.ContainsExpression(expected_host, f'Host header should be {expected_host}')

self._server_stable = Test.MakeVerifierServerProcess(f"server_stable_{self.test_id}", self.replay_file)
self._server_stable = Test.MakeVerifierServerProcess(f"server_stable_{self.test_id}", self.stable_replay_file)
# The else path always preserves pristine host header (example.com).
expected_host = 'example.com'
self._server_stable.Streams.All += Testers.ContainsExpression(expected_host, f'Host header should be {expected_host}')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

meta:
version: "1.0"

sessions:
- transactions:
- client-request:
method: GET
url: /app/test
version: '1.1'
headers:
fields:
- [ Host, example.com ]
- [ Cookie, "SessionID=333" ]
- [ uuid, 1 ]

proxy-request:
headers:
fields:
- [ Host, { value: example.com, as: equal } ]

server-response:
status: 200
reason: OK
headers:
fields:
- [ Content-Length, "0" ]
- [ Connection, close ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

meta:
version: "1.0"

sessions:
- transactions:
- client-request:
method: GET
url: /app/test
version: '1.1'
headers:
fields:
- [ Host, example.com ]
- [ Cookie, "SessionID=333" ]
- [ uuid, 1 ]

proxy-request:
headers:
fields:
- [ Host, { value: "canary.com", as: contains } ]

server-response:
status: 200
reason: OK
headers:
fields:
- [ Content-Length, "0" ]
- [ Connection, close ]
Loading