Skip to content

Commit 062a5cf

Browse files
author
Serris Lew
committed
add uds path to curl command
1 parent 746bcb5 commit 062a5cf

File tree

84 files changed

+361
-422
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+361
-422
lines changed

tests/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ if(ENABLE_AUTEST_UDS)
5151
PATTERN "*"
5252
PATTERN "h2" EXCLUDE
5353
PATTERN "tls*" EXCLUDE
54+
PATTERN "tls/ssl/**"
5455
)
5556
else()
5657
# Copy everything except autest_uds tests that are only for curl uds option

tests/gold_tests/basic/basic.test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@
2525
t.StillRunningAfter = Test.Processes.ts
2626

2727
p = t.Processes.Default
28-
t.MakeCurlCommand("http://127.0.0.1:{0}".format(ts.Variables.port))
28+
t.MakeCurlCommand("http://127.0.0.1:{0}".format(ts.Variables.port), uds_path=ts.Variables.uds_path)
2929
p.ReturnCode = 0
3030
p.StartBefore(Test.Processes.ts)

tests/gold_tests/basic/config.test.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,12 @@
2121

2222
ts = Test.MakeATSProcess("ts", select_ports=False)
2323
ts.Variables.port = 8090
24-
uds_path = os.path.join(Test.RunDirectory, 'uds.socket')
2524
ts.Disk.records_config.update({
26-
'proxy.config.http.server_ports': str(ts.Variables.port) + f" {uds_path}",
25+
'proxy.config.http.server_ports': str(ts.Variables.port) + f" {ts.Variables.uds_path}",
2726
})
2827
ts.Ready = When.PortOpen(ts.Variables.port)
2928
t = Test.AddTestRun("Test traffic server started properly")
3029
t.Processes.Default.StartBefore(ts)
31-
t.MakeCurlCommand("127.0.0.1:{port}".format(port=ts.Variables.port))
30+
t.MakeCurlCommand("127.0.0.1:{port}".format(port=ts.Variables.port), uds_path=ts.Variables.uds_path)
3231
t.ReturnCode = 0
3332
t.StillRunningAfter = ts

tests/gold_tests/basic/copy_config.test.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@
2222
# set up some ATS processes
2323
ts1 = Test.MakeATSProcess("ts1", select_ports=False)
2424
ts1.Variables.port = 8090
25-
uds_path = os.path.join(Test.RunDirectory, 'uds.socket')
2625
ts1.Disk.records_config.update({
27-
'proxy.config.http.server_ports': str(ts1.Variables.port) + f" {uds_path}",
26+
'proxy.config.http.server_ports': str(ts1.Variables.port) + f" {ts1.Variables.uds_path}",
2827
})
2928
ts1.Ready = When.PortOpen(ts1.Variables.port)
3029

@@ -39,14 +38,14 @@
3938
t = Test.AddTestRun("Talk to ts1")
4039
t.Processes.Default.StartBefore(ts1)
4140
t.Processes.Default.StartBefore(ts2)
42-
t.MakeCurlCommand("127.0.0.1:{port}".format(port=ts1.Variables.port), uds_path=ts.Variables.uds_path)
41+
t.MakeCurlCommand("127.0.0.1:{port}".format(port=ts1.Variables.port), uds_path=ts1.Variables.uds_path)
4342
t.ReturnCode = 0
4443
t.StillRunningAfter = ts1
4544
t.StillRunningAfter += ts2
4645

4746
# setup a testrun
4847
t = Test.AddTestRun("Talk to ts2")
49-
t.MakeCurlCommandMulti("{{curl_base}} 127.0.0.1:{port}".format(port=ts2.Variables.port), uds_path=ts.Variables.uds_path)
48+
t.MakeCurlCommandMulti("{{curl_base}} 127.0.0.1:{port}".format(port=ts2.Variables.port))
5049
t.ReturnCode = 0
5150
t.StillRunningAfter = ts1
5251
t.StillRunningAfter += ts2

