You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2020/02/19 17:36:07 UTC

[trafficserver] branch master updated: Replace python with python3 in AuTest

This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 6babe49  Replace python with python3 in AuTest
6babe49 is described below

commit 6babe49d81a3f95e2bec139236167554fe993bd9
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Tue Feb 4 14:39:48 2020 +0900

    Replace python with python3 in AuTest
    
    Ran below command
    ```
    find . -name "*.py" | xargs sed -i '' s/"python "/"python3 "/g
    ```
---
 tests/gold_tests/basic/deny0.test.py                         |  2 +-
 tests/gold_tests/body_factory/http204_response.test.py       |  4 ++--
 .../gold_tests/body_factory/http204_response_plugin.test.py  |  2 +-
 tests/gold_tests/body_factory/http304_response.test.py       |  2 +-
 tests/gold_tests/body_factory/http_head_no_origin.test.py    |  2 +-
 tests/gold_tests/body_factory/http_with_origin.test.py       |  6 +++---
 tests/gold_tests/h2/httpbin.test.py                          |  2 +-
 tests/gold_tests/headers/domain-blacklist-30x.test.py        | 12 ++++++------
 .../headers/general-connection-failure-502.test.py           |  2 +-
 tests/gold_tests/headers/http408.test.py                     |  2 +-
 tests/gold_tests/logging/all_headers.test.py                 |  2 +-
 tests/gold_tests/logging/new_log_flds.test.py                |  2 +-
 .../pluginTest/combo_handler/combo_handler.test.py           |  2 +-
 tests/gold_tests/pluginTest/xdebug/x_remap/x_remap.test.py   |  2 +-
 tests/gold_tests/redirect/redirect.test.py                   |  8 ++++----
 tests/gold_tests/redirect/redirect_actions.test.py           |  2 +-
 16 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/tests/gold_tests/basic/deny0.test.py b/tests/gold_tests/basic/deny0.test.py
index 54fbe99..4cacd14 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 f7f21df..34e531b 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 = Test.AddTestRun("Test domain {0}".format(DEFAULT_204_HOST))
 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 @@ defaultTr.Processes.Default.Streams.stdout = "gold/http-204.gold"
 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 ffc692d..1890770 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 = Test.AddTestRun("Test domain {0}".format(CUSTOM_PLUGIN_204_HOST))
 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 8ce8ee7..dc39eb6 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 = Test.AddTestRun("Test domain {0}".format(DEFAULT_304_HOST))
 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 4e918fd..92a4a6c 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 = Test.AddTestRun("Test domain {0}".format(HOST))
 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 6de8e84..6c65a79 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.Processes.Default.StartBefore(server, ready=When.PortOpen(server.Varia
 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.StillRunningBefore = server
 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.StillRunningBefore = server
 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 11d4a51..2144df8 100644
--- a/tests/gold_tests/h2/httpbin.test.py
+++ b/tests/gold_tests/h2/httpbin.test.py
@@ -80,7 +80,7 @@ Test.Disk.File(os.path.join(ts.Variables.LOGDIR, 'access.log'), exists=True, con
 
 # 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 dfec705..275c342 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 @@ Test.Setup.Copy('data')
 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 @@ redirect301tr.Processes.Default.Streams.stdout = "redirect301_get.gold"
 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 @@ redirect302tr.Processes.Default.Streams.stdout = "redirect302_get.gold"
 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 @@ redirect307tr.Processes.Default.Streams.stdout = "redirect307_get.gold"
 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 @@ redirect308tr.Processes.Default.Streams.stdout = "redirect308_get.gold"
 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 @@ redirect0tr.Processes.Default.Streams.stdout = "redirect0_get.gold"
 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 7054ce9..889bea5 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 @@ data_file.WriteOn("GET / HTTP/1.1\r\nHost: {host}\r\n\r\n".format(host=HOST))
 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 a56ffa9..9db1cce 100644
--- a/tests/gold_tests/headers/http408.test.py
+++ b/tests/gold_tests/headers/http408.test.py
@@ -50,7 +50,7 @@ Test.Setup.Copy('data')
 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 b973fa6..12b81f0 100644
--- a/tests/gold_tests/logging/all_headers.test.py
+++ b/tests/gold_tests/logging/all_headers.test.py
@@ -97,7 +97,7 @@ tr.Processes.Default.ReturnCode = 0
 #
 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 fb787a5..1f388eb 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.Processes.Default.ReturnCode = 0
 #
 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 6c0820d..c7b0980 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 73773d8..fff8b69 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 f5c0556..17ff76d 100644
--- a/tests/gold_tests/redirect/redirect.test.py
+++ b/tests/gold_tests/redirect/redirect.test.py
@@ -62,7 +62,7 @@ tr = Test.AddTestRun("FollowsRedirectWithAbsoluteLocationURI")
 # 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 @@ redirect_serv.addResponse("sessionfile.log", redirect_request_header, redirect_r
 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 @@ redirect_serv.addResponse("sessionfile.log", redirect_request_header, redirect_r
 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 @@ for status,phrase in sorted({
         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 94ce1d5..6603c27 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