diff --git a/tests/gold_tests/basic/deny0.test.py b/tests/gold_tests/basic/deny0.test.py index 54fbe9973ea..4cacd14d783 100644 --- a/tests/gold_tests/basic/deny0.test.py +++ b/tests/gold_tests/basic/deny0.test.py @@ -63,7 +63,7 @@ def buildMetaTest(testName, requestString): tr.Processes.Default.StartBefore(dns) with open(os.path.join(data_path, tr.Name), 'w') as f: f.write(requestString) - tr.Processes.Default.Command = "python tcp_client.py 127.0.0.1 {0} {1} | head -1".format(ts.Variables.port, os.path.join(data_dirname, tr.Name)) + tr.Processes.Default.Command = "python3 tcp_client.py 127.0.0.1 {0} {1} | head -1".format(ts.Variables.port, os.path.join(data_dirname, tr.Name)) tr.ReturnCode = 0 tr.Processes.Default.Streams.stdout = gold_filepath tr.StillRunningAfter = ts diff --git a/tests/gold_tests/body_factory/http204_response.test.py b/tests/gold_tests/body_factory/http204_response.test.py index f7f21df5f28..34e531b188f 100644 --- a/tests/gold_tests/body_factory/http204_response.test.py +++ b/tests/gold_tests/body_factory/http204_response.test.py @@ -76,7 +76,7 @@ defaultTr.Processes.Default.StartBefore(Test.Processes.ts) defaultTr.StillRunningAfter = ts -defaultTr.Processes.Default.Command = "python tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/'".\ +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.TimeOut = 5 # seconds defaultTr.Processes.Default.ReturnCode = 0 @@ -86,7 +86,7 @@ customTemplateTr = Test.AddTestRun("Test domain {0}".format(CUSTOM_TEMPLATE_204_HOST)) customTemplateTr.StillRunningBefore = ts customTemplateTr.StillRunningAfter = ts -customTemplateTr.Processes.Default.Command = "python tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/'".\ +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.TimeOut = 5 # seconds customTemplateTr.Processes.Default.ReturnCode = 0 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 ffc692db5cf..189077004d8 100644 --- a/tests/gold_tests/body_factory/http204_response_plugin.test.py +++ b/tests/gold_tests/body_factory/http204_response_plugin.test.py @@ -46,7 +46,7 @@ tr.Processes.Default.StartBefore(Test.Processes.ts) tr.StillRunningAfter = ts -tr.Processes.Default.Command = "python tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/'".\ +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.TimeOut = 5 # seconds tr.Processes.Default.ReturnCode = 0 diff --git a/tests/gold_tests/body_factory/http304_response.test.py b/tests/gold_tests/body_factory/http304_response.test.py index 8ce8ee78f7f..dc39eb61a4c 100644 --- a/tests/gold_tests/body_factory/http304_response.test.py +++ b/tests/gold_tests/body_factory/http304_response.test.py @@ -47,7 +47,7 @@ tr.Processes.Default.StartBefore(Test.Processes.ts) tr.StillRunningAfter = ts -cmd_tpl = "python tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/' | sed 's;ApacheTrafficServer\/[^ ]*;VERSION;'" +cmd_tpl = "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)) tr.Processes.Default.TimeOut = 5 # seconds tr.Processes.Default.ReturnCode = 0 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 4e918fdeb9f..92a4a6c60a8 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 @@ -36,7 +36,7 @@ tr.Processes.Default.StartBefore(Test.Processes.ts) tr.StillRunningAfter = ts -tr.Processes.Default.Command = "python tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/'".\ +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.TimeOut = 5 # seconds tr.Processes.Default.ReturnCode = 0 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 6de8e84743e..6c65a790c56 100644 --- a/tests/gold_tests/body_factory/http_with_origin.test.py +++ b/tests/gold_tests/body_factory/http_with_origin.test.py @@ -73,7 +73,7 @@ trhead200.StillRunningAfter = ts trhead200.StillRunningAfter = server -trhead200.Processes.Default.Command = "python tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/'".\ +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.TimeOut = 5 # seconds trhead200.Processes.Default.ReturnCode = 0 @@ -86,7 +86,7 @@ trget200.StillRunningAfter = ts trget200.StillRunningAfter = server -trget200.Processes.Default.Command = "python tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/'".\ +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.TimeOut = 5 # seconds trget200.Processes.Default.ReturnCode = 0 @@ -99,7 +99,7 @@ trget304.StillRunningAfter = ts trget304.StillRunningAfter = server -cmd_tpl = "python tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/' | sed 's;ApacheTrafficServer\/[^ ]*;VERSION;'" +cmd_tpl = "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)) trget304.Processes.Default.TimeOut = 5 # seconds trget304.Processes.Default.ReturnCode = 0 diff --git a/tests/gold_tests/h2/httpbin.test.py b/tests/gold_tests/h2/httpbin.test.py index 11d4a518178..2144df8a06d 100644 --- a/tests/gold_tests/h2/httpbin.test.py +++ b/tests/gold_tests/h2/httpbin.test.py @@ -80,7 +80,7 @@ # TODO: when httpbin 0.8.0 or later is released, remove below json pretty print hack json_printer = ''' -python -c "import sys,json; print(json.dumps(json.load(sys.stdin), indent=2, separators=(',', ': ')))" +python3 -c "import sys,json; print(json.dumps(json.load(sys.stdin), indent=2, separators=(',', ': ')))" ''' # ---- diff --git a/tests/gold_tests/headers/domain-blacklist-30x.test.py b/tests/gold_tests/headers/domain-blacklist-30x.test.py index dfec70547a0..275c3425890 100644 --- a/tests/gold_tests/headers/domain-blacklist-30x.test.py +++ b/tests/gold_tests/headers/domain-blacklist-30x.test.py @@ -59,7 +59,7 @@ redirect301tr = Test.AddTestRun("Test domain {0}".format(REDIRECT_301_HOST)) redirect301tr.Processes.Default.StartBefore(Test.Processes.ts) redirect301tr.StillRunningAfter = ts -redirect301tr.Processes.Default.Command = "python tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/'".\ +redirect301tr.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(REDIRECT_301_HOST)) redirect301tr.Processes.Default.TimeOut = 5 # seconds redirect301tr.Processes.Default.ReturnCode = 0 @@ -68,7 +68,7 @@ redirect302tr = Test.AddTestRun("Test domain {0}".format(REDIRECT_302_HOST)) redirect302tr.StillRunningBefore = ts redirect302tr.StillRunningAfter = ts -redirect302tr.Processes.Default.Command = "python tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/'".\ +redirect302tr.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(REDIRECT_302_HOST)) redirect302tr.Processes.Default.TimeOut = 5 # seconds redirect302tr.Processes.Default.ReturnCode = 0 @@ -78,7 +78,7 @@ redirect307tr = Test.AddTestRun("Test domain {0}".format(REDIRECT_307_HOST)) redirect302tr.StillRunningBefore = ts redirect307tr.StillRunningAfter = ts -redirect307tr.Processes.Default.Command = "python tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/'".\ +redirect307tr.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(REDIRECT_307_HOST)) redirect307tr.Processes.Default.TimeOut = 5 # seconds redirect307tr.Processes.Default.ReturnCode = 0 @@ -87,7 +87,7 @@ redirect308tr = Test.AddTestRun("Test domain {0}".format(REDIRECT_308_HOST)) redirect308tr.StillRunningBefore = ts redirect308tr.StillRunningAfter = ts -redirect308tr.Processes.Default.Command = "python tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/'".\ +redirect308tr.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(REDIRECT_308_HOST)) redirect308tr.Processes.Default.TimeOut = 5 # seconds redirect308tr.Processes.Default.ReturnCode = 0 @@ -96,7 +96,7 @@ redirect0tr = Test.AddTestRun("Test domain {0}".format(REDIRECT_0_HOST)) redirect0tr.StillRunningBefore = ts redirect0tr.StillRunningAfter = ts -redirect0tr.Processes.Default.Command = "python tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/'".\ +redirect0tr.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(REDIRECT_0_HOST)) redirect0tr.Processes.Default.TimeOut = 5 # seconds redirect0tr.Processes.Default.ReturnCode = 0 @@ -105,7 +105,7 @@ passthroughtr = Test.AddTestRun("Test domain {0}".format(PASSTHRU_HOST)) passthroughtr.StillRunningBefore = ts passthroughtr.StillRunningAfter = ts -passthroughtr.Processes.Default.Command = "python tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/'".\ +passthroughtr.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(PASSTHRU_HOST)) passthroughtr.Processes.Default.TimeOut = 5 # seconds passthroughtr.Processes.Default.ReturnCode = 0 diff --git a/tests/gold_tests/headers/general-connection-failure-502.test.py b/tests/gold_tests/headers/general-connection-failure-502.test.py index 7054ce95ae8..889bea565ee 100644 --- a/tests/gold_tests/headers/general-connection-failure-502.test.py +++ b/tests/gold_tests/headers/general-connection-failure-502.test.py @@ -39,7 +39,7 @@ tr = Test.AddTestRun() tr.Processes.Default.StartBefore(Test.Processes.ts) # Do not start the origin server: We wish to simulate connection refused while hopefully no one else uses this port. -tr.Processes.Default.Command = "python tcp_client.py 127.0.0.1 {0} {1} | sed -e '/^Date: /d' -e '/^Server: ATS\//d'"\ +tr.Processes.Default.Command = "python3 tcp_client.py 127.0.0.1 {0} {1} | sed -e '/^Date: /d' -e '/^Server: ATS\//d'"\ .format(ts.Variables.port, "www.connectfail502.test-get.txt") tr.Processes.Default.ReturnCode = 0 tr.Processes.Default.Streams.stdout = 'general-connection-failure-502.gold' diff --git a/tests/gold_tests/headers/http408.test.py b/tests/gold_tests/headers/http408.test.py index a56ffa96c0c..9db1ccec1b0 100644 --- a/tests/gold_tests/headers/http408.test.py +++ b/tests/gold_tests/headers/http408.test.py @@ -50,7 +50,7 @@ tr = Test.AddTestRun() tr.Processes.Default.StartBefore(server) tr.Processes.Default.StartBefore(Test.Processes.ts) -tr.Processes.Default.Command = 'python tcp_client.py 127.0.0.1 {0} {1} --delay-after-send {2}'\ +tr.Processes.Default.Command = 'python3 tcp_client.py 127.0.0.1 {0} {1} --delay-after-send {2}'\ .format(ts.Variables.port, 'data/{0}.txt'.format(HTTP_408_HOST), TIMEOUT + 2) tr.Processes.Default.ReturnCode = 0 tr.Processes.Default.TimeOut = 10 diff --git a/tests/gold_tests/logging/all_headers.test.py b/tests/gold_tests/logging/all_headers.test.py index b973fa6386a..12b81f06e19 100644 --- a/tests/gold_tests/logging/all_headers.test.py +++ b/tests/gold_tests/logging/all_headers.test.py @@ -97,7 +97,7 @@ def reallyLong(): # tr = Test.AddTestRun() tr.DelayStart = 10 -tr.Processes.Default.Command = 'python {0} {4} < {2} | sh {1} > {3}'.format( +tr.Processes.Default.Command = 'python3 {0} {4} < {2} | sh {1} > {3}'.format( os.path.join(Test.TestDirectory, 'all_headers_sanitizer.py'), os.path.join(Test.TestDirectory, 'all_headers_sanitizer.sh'), os.path.join(ts.Variables.LOGDIR, 'test_all_headers.log'), diff --git a/tests/gold_tests/logging/new_log_flds.test.py b/tests/gold_tests/logging/new_log_flds.test.py index fb787a5d9fe..1f388ebdc33 100644 --- a/tests/gold_tests/logging/new_log_flds.test.py +++ b/tests/gold_tests/logging/new_log_flds.test.py @@ -103,7 +103,7 @@ # tr = Test.AddTestRun() tr.DelayStart = 10 -tr.Processes.Default.Command = 'python {0} < {1}'.format( +tr.Processes.Default.Command = 'python3 {0} < {1}'.format( os.path.join(Test.TestDirectory, 'new_log_flds_observer.py'), os.path.join(ts.Variables.LOGDIR, 'test_new_log_flds.log')) tr.Processes.Default.ReturnCode = 0 diff --git a/tests/gold_tests/pluginTest/combo_handler/combo_handler.test.py b/tests/gold_tests/pluginTest/combo_handler/combo_handler.test.py index 6c0820d8d3a..c7b098001fc 100644 --- a/tests/gold_tests/pluginTest/combo_handler/combo_handler.test.py +++ b/tests/gold_tests/pluginTest/combo_handler/combo_handler.test.py @@ -41,7 +41,7 @@ def data_file(data): # Function to return command (string) to run tcp_client.py tool. 'host' 'port', and 'file_path' are the parameters to tcp_client. # def tcp_client_cmd(host, port, file_path): - return "python {}/tcp_client.py {} {} {}".format(Test.Variables.AtsTestToolsDir, host, port, file_path) + return "python3 {}/tcp_client.py {} {} {}".format(Test.Variables.AtsTestToolsDir, host, port, file_path) # Function to return command (string) to run tcp_client.py tool. 'host' and 'port' are the first two parameters to tcp_client. # 'data' is the data to put in the data file input to tcp_client. diff --git a/tests/gold_tests/pluginTest/xdebug/x_remap/x_remap.test.py b/tests/gold_tests/pluginTest/xdebug/x_remap/x_remap.test.py index 73773d8a232..fff8b6920b9 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_remap/x_remap.test.py +++ b/tests/gold_tests/pluginTest/xdebug/x_remap/x_remap.test.py @@ -58,7 +58,7 @@ def sendMsg(msgFile): tr = Test.AddTestRun() tr.Processes.Default.Command = ( - "( python {}/tcp_client.py 127.0.0.1 {} {}/{}.in".format( + "( python3 {}/tcp_client.py 127.0.0.1 {} {}/{}.in".format( Test.RunDirectory, ts.Variables.port, Test.TestDirectory, msgFile) + " ; echo '======' ) | sed 's/:{}/:SERVER_PORT/' >> {}/out.log 2>&1 ".format( server.Variables.Port, Test.RunDirectory) diff --git a/tests/gold_tests/redirect/redirect.test.py b/tests/gold_tests/redirect/redirect.test.py index f5c055643e6..17ff76da6b8 100644 --- a/tests/gold_tests/redirect/redirect.test.py +++ b/tests/gold_tests/redirect/redirect.test.py @@ -62,7 +62,7 @@ # Here and below: because autest's Copy does not behave like standard cp, it's easiest to write all of our files out and copy last. with open(os.path.join(data_path, tr.Name), 'w') as f: f.write('GET /redirect HTTP/1.1\r\nHost: iwillredirect.test:{port}\r\n\r\n'.format(port=redirect_serv.Variables.Port)) -tr.Processes.Default.Command = "python tcp_client.py 127.0.0.1 {0} {1} | egrep -v '^(Date: |Server: ATS/)'".format(ts.Variables.port, os.path.join(data_dirname, tr.Name)) +tr.Processes.Default.Command = "python3 tcp_client.py 127.0.0.1 {0} {1} | egrep -v '^(Date: |Server: ATS/)'".format(ts.Variables.port, os.path.join(data_dirname, tr.Name)) tr.Processes.Default.StartBefore(ts) tr.Processes.Default.StartBefore(redirect_serv) tr.Processes.Default.StartBefore(dest_serv) @@ -83,7 +83,7 @@ tr = Test.AddTestRun("FollowsRedirectWithRelativeLocationURI") with open(os.path.join(data_path, tr.Name), 'w') as f: f.write('GET /redirect-relative-path HTTP/1.1\r\nHost: iwillredirect.test:{port}\r\n\r\n'.format(port=redirect_serv.Variables.Port)) -tr.Processes.Default.Command = "python tcp_client.py 127.0.0.1 {0} {1} | egrep -v '^(Date: |Server: ATS/)'".format(ts.Variables.port, os.path.join(data_dirname, tr.Name)) +tr.Processes.Default.Command = "python3 tcp_client.py 127.0.0.1 {0} {1} | egrep -v '^(Date: |Server: ATS/)'".format(ts.Variables.port, os.path.join(data_dirname, tr.Name)) tr.StillRunningAfter = ts tr.StillRunningAfter = redirect_serv tr.StillRunningAfter = dest_serv @@ -100,7 +100,7 @@ tr = Test.AddTestRun("FollowsRedirectWithRelativeLocationURIMissingLeadingSlash") with open(os.path.join(data_path, tr.Name), 'w') as f: f.write('GET /redirect-relative-path-no-leading-slash HTTP/1.1\r\nHost: iwillredirect.test:{port}\r\n\r\n'.format(port=redirect_serv.Variables.Port)) -tr.Processes.Default.Command = "python tcp_client.py 127.0.0.1 {0} {1} | egrep -v '^(Date: |Server: ATS/)'".format(ts.Variables.port, os.path.join(data_dirname, tr.Name)) +tr.Processes.Default.Command = "python3 tcp_client.py 127.0.0.1 {0} {1} | egrep -v '^(Date: |Server: ATS/)'".format(ts.Variables.port, os.path.join(data_dirname, tr.Name)) tr.StillRunningAfter = ts tr.StillRunningAfter = redirect_serv tr.StillRunningAfter = dest_serv @@ -138,7 +138,7 @@ f.write(('GET /redirect{0} HTTP/1.1\r\n' 'Host: iwillredirect.test:{1}\r\n\r\n').\ format(status, redirect_serv.Variables.Port)) - tr.Processes.Default.Command = "python tcp_client.py 127.0.0.1 {0} {1} | egrep -v '^(Date: |Server: ATS/)'".\ + tr.Processes.Default.Command = "python3 tcp_client.py 127.0.0.1 {0} {1} | egrep -v '^(Date: |Server: ATS/)'".\ format(ts.Variables.port, os.path.join(data_dirname, tr.Name)) tr.StillRunningAfter = ts tr.StillRunningAfter = redirect_serv diff --git a/tests/gold_tests/redirect/redirect_actions.test.py b/tests/gold_tests/redirect/redirect_actions.test.py index 94ce1d5a09c..6603c27b544 100644 --- a/tests/gold_tests/redirect/redirect_actions.test.py +++ b/tests/gold_tests/redirect/redirect_actions.test.py @@ -153,7 +153,7 @@ def makeTestCase(redirectTarget, expectedAction, scenario): 'Host: iwillredirect.test:{2}\r\n\r\n').\ format(normConfig, normRedirectTarget, origin.Variables.Port)) # Set the command with the appropriate URL. - tr.Processes.Default.Command = "bash -o pipefail -c 'python tcp_client.py 127.0.0.1 {0} {1} | head -n 1'".\ + tr.Processes.Default.Command = "bash -o pipefail -c 'python3 tcp_client.py 127.0.0.1 {0} {1} | head -n 1'".\ format(trafficservers[config].Variables.port, os.path.join(data_dirname, tr.Name)) tr.Processes.Default.ReturnCode = 0 # Generate and set the 'gold file' to check stdout