tests/gold_tests/basic/copy_config2.test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
t.StillRunningAfter = ts1
2828
t.StillRunningAfter += ts2
2929
p = t.Processes.Default
30-
t.MakeCurlCommand("127.0.0.1:{0}".format(ts1.Variables.port))
30+
t.MakeCurlCommand("127.0.0.1:{0}".format(ts1.Variables.port), uds_path=ts1.Variables.uds_path)
3131
p.ReturnCode = 0
3232
p.StartBefore(Test.Processes.ts1)
3333
p.StartBefore(Test.Processes.ts2)
@@ -39,5 +39,5 @@
3939
t.StillRunningAfter = ts1
4040
t.StillRunningAfter += ts2
4141
p = t.Processes.Default
42-
t.MakeCurlCommand("127.0.0.1:{0}".format(ts2.Variables.port))
42+
t.MakeCurlCommand("127.0.0.1:{0}".format(ts2.Variables.port), uds_path=ts2.Variables.uds_path)
4343
p.ReturnCode = 0

tests/gold_tests/cache/cache-generation-disjoint.test.py

+12-6
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
tr = Test.AddTestRun()
5151
tr.MakeCurlCommand(
5252
'"http://127.0.0.1:{0}/default/cache/10/{1}" -H "x-debug: x-cache,x-cache-key,via,x-cache-generation" --verbose'.format(
53-
ts.Variables.port, objectid))
53+
ts.Variables.port, objectid),
54+
uds_path=ts.Variables.uds_path)
5455
tr.Processes.Default.ReturnCode = 0
5556
tr.Processes.Default.StartBefore(Test.Processes.ts)
5657
tr.Processes.Default.Streams.All = "gold/miss_default-1.gold"
@@ -59,38 +60,43 @@
5960
tr = Test.AddTestRun()
6061
tr.MakeCurlCommand(
6162
'"http://127.0.0.1:{0}/generation1/cache/10/{1}" -H "x-debug: x-cache,x-cache-key,via,x-cache-generation" --verbose'.format(
62-
ts.Variables.port, objectid))
63+
ts.Variables.port, objectid),
64+
uds_path=ts.Variables.uds_path)
6365
tr.Processes.Default.ReturnCode = 0
6466
tr.Processes.Default.Streams.All = "gold/miss_gen1.gold"
6567

6668
# Same URL in generation 2 is still a MISS.
6769
tr = Test.AddTestRun()
6870
tr.MakeCurlCommand(
6971
'"http://127.0.0.1:{0}/generation2/cache/10/{1}" -H "x-debug: x-cache,x-cache-key,via,x-cache-generation" --verbose'.format(
70-
ts.Variables.port, objectid))
72+
ts.Variables.port, objectid),
73+
uds_path=ts.Variables.uds_path)
7174
tr.Processes.Default.ReturnCode = 0
7275
tr.Processes.Default.Streams.All = "gold/miss_gen2.gold"
7376

7477
# Second touch is a HIT for default.
7578
tr = Test.AddTestRun()
7679
tr.MakeCurlCommand(
7780
'"http://127.0.0.1:{0}/default/cache/10/{1}" -H "x-debug: x-cache,x-cache-key,via,x-cache-generation" --verbose'.format(
78-
ts.Variables.port, objectid))
81+
ts.Variables.port, objectid),
82+
uds_path=ts.Variables.uds_path)
7983
tr.Processes.Default.ReturnCode = 0
8084
tr.Processes.Default.Streams.All = "gold/hit_default-1.gold"
8185

