diff --git a/tests/gold_tests/body_factory/gold/http-204-custom-plugin.gold b/tests/gold_tests/body_factory/gold/http-204-custom-plugin.gold index cab77b6aeb2..b17ae60b331 100644 --- a/tests/gold_tests/body_factory/gold/http-204-custom-plugin.gold +++ b/tests/gold_tests/body_factory/gold/http-204-custom-plugin.gold @@ -1,5 +1,7 @@ HTTP/1.1 204 No Content +`` Connection: keep-alive +`` Cache-Control: no-store Content-Length: 282 Content-Type: text/html @@ -16,4 +18,4 @@ Content-Type: text/html Description: According to rfc7231 I should not have been sent to you!
This response was sent via the custom204plugin via a call to TSHttpTxnErrorBodySet.
- + \ No newline at end of file diff --git a/tests/gold_tests/body_factory/gold/http-204-custom.gold b/tests/gold_tests/body_factory/gold/http-204-custom.gold index fb84d9b7f05..a4f3ee12615 100644 --- a/tests/gold_tests/body_factory/gold/http-204-custom.gold +++ b/tests/gold_tests/body_factory/gold/http-204-custom.gold @@ -1,5 +1,7 @@ HTTP/1.1 204 No Content +`` Connection: keep-alive +`` Cache-Control: no-store Content-Type: text/html Content-Language: en diff --git a/tests/gold_tests/body_factory/gold/http-204.gold b/tests/gold_tests/body_factory/gold/http-204.gold index 29312022b09..b85e439e58a 100644 --- a/tests/gold_tests/body_factory/gold/http-204.gold +++ b/tests/gold_tests/body_factory/gold/http-204.gold @@ -1,4 +1,6 @@ HTTP/1.1 204 No Content +Date: `` Connection: keep-alive +Server: ATS/`` Cache-Control: no-store diff --git a/tests/gold_tests/body_factory/gold/http-304.gold b/tests/gold_tests/body_factory/gold/http-304.gold index 1931f8b2533..9e01f77f2a1 100644 --- a/tests/gold_tests/body_factory/gold/http-304.gold +++ b/tests/gold_tests/body_factory/gold/http-304.gold @@ -1,4 +1,6 @@ HTTP/1.1 304 Not Modified +`` Connection: keep-alive +`` Cache-Control: no-store diff --git a/tests/gold_tests/body_factory/gold/http-get-200.gold b/tests/gold_tests/body_factory/gold/http-get-200.gold index c610ba31b03..d3ede346468 100644 --- a/tests/gold_tests/body_factory/gold/http-get-200.gold +++ b/tests/gold_tests/body_factory/gold/http-get-200.gold @@ -3,4 +3,4 @@ HTTP/1.1 200 OK Content-Length: 47 `` -This body should be returned for a GET request. +This body should be returned for a GET request. \ No newline at end of file diff --git a/tests/gold_tests/body_factory/gold/http-get-304.gold b/tests/gold_tests/body_factory/gold/http-get-304.gold index d1ad0e17192..cabd289562c 100644 --- a/tests/gold_tests/body_factory/gold/http-get-304.gold +++ b/tests/gold_tests/body_factory/gold/http-get-304.gold @@ -1,4 +1,4 @@ HTTP/1.1 304 Not Modified `` -Warning: 199 VERSION Proxy received unexpected 304 response; content may be stale +Warning: 199 `` Proxy received unexpected 304 response; content may be stale `` diff --git a/tests/gold_tests/body_factory/gold/http-head-no-origin.gold b/tests/gold_tests/body_factory/gold/http-head-no-origin.gold index 6e1d0fd1586..157ee91e03e 100644 --- a/tests/gold_tests/body_factory/gold/http-head-no-origin.gold +++ b/tests/gold_tests/body_factory/gold/http-head-no-origin.gold @@ -1,5 +1,7 @@ HTTP/1.1 404 Not Found +`` Connection: keep-alive +`` Cache-Control: no-store Content-Type: text/html Content-Language: en diff --git a/tests/gold_tests/body_factory/http204_response.test.py b/tests/gold_tests/body_factory/http204_response.test.py index 34e531b188f..5d1147e9561 100644 --- a/tests/gold_tests/body_factory/http204_response.test.py +++ b/tests/gold_tests/body_factory/http204_response.test.py @@ -18,6 +18,7 @@ # limitations under the License. import os +import sys Test.Summary = ''' Tests that 204 responses conform to rfc2616, unless custom templates override. @@ -76,18 +77,16 @@ defaultTr.Processes.Default.StartBefore(Test.Processes.ts) defaultTr.StillRunningAfter = ts -defaultTr.Processes.Default.Command = "python3 tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/'".\ - format(ts.Variables.port, 'data/{0}_get.txt'.format(DEFAULT_204_HOST)) +defaultTr.Processes.Default.Command = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{DEFAULT_204_HOST}_get.txt" defaultTr.Processes.Default.TimeOut = 5 # seconds defaultTr.Processes.Default.ReturnCode = 0 defaultTr.Processes.Default.Streams.stdout = "gold/http-204.gold" -customTemplateTr = Test.AddTestRun("Test domain {0}".format(CUSTOM_TEMPLATE_204_HOST)) +customTemplateTr = Test.AddTestRun(f"Test domain {CUSTOM_TEMPLATE_204_HOST}") customTemplateTr.StillRunningBefore = ts customTemplateTr.StillRunningAfter = ts -customTemplateTr.Processes.Default.Command = "python3 tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/'".\ - format(ts.Variables.port, 'data/{0}_get.txt'.format(CUSTOM_TEMPLATE_204_HOST)) +customTemplateTr.Processes.Default.Command = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{CUSTOM_TEMPLATE_204_HOST}_get.txt" customTemplateTr.Processes.Default.TimeOut = 5 # seconds customTemplateTr.Processes.Default.ReturnCode = 0 customTemplateTr.Processes.Default.Streams.stdout = "gold/http-204-custom.gold" diff --git a/tests/gold_tests/body_factory/http204_response_plugin.test.py b/tests/gold_tests/body_factory/http204_response_plugin.test.py index 31e1b114f9d..cc4ca6614d1 100644 --- a/tests/gold_tests/body_factory/http204_response_plugin.test.py +++ b/tests/gold_tests/body_factory/http204_response_plugin.test.py @@ -18,6 +18,7 @@ # limitations under the License. import os +import sys Test.Summary = ''' Tests that plugins may break HTTP by sending 204 respose bodies @@ -31,9 +32,7 @@ regex_remap_conf_file = "maps.reg" ts.Disk.remap_config.AddLine( - 'map http://{0} http://127.0.0.1:{1} @plugin=regex_remap.so @pparam={2} @pparam=no-query-string @pparam=host' - .format(CUSTOM_PLUGIN_204_HOST, server.Variables.Port, - regex_remap_conf_file) + f'map http://{CUSTOM_PLUGIN_204_HOST} http://127.0.0.1:{server.Variables.Port} @plugin=regex_remap.so @pparam={regex_remap_conf_file} @pparam=no-query-string @pparam=host' ) ts.Disk.MakeConfigFile(regex_remap_conf_file).AddLine('//.*/ http://donotcare.test @status=204') @@ -46,8 +45,7 @@ tr.Processes.Default.StartBefore(Test.Processes.ts) tr.StillRunningAfter = ts -tr.Processes.Default.Command = "python3 tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/'".\ - format(ts.Variables.port, 'data/{0}_get.txt'.format(CUSTOM_PLUGIN_204_HOST)) +tr.Processes.Default.Command = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{CUSTOM_PLUGIN_204_HOST}_get.txt" tr.Processes.Default.TimeOut = 5 # seconds tr.Processes.Default.ReturnCode = 0 tr.Processes.Default.Streams.stdout = "gold/http-204-custom-plugin.gold" diff --git a/tests/gold_tests/body_factory/http304_response.test.py b/tests/gold_tests/body_factory/http304_response.test.py index 79e0e8c648b..7baa4b424e2 100644 --- a/tests/gold_tests/body_factory/http304_response.test.py +++ b/tests/gold_tests/body_factory/http304_response.test.py @@ -18,6 +18,7 @@ # limitations under the License. import os +import sys Test.Summary = ''' Tests 304 responses @@ -43,12 +44,12 @@ Test.Setup.Copy(os.path.join(os.pardir, os.pardir, 'tools', 'tcp_client.py')) Test.Setup.Copy('data') -tr = Test.AddTestRun("Test domain {0}".format(DEFAULT_304_HOST)) +tr = Test.AddTestRun(f"Test domain {DEFAULT_304_HOST}") tr.Processes.Default.StartBefore(Test.Processes.ts) tr.StillRunningAfter = ts -cmd_tpl = r"python3 tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/' | sed 's;ApacheTrafficServer\/[^ ]*;VERSION;'" -tr.Processes.Default.Command = cmd_tpl.format(ts.Variables.port, 'data/{0}_get.txt'.format(DEFAULT_304_HOST)) +cmd_tpl = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{DEFAULT_304_HOST}_get.txt" +tr.Processes.Default.Command = cmd_tpl tr.Processes.Default.TimeOut = 5 # seconds tr.Processes.Default.ReturnCode = 0 tr.Processes.Default.Streams.stdout = "gold/http-304.gold" diff --git a/tests/gold_tests/body_factory/http_head_no_origin.test.py b/tests/gold_tests/body_factory/http_head_no_origin.test.py index 92a4a6c60a8..097c4761095 100644 --- a/tests/gold_tests/body_factory/http_head_no_origin.test.py +++ b/tests/gold_tests/body_factory/http_head_no_origin.test.py @@ -18,6 +18,7 @@ # limitations under the License. import os +import sys Test.Summary = ''' Tests that HEAD requests return proper responses when origin fails @@ -36,8 +37,7 @@ tr.Processes.Default.StartBefore(Test.Processes.ts) tr.StillRunningAfter = ts -tr.Processes.Default.Command = "python3 tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/'".\ - format(ts.Variables.port, 'data/{0}_head.txt'.format(HOST)) +tr.Processes.Default.Command = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{HOST}_head.txt" tr.Processes.Default.TimeOut = 5 # seconds tr.Processes.Default.ReturnCode = 0 tr.Processes.Default.Streams.stdout = "gold/http-head-no-origin.gold" diff --git a/tests/gold_tests/body_factory/http_with_origin.test.py b/tests/gold_tests/body_factory/http_with_origin.test.py index 7d418c4f396..24f833e03f4 100644 --- a/tests/gold_tests/body_factory/http_with_origin.test.py +++ b/tests/gold_tests/body_factory/http_with_origin.test.py @@ -18,6 +18,7 @@ # limitations under the License. import os +import sys Test.Summary = ''' Tests that HEAD requests return proper responses @@ -73,8 +74,7 @@ trhead200.StillRunningAfter = ts trhead200.StillRunningAfter = server -trhead200.Processes.Default.Command = "python3 tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/'".\ - format(ts.Variables.port, 'data/{0}_head_200.txt'.format(HOST)) +trhead200.Processes.Default.Command = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{HOST}_head_200.txt" trhead200.Processes.Default.TimeOut = 5 # seconds trhead200.Processes.Default.ReturnCode = 0 trhead200.Processes.Default.Streams.stdout = "gold/http-head-200.gold" @@ -86,8 +86,7 @@ trget200.StillRunningAfter = ts trget200.StillRunningAfter = server -trget200.Processes.Default.Command = "python3 tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/'".\ - format(ts.Variables.port, 'data/{0}_get_200.txt'.format(HOST)) +trget200.Processes.Default.Command = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{HOST}_get_200.txt" trget200.Processes.Default.TimeOut = 5 # seconds trget200.Processes.Default.ReturnCode = 0 trget200.Processes.Default.Streams.stdout = "gold/http-get-200.gold" @@ -99,8 +98,8 @@ trget304.StillRunningAfter = ts trget304.StillRunningAfter = server -cmd_tpl = r"python3 tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/' | sed 's;ApacheTrafficServer\/[^ ]*;VERSION;'" -trget304.Processes.Default.Command = cmd_tpl.format(ts.Variables.port, 'data/{0}_get_304.txt'.format(HOST)) +cmd_tpl = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{HOST}_get_304.txt" +trget304.Processes.Default.Command = cmd_tpl trget304.Processes.Default.TimeOut = 5 # seconds trget304.Processes.Default.ReturnCode = 0 trget304.Processes.Default.Streams.stdout = "gold/http-get-304.gold"