Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/gold_tests/basic/deny0.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/gold_tests/body_factory/http204_response.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/gold_tests/body_factory/http304_response.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/gold_tests/body_factory/http_head_no_origin.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tests/gold_tests/body_factory/http_with_origin.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/gold_tests/h2/httpbin.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=(',', ': ')))"
'''

# ----
Expand Down
12 changes: 6 additions & 6 deletions tests/gold_tests/headers/domain-blacklist-30x.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 1 addition & 1 deletion tests/gold_tests/headers/http408.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/gold_tests/logging/all_headers.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
2 changes: 1 addition & 1 deletion tests/gold_tests/logging/new_log_flds.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tests/gold_tests/pluginTest/xdebug/x_remap/x_remap.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions tests/gold_tests/redirect/redirect.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/gold_tests/redirect/redirect_actions.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down