8286
# Second touch is a HIT for generation1.
8387
tr = Test.AddTestRun()
8488
tr.MakeCurlCommand(
8589
'"http://127.0.0.1:{0}/generation1/cache/10/{1}" -H "x-debug: x-cache,x-cache-key,via,x-cache-generation" --verbose'.format(
86-
ts.Variables.port, objectid))
90+
ts.Variables.port, objectid),
91+
uds_path=ts.Variables.uds_path)
8792
tr.Processes.Default.ReturnCode = 0
8893
tr.Processes.Default.Streams.All = "gold/hit_gen1.gold"
8994

9095
# Second touch is a HIT for generation2.
9196
tr = Test.AddTestRun()
9297
tr.MakeCurlCommand(
9398
'"http://127.0.0.1:{0}/generation2/cache/10/{1}" -H "x-debug: x-cache,x-cache-key,via,x-cache-generation" --verbose'.format(
94-
ts.Variables.port, objectid))
99+
ts.Variables.port, objectid),
100+
uds_path=ts.Variables.uds_path)
95101
tr.Processes.Default.ReturnCode = 0
96102
tr.Processes.Default.Streams.All = "gold/hit_gen2.gold"

tests/gold_tests/cache/disjoint-wait-for-cache.test.py

+12-6
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@
5353
tr = Test.AddTestRun()
5454
tr.MakeCurlCommand(
5555
'"http://127.0.0.1:{0}/default/cache/10/{1}" -H "x-debug: x-cache,x-cache-key,via,x-cache-generation" --verbose'.format(
56-
ts.Variables.port, objectid))
56+
ts.Variables.port, objectid),
57+
uds_path=ts.Variables.uds_path)
5758
tr.Processes.Default.ReturnCode = 0
5859
tr.Processes.Default.StartBefore(Test.Processes.ts)
5960
tr.Processes.Default.Streams.All = "gold/miss_default-1.gold"
@@ -62,38 +63,43 @@
6263
tr = Test.AddTestRun()
6364
tr.MakeCurlCommand(
6465
'"http://127.0.0.1:{0}/generation1/cache/10/{1}" -H "x-debug: x-cache,x-cache-key,via,x-cache-generation" --verbose -o /dev/null'
65-
.format(ts.Variables.port, objectid))
66+
.format(ts.Variables.port, objectid),
67+
uds_path=ts.Variables.uds_path)
6668
tr.Processes.Default.ReturnCode = 0
6769
tr.Processes.Default.Streams.All = "gold/miss_gen1.gold"
6870

6971
# Same URL in generation 2 is still a MISS.
7072
tr = Test.AddTestRun()
7173
tr.MakeCurlCommand(
7274
'"http://127.0.0.1:{0}/generation2/cache/10/{1}" -H "x-debug: x-cache,x-cache-key,via,x-cache-generation" --verbose -o /dev/null'
73-
.format(ts.Variables.port, objectid))
75+
.format(ts.Variables.port, objectid),
76+
uds_path=ts.Variables.uds_path)
7477
tr.Processes.Default.ReturnCode = 0
7578
tr.Processes.Default.Streams.All = "gold/miss_gen2.gold"
7679

7780
# Second touch is a HIT for default.
7881
tr = Test.AddTestRun()
7982
tr.MakeCurlCommand(
8083
'"http://127.0.0.1:{0}/default/cache/10/{1}" -H "x-debug: x-cache,x-cache-key,via,x-cache-generation" --verbose -o /dev/null'
81-
.format(ts.Variables.port, objectid))
84+
.format(ts.Variables.port, objectid),
85+
uds_path=ts.Variables.uds_path)
8286
tr.Processes.Default.ReturnCode = 0
8387
tr.Processes.Default.Streams.All = "gold/hit_default-1.gold"
8488

8589
# Second touch is a HIT for generation1.
8690
tr = Test.AddTestRun()
8791
tr.MakeCurlCommand(
8892
'"http://127.0.0.1:{0}/generation1/cache/10/{1}" -H "x-debug: x-cache,x-cache-key,via,x-cache-generation" --verbose -o /dev/null'
89-
.format(ts.Variables.port, objectid))
93+
.format(ts.Variables.port, objectid),
94+
uds_path=ts.Variables.uds_path)
9095
tr.Processes.Default.ReturnCode = 0
9196
tr.Processes.Default.Streams.All = "gold/hit_gen1.gold"
9297

