From e2bf8a7de363ef5e3888c1d93b710b9ce42d3d40 Mon Sep 17 00:00:00 2001 From: Susan Hinrichs Date: Wed, 27 May 2020 00:58:01 +0000 Subject: [PATCH] Make chunked encoding test more resilient --- tests/gold_tests/chunked_encoding/case4.sh | 2 +- tests/gold_tests/chunked_encoding/chunked_encoding.test.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/gold_tests/chunked_encoding/case4.sh b/tests/gold_tests/chunked_encoding/case4.sh index 582b8064d9a..b6637156a67 100644 --- a/tests/gold_tests/chunked_encoding/case4.sh +++ b/tests/gold_tests/chunked_encoding/case4.sh @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -nc -l 8888 -o outserver4 -c "sh ./server4.sh" & +nc -l ${2} -o outserver4 -c "sh ./server4.sh" & sleep 1 ./smuggle-client 127.0.0.1 ${1} kill %1 diff --git a/tests/gold_tests/chunked_encoding/chunked_encoding.test.py b/tests/gold_tests/chunked_encoding/chunked_encoding.test.py index 60cd4dc6198..fdea2517d88 100644 --- a/tests/gold_tests/chunked_encoding/chunked_encoding.test.py +++ b/tests/gold_tests/chunked_encoding/chunked_encoding.test.py @@ -25,6 +25,8 @@ ) Test.ContinueOnFail = True +Test.GetTcpPort("upstream_port") + # Define default ATS ts = Test.MakeATSProcess("ts", select_ports=True, enable_tls=True) server = Test.MakeOriginServer("server") @@ -81,7 +83,7 @@ 'map https://www.anotherexample.com https://127.0.0.1:{0}'.format(server2.Variables.SSL_Port, ts.Variables.ssl_port) ) ts.Disk.remap_config.AddLine( - 'map / http://127.0.0.1:8888' + 'map / http://127.0.0.1:{0}'.format(Test.Variables.upstream_port) ) ts.Disk.ssl_multicert_config.AddLine( @@ -144,7 +146,7 @@ tr.TimeOut = 5 tr.Setup.Copy('server4.sh') tr.Setup.Copy('case4.sh') -tr.Processes.Default.Command = 'sh ./case4.sh {0}'.format(ts.Variables.ssl_port) +tr.Processes.Default.Command = 'sh ./case4.sh {0} {1}'.format(ts.Variables.ssl_port, Test.Variables.upstream_port) tr.Processes.Default.ReturnCode = 0 tr.Processes.Default.Streams.All = Testers.ExcludesExpression("content-length:", "Response should not include content length") # Transfer encoding to origin, but no content-length