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
18 changes: 16 additions & 2 deletions tests/gold_tests/autest-site/ats_replay.test.ext
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,24 @@ def configure_ats(obj: 'TestRun', server: 'Process', ats_config: dict, dns: Opti
:returns: The ATS process object.
'''
name = ats_config.get('name', 'ts')
process_config = ats_config.get('process_config', {})
process_config = ats_config.get('process_config', {}).copy()
disable_log_checks = process_config.pop('disable_log_checks', False)
ts = obj.MakeATSProcess(name, **process_config)
if disable_log_checks:
ts.Disk.diags_log.Content = Testers.ExcludesExpression(r'(?!)', 'Default diags log checks are disabled.')

records_config = ats_config.get('records_config', {})
ts.Disk.records_config.update(records_config)

if process_config.get('enable_tls', False):
ts.addDefaultSSLFiles()
Comment on lines 34 to +45
ts.Disk.records_config.update(
{
'proxy.config.ssl.server.cert.path': ts.Variables.SSLDir,
'proxy.config.ssl.server.private_key.path': ts.Variables.SSLDir,
})
ts.Disk.ssl_multicert_config.AddLine('dest_ip=* ssl_cert_name=server.pem ssl_key_name=server.key')

# Configure plugin_config if specified.
plugin_config = ats_config.get('plugin_config', [])
for plugin_line in plugin_config:
Expand Down Expand Up @@ -166,7 +179,8 @@ def ATSReplayTest(obj, replay_file: str):
if not 'ats' in autest_config:
raise ValueError(f"Replay file {replay_file} does not contain 'autest.ats' section")
ats_config = autest_config['ats']
enable_tls = ats_config.get('enable_tls', False)
process_config = ats_config.get('process_config', {})
enable_tls = process_config.get('enable_tls', ats_config.get('enable_tls', False))
ts = configure_ats(tr, server=server, ats_config=ats_config, dns=dns)

# Proxy Verifier Client configuration.
Expand Down
20 changes: 6 additions & 14 deletions tests/gold_tests/cache/replay/bg_fill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,9 @@ meta:
version: '1.0'
sessions:
- protocol:
- name: http
version: 2
- name: tls
sni: test_sni
- name: tcp
- name: ip
version: 4
stack: http2
tls:
sni: test_sni
transactions:
- client-request:
frames:
Expand Down Expand Up @@ -65,13 +61,9 @@ sessions:
size: 11

- protocol:
- name: http
version: 2
- name: tls
sni: test_sni
- name: tcp
- name: ip
version: 4
stack: http2
tls:
sni: test_sni
transactions:
- client-request:
delay: 3s
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
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,7 @@ sessions:
size: 32

- protocol:
- name: http
version: 1
- name: tls
- name: tcp
- name: ip

stack: https
transactions:
- client-request:
method: "GET"
Expand Down
56 changes: 18 additions & 38 deletions tests/gold_tests/client_connection/http2_slow_origins.replay.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,9 @@ meta:
sessions:

- protocol:
- name: http
version: 2
- name: tls
sni: test_sni
- name: tcp
- name: ip

stack: http2
tls:
sni: test_sni
transactions:

- client-request:
Expand Down Expand Up @@ -75,13 +71,9 @@ sessions:
- [ X-Response, {value: 'first-response', as: equal } ]

- protocol:
- name: http
version: 2
- name: tls
sni: test_sni
- name: tcp
- name: ip

stack: http2
tls:
sni: test_sni
transactions:

- client-request:
Expand Down Expand Up @@ -117,13 +109,9 @@ sessions:
- [ X-Response, {value: 'second-response', as: equal } ]

- protocol:
- name: http
version: 2
- name: tls
sni: test_sni
- name: tcp
- name: ip

stack: http2
tls:
sni: test_sni
transactions:

- client-request:
Expand Down Expand Up @@ -160,16 +148,12 @@ sessions:


- protocol:
- name: http
version: 2
- name: tls
sni: test_sni
- name: tcp
- name: ip

# Make sure this is the last attempted transaction by giving the above
# three transactions, all executed in parallel, a one second head start.
# This connection should be aborted.
# Make sure this is the last attempted transaction by giving the above
# three transactions, all executed in parallel, a one second head start.
# This connection should be aborted.
stack: http2
tls:
sni: test_sni
delay: 1s

transactions:
Expand Down Expand Up @@ -198,13 +182,9 @@ sessions:
# Note that this will delay after the previous 1s delay, so this is really
# a delay of 3s.
- protocol:
- name: http
version: 2
- name: tls
sni: test_sni
- name: tcp
- name: ip

stack: http2
tls:
sni: test_sni
delay: 2s

transactions:
Expand Down
46 changes: 18 additions & 28 deletions tests/gold_tests/client_connection/https_slow_origins.replay.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ meta:
sessions:

- protocol:
- name: tls
sni: test_sni
- name: tcp
- name: ip

stack: https
tls:
sni: test_sni
transactions:

- client-request:
Expand Down Expand Up @@ -75,11 +73,9 @@ sessions:
- [ X-Response, {value: 'first-response', as: equal } ]

- protocol:
- name: tls
sni: test_sni
- name: tcp
- name: ip

stack: https
tls:
sni: test_sni
transactions:

- client-request:
Expand Down Expand Up @@ -117,11 +113,9 @@ sessions:
- [ X-Response, {value: 'second-response', as: equal } ]

- protocol:
- name: tls
sni: test_sni
- name: tcp
- name: ip

stack: https
tls:
sni: test_sni
transactions:

- client-request:
Expand Down Expand Up @@ -160,14 +154,12 @@ sessions:


- protocol:
- name: tls
sni: test_sni
- name: tcp
- name: ip

# Make sure this is the last attempted transaction by giving the above
# three transactions, all executed in parallel, a one second head start.
# This connection should be aborted.
# Make sure this is the last attempted transaction by giving the above
# three transactions, all executed in parallel, a one second head start.
# This connection should be aborted.
stack: https
tls:
sni: test_sni
delay: 1s

transactions:
Expand Down Expand Up @@ -198,11 +190,9 @@ sessions:
# Note that this will delay after the previous 1s delay, so this is really
# a delay of 3s.
- protocol:
- name: tls
sni: test_sni
- name: tcp
- name: ip

stack: https
tls:
sni: test_sni
delay: 2s

transactions:
Expand Down
8 changes: 2 additions & 6 deletions tests/gold_tests/connect/replays/connect_h2.replay.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,9 @@ meta:

sessions:
- protocol:
- name: http
version: 2
- name: tls
stack: http2
tls:
sni: www.example.com
- name: tcp
- name: ip

transactions:
- client-request:
frames:
Expand Down
9 changes: 2 additions & 7 deletions tests/gold_tests/h2/expect_100_continue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,10 @@ meta:

sessions:
- protocol:
- name: http
version: '2'
- name: tls
stack: http2
tls:
version: TLSv1.3
sni: data.brian.example.com
- name: tcp
- name: ip
version: '4'

transactions:
- client-request:
headers:
Expand Down
10 changes: 3 additions & 7 deletions tests/gold_tests/h2/h2get_with_body.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,9 @@ meta:
version: '1.0'
sessions:
- protocol:
- name: http
version: 2
- name: tls
sni: test_sni
- name: tcp
- name: ip
version: 4
stack: http2
tls:
sni: test_sni
transactions:
- client-request:
frames:
Expand Down
16 changes: 3 additions & 13 deletions tests/gold_tests/h2/http2_close_connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,9 @@ meta:
version: '1.0'
sessions:
- protocol:
- name: http
version: 2
- name: tls
sni: test_sni
- name: tcp
- name: ip
version: 4
stack: http2
tls:
sni: test_sni
transactions:
- client-request:
frames:
Expand Down Expand Up @@ -92,9 +88,3 @@ sessions:
encoding: plain
data: server_test_2
size: 13

proxy-response:
content:
encoding: plain
data: server_test_2
verify: {as: equal}
10 changes: 3 additions & 7 deletions tests/gold_tests/h2/http2_flow_control.replay.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,9 @@ meta:
sessions:

- protocol:
- name: http
version: 2
- name: tls
sni: www.example.com
- name: tcp
- name: ip

stack: http2
tls:
sni: www.example.com
transactions:

- client-request:
Expand Down
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
Loading