9398
# Second touch is a HIT for generation2.
9499
tr = Test.AddTestRun()
95100
tr.MakeCurlCommand(
96101
'"http://127.0.0.1:{0}/generation2/cache/10/{1}" -H "x-debug: x-cache,x-cache-key,via,x-cache-generation" --verbose -o /dev/null'
97-
.format(ts.Variables.port, objectid))
102+
.format(ts.Variables.port, objectid),
103+
uds_path=ts.Variables.uds_path)
98104
tr.Processes.Default.ReturnCode = 0
99105
tr.Processes.Default.Streams.All = "gold/hit_gen2.gold"

tests/gold_tests/chunked_encoding/bad_chunked_encoding.test.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
tr.TimeOut = 5
5252
tr.MakeCurlCommand(
5353
'-H "host: example.com" -H "transfer-encoding: gzip" -d "stuff" http://127.0.0.1:{0}/case1 --verbose'.format(
54-
ts.Variables.port))
54+
ts.Variables.port),
55+
uds_path=ts.Variables.uds_path)
5556
tr.Processes.Default.ReturnCode = 0
5657
tr.Processes.Default.StartBefore(server)
5758
tr.Processes.Default.StartBefore(ts)
@@ -65,7 +66,8 @@
6566
tr.TimeOut = 5
6667
tr.MakeCurlCommand(
6768
'-H "host: example.com" -H "transfer-encoding: gzip" -H "transfer-encoding: chunked" -d "stuff" http://127.0.0.1:{0}/case1 --verbose'
68-
.format(ts.Variables.port))
69+
.format(ts.Variables.port),
70+
uds_path=ts.Variables.uds_path)
6971
tr.Processes.Default.ReturnCode = 0
7072
tr.Processes.Default.Streams.All = Testers.ContainsExpression("501 Field not implemented", "Should fail")
7173
tr.Processes.Default.Streams.All = Testers.ExcludesExpression("200 OK", "Should not succeed")

tests/gold_tests/connect/connect.test.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,16 @@ def __checkProcessAfter(self, tr):
8484
def __testCase0(self):
8585
tr = Test.AddTestRun()
8686
self.__checkProcessBefore(tr)
87-
tr.MakeCurlCommand(f"-v --fail -s -p -x 127.0.0.1:{self.ts.Variables.port} 'http://foo.com/get'")
88-
tr.Processes.Default.ReturnCode = 0
8987
if Condition.CurlUsingUnixDomainSocket():
88+
tr.MakeCurlCommand(
89+
f"-v --fail -s -X CONNECT -p -x 127.0.0.1:{self.ts.Variables.port} 'http://foo.com/get'",
90+
uds_path=self.ts.Variables.uds_path)
9091
tr.Processes.Default.Streams.stderr = "gold/connect_0_stderr_uds.gold"
9192
else:
93+
tr.MakeCurlCommand(
94+
f"-v --fail -s -p -x 127.0.0.1:{self.ts.Variables.port} 'http://foo.com/get'", uds_path=self.ts.Variables.uds_path)
9295
tr.Processes.Default.Streams.stderr = "gold/connect_0_stderr.gold"
96+
tr.Processes.Default.ReturnCode = 0
9397
tr.Processes.Default.TimeOut = 3
9498
self.__checkProcessAfter(tr)
9599

