Skip to content

Commit f454a3b

Browse files
author
Serris Lew
committed
Add ts runtimedir path, update existing autest for uds case instead of adding new autest
1 parent 4f35a44 commit f454a3b

File tree

174 files changed

+1005
-4177
lines changed

Some content is hidden

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

174 files changed

+1005
-4177
lines changed

tests/CMakeLists.txt

+1-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
@@ -59,7 +60,6 @@ else()
5960
DESTINATION ${CMAKE_GOLD_DIR}
6061
FILES_MATCHING
6162
PATTERN "*"
62-
PATTERN "*_uds.test.py" EXCLUDE
6363
)
6464
add_subdirectory(gold_tests_filtered/tls)
6565
endif()

tests/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ ts=Test.MakeATSProcess("ts")
132132
#first test is a miss for default
133133
tr=Test.AddTestRun()
134134
# get port for command from Variables
135-
tr.MakeCurlCommand('"http://127.0.0.1:{0}" --verbose'.format(ts.Variables.port))
135+
tr.MakeCurlCommand('"http://127.0.0.1:{0}" --verbose'.format(ts.Variables.port), uds_path=ts.Variables.uds_path)
136136

137137
```
138138

tests/gold_tests/autest-site/conditions.test.ext

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def PluginExists(self, pluginname):
110110
return self.Condition(lambda: os.path.isfile(path), path + " not found.")
111111

112112

113-
def CurlUds(self):
113+
def CurlUsingUnixDomainSocket(self):
114114
return self.Condition(lambda: self.Variables.get("CurlUds", False), "Curl using UDS. Not relevant for test")
115115

116116

@@ -123,4 +123,4 @@ ExtendCondition(HasCurlVersion)
123123
ExtendCondition(HasCurlFeature)
124124
ExtendCondition(HasCurlOption)
125125
ExtendCondition(PluginExists)
126-
ExtendCondition(CurlUds)
126+
ExtendCondition(CurlUsingUnixDomainSocket)

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

+2-3
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,7 +38,7 @@
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))
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

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/bigobj/bigobj.test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def create_pushfile():
6464

6565

6666
ipv4flag = ""
67-
if not Condition.CurlUds():
67+
if not Condition.CurlUsingUnixDomainSocket():
6868
ipv4flag = "--ipv4"
6969

7070
tr = Test.AddTestRun("PUSH an object to the cache")
@@ -85,7 +85,7 @@ def create_pushfile():
8585
tr.Processes.Default.Streams.All = Testers.ContainsExpression("HTTP/1.1 200 OK", "Should fetch pushed object")
8686
tr.Processes.Default.Streams.All = Testers.ContainsExpression("Content-length: 102400", "Content size should be accurate")
8787

88-
if not Condition.CurlUds():
88+
if not Condition.CurlUsingUnixDomainSocket():
8989
tr = Test.AddTestRun("GET bigobj: TLS, HTTP/1.1, IPv4")
9090
tr.MakeCurlCommand(f'--verbose --ipv4 --http1.1 --insecure https://localhost:{ts.Variables.ssl_port}/bigobj')
9191
tr.Processes.Default.ReturnCode = 0

tests/gold_tests/bigobj/bigobj_uds.test.py

-112
This file was deleted.

tests/gold_tests/cache/background_fill.test.py

+12-8
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
Test.Summary = 'Exercise Background Fill'
2222
Test.SkipUnless(Condition.HasCurlFeature('http2'), Condition.HasProxyVerifierVersion('2.8.0'))
23-
Test.SkipIf(Condition.CurlUds())
2423
Test.ContinueOnFail = True
2524

2625

@@ -55,7 +54,8 @@ def __setupTS(self, ts_names=['default']):
5554

5655
self.ts[name].Disk.records_config.update(
5756
{
58-
"proxy.config.http.server_ports": f"{self.ts[name].Variables.port} {self.ts[name].Variables.ssl_port}:ssl",
57+
"proxy.config.http.server_ports":
58+
f"{self.ts[name].Variables.port} {self.ts[name].Variables.ssl_port}:ssl {self.ts[name].Variables.uds_path}",
5959
"proxy.config.http.background_fill_active_timeout": "0",
6060
"proxy.config.http.background_fill_completed_threshold": "0.0",
6161
"proxy.config.http.cache.required_headers": 0, # Force cache
@@ -113,7 +113,8 @@ def __testCase0(self):
113113
timeout 2 {{curl}} --http1.1 -vs http://127.0.0.1:{self.ts['for_httpbin'].Variables.port}/drip?duration=4;
114114
sleep 4;
115115
{{curl}} --http1.1 -vs http://127.0.0.1:{self.ts['for_httpbin'].Variables.port}/drip?duration=4
116-
""")
116+
""",
117+
uds_path=self.ts['for_httpbin'].Variables.uds_path)
117118
tr.Processes.Default.ReturnCode = 0
118119
tr.Processes.Default.Streams.stderr = Testers.Any(
119120
"gold/background_fill_0_stderr_H.gold", "gold/background_fill_0_stderr_W.gold")
@@ -131,7 +132,8 @@ def __testCase1(self):
131132
timeout 3 {{curl}} --http1.1 -vsk https://127.0.0.1:{self.ts['for_httpbin'].Variables.ssl_port}/drip?duration=4;
132133
sleep 5;
133134
{{curl}} --http1.1 -vsk https://127.0.0.1:{self.ts['for_httpbin'].Variables.ssl_port}/drip?duration=4
134-
""")
135+
""",
136+
uds_path=self.ts['for_httpbin'].Variables.uds_path)
135137
tr.Processes.Default.ReturnCode = 0
136138
tr.Processes.Default.Streams.stderr = Testers.Any(
137139
"gold/background_fill_1_stderr_H.gold", "gold/background_fill_1_stderr_W.gold")
@@ -149,7 +151,8 @@ def __testCase2(self):
149151
timeout 3 {{curl}} --http2 -vsk https://127.0.0.1:{self.ts['for_httpbin'].Variables.ssl_port}/drip?duration=4;
150152
sleep 5;
151153
{{curl}} --http2 -vsk https://127.0.0.1:{self.ts['for_httpbin'].Variables.ssl_port}/drip?duration=4
152-
""")
154+
""",
155+
uds_path=self.ts['for_httpbin'].Variables.uds_path)
153156
tr.Processes.Default.ReturnCode = 0
154157
tr.Processes.Default.Streams.stderr = Testers.Any(
155158
"gold/background_fill_2_stderr_H.gold", "gold/background_fill_2_stderr_W.gold")
@@ -173,9 +176,10 @@ def __testCase3(self):
173176

174177
def run(self):
175178
self.__testCase0()
176-
self.__testCase1()
177-
self.__testCase2()
178-
self.__testCase3()
179+
if not Condition.CurlUsingUnixDomainSocket():
180+
self.__testCase1()
181+
self.__testCase2()
182+
self.__testCase3()
179183

180184

181185
BackgroundFillTest().run()

0 commit comments

Comments
 (0)