You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2022/02/04 17:27:23 UTC
[trafficserver] 01/03: Stablize trace curl test in good_request_after_bad (#8032)
This is an automated email from the ASF dual-hosted git repository.
zwoop pushed a commit to branch 9.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 291d5ab7029777eda864fc4336db461c6dcebe79
Author: Susan Hinrichs <sh...@verizonmedia.com>
AuthorDate: Fri Jul 2 10:05:59 2021 -0500
Stablize trace curl test in good_request_after_bad (#8032)
(cherry picked from commit f8be9dc28518ff6a8c150e377c497c7883e93a0b)
---
tests/gold_tests/headers/gold/bad_good_request_header.gold | 5 +++++
tests/gold_tests/headers/good_request_after_bad.test.py | 8 ++++++--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/tests/gold_tests/headers/gold/bad_good_request_header.gold b/tests/gold_tests/headers/gold/bad_good_request_header.gold
new file mode 100644
index 0000000..fecd2a2
--- /dev/null
+++ b/tests/gold_tests/headers/gold/bad_good_request_header.gold
@@ -0,0 +1,5 @@
+``HTTP/1.1 400 Invalid HTTP Request
+``Connection: close
+``Server: ATS/``
+``Content-Length: 219
+``
diff --git a/tests/gold_tests/headers/good_request_after_bad.test.py b/tests/gold_tests/headers/good_request_after_bad.test.py
index 27d4e65..63d55fa 100644
--- a/tests/gold_tests/headers/good_request_after_bad.test.py
+++ b/tests/gold_tests/headers/good_request_after_bad.test.py
@@ -42,6 +42,8 @@ ts.Disk.remap_config.AddLine(
'map / http://127.0.0.1:{0}'.format(server.Variables.Port)
)
+trace_out = Test.Disk.File("trace_curl.txt")
+
# Make a good request to get item in the cache for later tests
tr = Test.AddTestRun("Good control")
tr.Processes.Default.StartBefore(server)
@@ -81,10 +83,12 @@ tr.Processes.Default.ReturnCode = 0
tr.Processes.Default.Streams.stdout = 'gold/bad_good_request.gold'
tr = Test.AddTestRun("Trace request with a chunked body via curl")
-tr.Processes.Default.Command = 'curl -v --http1.1 --header "Transfer-Encoding: chunked" -d aaa -X TRACE -k http://127.0.0.1:{}/foo'.format(
+tr.Processes.Default.Command = 'curl -v --http1.1 --header "Transfer-Encoding: chunked" -d aaa -X TRACE -o trace_curl.txt -k http://127.0.0.1:{}/foo'.format(
ts.Variables.port)
tr.Processes.Default.ReturnCode = 0
-tr.Processes.Default.Streams.All = 'gold/bad_good_request.gold'
+tr.Processes.Default.Streams.All = 'gold/bad_good_request_header.gold'
+trace_out.Content = Testers.ContainsExpression("<TITLE>Bad Request</TITLE>", "ATS error msg")
+trace_out.Content += Testers.ContainsExpression("Description: Could not process this request.", "ATS error msg")
tr = Test.AddTestRun("Trace request via curl")
tr.Processes.Default.Command = 'curl -v --http1.1 -X TRACE -k http://127.0.0.1:{}/bar'.format(ts.Variables.port)