tests/gold_tests/continuations/double.test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
# Create a bunch of curl commands to be executed in parallel. Default.Process is set in SpawnCurlCommands.
6969
# On Fedora 28/29, it seems that curl will occasionally timeout after a couple seconds and return exitcode 2
7070
# Examining the packet capture shows that Traffic Server dutifully sends the response
71-
ps = tr.SpawnCurlCommands(cmdstr=cmd, count=numberOfRequests, retcode=Any(0, 2))
71+
ps = tr.SpawnCurlCommands(cmdstr=cmd, count=numberOfRequests, retcode=Any(0, 2), uds_path=ts.Variables.uds_path)
7272
tr.Processes.Default.Env = ts.Env
7373
tr.Processes.Default.ReturnCode = Any(0, 2)
7474

tests/gold_tests/continuations/session_id.test.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@
9797

9898
def verify_session_count(output):
9999
global numberOfRequests
100-
nReq = numberOfRequests * 2
100+
if Condition.CurlUsingUnixDomainSocket():
101+
nReq = numberOfRequests
102+
else:
103+
nReq = numberOfRequests * 2
101104
session_ids = [line[0:line.find("\n")] for line in str(output).split("session id: ")[1:]]
102105
if len(session_ids) != nReq:
103106
return "Found {} session_id's, expected {}".format(len(session_ids), nReq)

tests/gold_tests/cripts/cripts.test.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ def setUpTS(self):
5959

6060
def runHeaderTest(self):
6161
tr = Test.AddTestRun()
62-
tr.MakeCurlCommand('-v -H "Host: www.example.com" http://127.0.0.1:{0}'.format(self.ts.Variables.port))
62+
tr.MakeCurlCommand(
63+
'-v -H "Host: www.example.com" http://127.0.0.1:{0}'.format(self.ts.Variables.port),
64+
uds_path=self.ts.Variables.uds_path)
6365
tr.Processes.Default.ReturnCode = 0
6466
tr.Processes.Default.StartBefore(self.server, ready=When.PortOpen(self.server.Variables.Port))
6567
tr.Processes.Default.StartBefore(self.ts)

tests/gold_tests/dns/splitdns.test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def setupTS(self):
5050

5151
def addTestCase0(self):
5252
tr = Test.AddTestRun()
53-
tr.MakeCurlCommand(f"-v http://localhost:{self.ts.Variables.port}/foo/")
53+
tr.MakeCurlCommand(f"-v http://localhost:{self.ts.Variables.port}/foo/", uds_path=self.ts.Variables.uds_path)
5454
tr.Processes.Default.ReturnCode = 0
5555
tr.Processes.Default.Streams.stderr = "gold/test_case_0_stderr.gold"
5656
tr.Processes.Default.StartBefore(self.dns)
@@ -62,7 +62,7 @@ def addTestCase0(self):
6262

6363
def addTestCase1(self):
6464
tr = Test.AddTestRun()
65-
tr.MakeCurlCommand(f"-v http://localhost:{self.ts.Variables.port}/bar/")
65+
tr.MakeCurlCommand(f"-v http://localhost:{self.ts.Variables.port}/bar/", uds_path=self.ts.Variables.uds_path)
6666
tr.Processes.Default.ReturnCode = 0
6767
tr.Processes.Default.Streams.stderr = "gold/test_case_1_stderr.gold"
6868
tr.StillRunningAfter = self.dns

tests/gold_tests/early_hints/early_hints.test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def _configure_client(self, tr: 'TestRun'):
136136
f'--resolve "server.com:{ts_port}:127.0.0.1" '
137137
f'-H "Host: server.com" '
138138
f'{scheme}://server.com:{ts_port}/{self._protocol_str}',
139-
uds_path=ts.Variables.uds_path)
139+
uds_path=self._ts.Variables.uds_path)
140140

141141
client.ReturnCode = 0
142142
self._ts.StartBefore(self._dns)

