Skip to content

Commit 8e43f53

Browse files
committed
Add AuTest for connect_attempts_max_retries_down_server
1 parent bc464c5 commit 8e43f53

2 files changed

Lines changed: 190 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
'''
2+
Verify Origin Server Connect Attempts Behavior
3+
'''
4+
# Licensed to the Apache Software Foundation (ASF) under one
5+
# or more contributor license agreements. See the NOTICE file
6+
# distributed with this work for additional information
7+
# regarding copyright ownership. The ASF licenses this file
8+
# to you under the Apache License, Version 2.0 (the
9+
# "License"); you may not use this file except in compliance
10+
# with the License. You may obtain a copy of the License at
11+
#
12+
# http://www.apache.org/licenses/LICENSE-2.0
13+
#
14+
# Unless required by applicable law or agreed to in writing, software
15+
# distributed under the License is distributed on an "AS IS" BASIS,
16+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
# See the License for the specific language governing permissions and
18+
# limitations under the License.
19+
20+
Test.Summary = '''
21+
Verify Origin Server Connect Attempts Behavior
22+
'''
23+
24+
# max_retries_down_server
25+
Test.ATSReplayTest(replay_file="replay/connect_attempts_rr_down_server.replay.yaml")
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
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+
#
18+
# This replay file assumes that caching is enabled.
19+
#
20+
21+
meta:
22+
version: "1.0"
23+
24+
# Configuration section for autest integration
25+
autest:
26+
description: 'Verify connect attempts behavior - retry down server'
27+
28+
dns:
29+
name: 'dns-ds'
30+
records: {"backend.example.com": ["0.0.0.1", "0.0.0.2"]}
31+
32+
server:
33+
name: 'server-ds'
34+
35+
client:
36+
name: 'client-ds'
37+
38+
ats:
39+
name: 'ts-ds'
40+
process_config:
41+
enable_cache: false
42+
43+
records_config:
44+
proxy.config.diags.debug.enabled: 1
45+
proxy.config.diags.debug.tags: 'http|hostdb|dns'
46+
proxy.config.http.connect_attempts_rr_retries: 0
47+
proxy.config.http.connect_attempts_max_retries: 2
48+
proxy.config.http.connect_attempts_max_retries_down_server: 1
49+
proxy.config.http.connect_attempts_timeout: 30
50+
proxy.config.http.down_server.cache_time: 5
51+
52+
remap_config:
53+
- from: "http://example.com/"
54+
to: "http://backend.example.com:{SERVER_HTTP_PORT}/"
55+
56+
sessions:
57+
- transactions:
58+
# try 0.0.0.1
59+
- client-request:
60+
method: GET
61+
url: /path/
62+
version: '1.1'
63+
headers:
64+
fields:
65+
- [Host, example.com]
66+
- [uuid, 1]
67+
68+
# should not hit
69+
server-response:
70+
status: 200
71+
reason: OK
72+
73+
proxy-response:
74+
status: 502
75+
76+
# try 0.0.0.2
77+
- client-request:
78+
method: GET
79+
url: /path/
80+
version: '1.1'
81+
headers:
82+
fields:
83+
- [Host, example.com]
84+
- [uuid, 2]
85+
86+
# should not hit
87+
server-response:
88+
status: 200
89+
reason: OK
90+
91+
proxy-response:
92+
status: 502
93+
94+
# retry on dead 0.0.0.1
95+
- client-request:
96+
method: GET
97+
url: /path/
98+
version: '1.1'
99+
headers:
100+
fields:
101+
- [Host, example.com]
102+
- [uuid, 3]
103+
104+
# should not hit
105+
server-response:
106+
status: 200
107+
reason: OK
108+
109+
proxy-response:
110+
status: 502
111+
112+
# retry on dead 0.0.0.2
113+
- client-request:
114+
method: GET
115+
url: /path/
116+
version: '1.1'
117+
headers:
118+
fields:
119+
- [Host, example.com]
120+
- [uuid, 4]
121+
122+
# should not hit
123+
server-response:
124+
status: 200
125+
reason: OK
126+
127+
proxy-response:
128+
status: 502
129+
130+
# request expected hit down_server cache and immidiately get 500
131+
- client-request:
132+
method: GET
133+
url: /path/
134+
version: '1.1'
135+
headers:
136+
fields:
137+
- [Host, example.com]
138+
- [uuid, 10]
139+
140+
# should not hit
141+
server-response:
142+
status: 200
143+
reason: OK
144+
145+
proxy-response:
146+
status: 500
147+
148+
# when down_server.cache_time is expired, try connect attempts
149+
- client-request:
150+
method: GET
151+
url: /path/
152+
version: '1.1'
153+
headers:
154+
fields:
155+
- [Host, example.com]
156+
- [uuid, 20]
157+
delay: 10s
158+
159+
# should not hit
160+
server-response:
161+
status: 200
162+
reason: OK
163+
164+
proxy-response:
165+
status: 502

0 commit comments

Comments
 (0)