tests/gold_tests/headers/good_request_after_bad.test.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,15 @@
123123
tr = Test.AddTestRun("Trace request with a chunked body via curl")
124124
tr.MakeCurlCommand(
125125
'-v --http1.1 --header "Transfer-Encoding: chunked" -d aaa -X TRACE -o trace_curl.txt -k http://127.0.0.1:{}/foo'.format(
126-
ts.Variables.port))
126+
ts.Variables.port),
127+
uds_path=ts.Variables.uds_path)
127128
tr.Processes.Default.ReturnCode = 0
128129
tr.Processes.Default.Streams.All = 'gold/bad_good_request_header.gold'
129130
trace_out.Content = Testers.ContainsExpression("<TITLE>Bad Request</TITLE>", "ATS error msg")
130131
trace_out.Content += Testers.ContainsExpression("Description: Could not process this request.", "ATS error msg")
131132

132133
tr = Test.AddTestRun("Trace request via curl")
133-
tr.MakeCurlCommand('-v --http1.1 -X TRACE -k http://127.0.0.1:{}/bar'.format(ts.Variables.port))
134+
tr.MakeCurlCommand('-v --http1.1 -X TRACE -k http://127.0.0.1:{}/bar'.format(ts.Variables.port), uds_path=ts.Variables.uds_path)
134135
tr.Processes.Default.ReturnCode = 0
135136
tr.Processes.Default.Streams.All = Testers.ContainsExpression(
136137
r"HTTP/1.1 501 Unsupported method \('TRACE'\)", "microserver does not support TRACE")

tests/gold_tests/headers/range.test.py

+12-11
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def curl_range(ts, path="", ifrange=None, start=1, end=5):
135135

136136
# ATS should ignore the Range header when given an If-Range header with the incorrect etag
137137
tr = Test.AddTestRun()
138-
tr.MakeCurlCommand(curl_range(ts, ifrange='"should-not-match"'))
138+
tr.MakeCurlCommand(curl_range(ts, ifrange='"should-not-match"'), uds_path=ts.Variables.uds_path)
139139
tr.Processes.Default.ReturnCode = 0
140140
tr.Processes.Default.StartBefore(microserver, ready=When.PortOpen(microserver.Variables.Port))
141141
tr.Processes.Default.StartBefore(origin, ready=When.PortOpen(origin.Variables.port))
@@ -147,66 +147,67 @@ def curl_range(ts, path="", ifrange=None, start=1, end=5):
147147

148148
# ATS should respond to Range requests with partial content
149149
tr = Test.AddTestRun()
150-
tr.MakeCurlCommand(curl_range(ts))
150+
tr.MakeCurlCommand(curl_range(ts), uds_path=ts.Variables.uds_path)
151151
tr.Processes.Default.ReturnCode = 0
152152
tr.Processes.Default.Streams.stdout = "gold/range-206.gold"
153153

154154
# ATS should respond to Range requests with partial content when given an If-Range header with
155155
# the correct etag
156156
tr = Test.AddTestRun()
157-
tr.MakeCurlCommand(curl_range(ts, ifrange='"range"'))
157+
tr.MakeCurlCommand(curl_range(ts, ifrange='"range"'), uds_path=ts.Variables.uds_path)
158158
tr.Processes.Default.ReturnCode = 0
159159
tr.Processes.Default.Streams.stdout = "gold/range-206.gold"
160160

161161
# ATS should respond to Range requests with partial content when given an If-Range header
162162
# that matches the Last-Modified header of the cached response
163163
tr = Test.AddTestRun()
164-
tr.MakeCurlCommand(curl_range(ts, ifrange="Thu, 10 Feb 2022 00:00:00 GMT"))
164+
tr.MakeCurlCommand(curl_range(ts, ifrange="Thu, 10 Feb 2022 00:00:00 GMT"), uds_path=ts.Variables.uds_path)
165165
tr.Processes.Default.ReturnCode = 0
166166
tr.Processes.Default.Streams.stdout = "gold/range-206.gold"
167167

168168
# ATS should respond to Range requests with the full content when given an If-Range header
169169
# that doesn't match the Last-Modified header of the cached response
170170
tr = Test.AddTestRun()
171-
tr.MakeCurlCommand(curl_range(ts, ifrange="Thu, 10 Feb 2022 01:00:00 GMT"))
171+
tr.MakeCurlCommand(curl_range(ts, ifrange="Thu, 10 Feb 2022 01:00:00 GMT"), uds_path=ts.Variables.uds_path)
172172
tr.Processes.Default.ReturnCode = 0
173173
tr.Processes.Default.Streams.stdout = "gold/range-200.gold"
174174

175175
# ATS should respond to Range requests with a 416 error code when the given Range is invalid
176176
tr = Test.AddTestRun()
177-
tr.MakeCurlCommand(curl_range(ts, start=100, end=105))
177+
tr.MakeCurlCommand(curl_range(ts, start=100, end=105), uds_path=ts.Variables.uds_path)
178178
tr.Processes.Default.ReturnCode = 0
179179
tr.Processes.Default.Streams.stdout = "gold/range-416.gold"
180180

181181
# ATS should ignore the Range header when given an If-Range header with the incorrect etag
182182
tr = Test.AddTestRun()
183-
tr.MakeCurlCommand(curl_range(ts, ifrange='"should-not-match"'))
183+
tr.MakeCurlCommand(curl_range(ts, ifrange='"should-not-match"'), uds_path=ts.Variables.uds_path)
184184
tr.Processes.Default.ReturnCode = 0
185185
tr.Processes.Default.Streams.stdout = "gold/range-200.gold"
186186

187187
# ATS should ignore the Range header when given an If-Range header with weak etags
188188
tr = Test.AddTestRun()
189-
tr.MakeCurlCommand(curl_range(ts, ifrange='W/"range"'))
189+
tr.MakeCurlCommand(curl_range(ts, ifrange='W/"range"'), uds_path=ts.Variables.uds_path)
190190
tr.Processes.Default.ReturnCode = 0
191191
tr.Processes.Default.Streams.stdout = "gold/range-200.gold"
192192

193193
# ATS should ignore the Range header when given an If-Range header with a date older than the
194194
# Last-Modified header of the cached response
195195
tr = Test.AddTestRun()
196-
tr.MakeCurlCommand(curl_range(ts, ifrange="Wed, 09 Feb 2022 23:00:00 GMT"))
196+
tr.MakeCurlCommand(curl_range(ts, ifrange="Wed, 09 Feb 2022 23:00:00 GMT"), uds_path=ts.Variables.uds_path)
197197
tr.Processes.Default.ReturnCode = 0
198198
tr.Processes.Default.Streams.stdout = "gold/range-200.gold"
199199

200200
# Write to the cache by requesting the entire content
201201
tr = Test.AddTestRun()
202-
tr.MakeCurlCommand(curl_whole(ts, path="short"))
202+
tr.MakeCurlCommand(curl_whole(ts, path="short"), uds_path=ts.Variables.uds_path)
203203
tr.Processes.Default.ReturnCode = 0
204204
tr.Processes.Default.Streams.stdout = "gold/range-200.gold"
205205

206206
# ATS should respond to range requests with partial content for stale caches in response to
207207
# valid If-Range requests if the origin responds with 304 Not Modified.
208208
tr = Test.AddTestRun()
209-
tr.MakeCurlCommandMulti(f"sleep {2 * CACHE_SHORT_MAXAGE}; {{curl}} " + curl_range(ts, path="short", ifrange='"range"'))
209+
tr.MakeCurlCommandMulti(
210+
f"sleep {2 * CACHE_SHORT_MAXAGE}; {{curl}} " + curl_range(ts, path="short", ifrange='"range"'), uds_path=ts.Variables.uds_path)
210211
tr.Processes.Default.ReturnCode = 0
211212
tr.Processes.Default.Streams.stdout = "gold/range-206-revalidated.gold"
212213

0 commit comments

Comments
 (0)