This is an automated email from the ASF dual-hosted git repository. shinrich pushed a commit to branch start-tunnel-hook in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit e47ef3174960c955e059f16d3079fff4cfe1817c Author: Susan Hinrichs <shinr...@ieee.org> AuthorDate: Mon Sep 25 16:22:04 2023 +0000 Add connect method test case --- tests/gold_tests/tunnel/txn_type.test.py | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/tests/gold_tests/tunnel/txn_type.test.py b/tests/gold_tests/tunnel/txn_type.test.py index af61541c66..85f854f340 100644 --- a/tests/gold_tests/tunnel/txn_type.test.py +++ b/tests/gold_tests/tunnel/txn_type.test.py @@ -50,10 +50,12 @@ Test.PrepareTestPlugin(os.path.join(Test.Variables.AtsTestPluginsDir, server.addResponse("sessionfile.log", request_header, response_header) server.addResponse("sessionfile.log", request_tunnel_header, response_tunnel_header) ts.Disk.records_config.update({ - 'proxy.config.diags.debug.enabled': 0, - 'proxy.config.diags.debug.tags': 'http|ssl|test', + 'proxy.config.diags.debug.enabled': 1, + 'proxy.config.diags.debug.tags': 'http|test', 'proxy.config.ssl.server.cert.path': '{0}'.format(ts.Variables.SSLDir), - 'proxy.config.ssl.server.private_key.path': '{0}'.format(ts.Variables.SSLDir) + 'proxy.config.ssl.server.private_key.path': '{0}'.format(ts.Variables.SSLDir), + 'proxy.config.ssl.client.verify.server.policy': 'PERMISSIVE', + 'proxy.config.http.connect_ports': '{0}'.format(server.Variables.SSL_Port) }) ts.Disk.ssl_multicert_config.AddLine( @@ -61,7 +63,7 @@ ts.Disk.ssl_multicert_config.AddLine( ) ts.Disk.remap_config.AddLine( - 'map http://http-test:{0} http://127.0.0.1:{1}'.format( + 'map https://http-test:{0}/ https://127.0.0.1:{1}/'.format( ts.Variables.ssl_port, server.Variables.SSL_Port) ) @@ -76,6 +78,8 @@ cmd_http = 'curl -k --http1.1 -H "Connection: close" -vs --resolve "http-test:{0 ts.Variables.ssl_port) cmd_tunnel = 'curl -k --http1.1 -H "Connection: close" -vs --resolve "tunnel-test:{0}:127.0.0.1" https://tunnel-test:{0}/'.format( ts.Variables.ssl_port) +cmd_connect = 'curl -k --http1.1 -H "Connection: close" -vs --resolve "connect-proxy:{0}:127.0.0.1" -x http://connect-proxy:{0} --resolve "http-test:{1}:127.0.0.1" https://http-test:{1}/'.format( + ts.Variables.port, ts.Variables.ssl_port) # Send the http request tr = Test.AddTestRun("send http request") @@ -85,6 +89,7 @@ tr.Processes.Default.ReturnCode = 0 tr.Processes.Default.StartBefore(server, ready=When.PortOpen(server.Variables.SSL_Port)) tr.Processes.Default.StartBefore(Test.Processes.ts) tr.StillRunningAfter = ts +tr.StillRunningAfter = server # Send the tunnel request tr = Test.AddTestRun("send tunnel request") @@ -92,7 +97,18 @@ tr.Processes.Default.Env = ts.Env tr.Processes.Default.Command = cmd_tunnel tr.Processes.Default.ReturnCode = 0 tr.StillRunningAfter = ts +tr.StillRunningAfter = server +# Send the connect request +# while the connect method will set up a tunnel, it is processed in ATS as a +# transaction rather than a blind tunnel directly. Plugs can differentiate on the +# method to determine whether a connect tunnel will be set up +tr = Test.AddTestRun("send connect request") +tr.Processes.Default.Env = ts.Env +tr.Processes.Default.Command = cmd_connect +tr.Processes.Default.ReturnCode = 0 +tr.StillRunningAfter = ts +tr.StillRunningAfter = server # Signal that all the curl processes have completed tr = Test.AddTestRun("Curl Done") @@ -101,6 +117,7 @@ tr.Processes.Default.Command = "traffic_ctl plugin msg done done" tr.Processes.Default.ReturnCode = 0 tr.Processes.Default.Env = ts.Env tr.StillRunningAfter = ts +tr.StillRunningAfter = server # Parking this as a ready tester on a meaningless process # To stall the test runs that check for the stats until the @@ -147,6 +164,6 @@ tr.Processes.Default.Command = 'traffic_ctl metric get txn_type_verify.http.req' tr.Processes.Default.ReturnCode = 0 tr.Processes.Default.Env = ts.Env tr.Processes.Default.Streams.stdout = Testers.ContainsExpression( - "txn_type_verify.http.req 1", 'Should have a http request.') + "txn_type_verify.http.req 2", 'Should have a http request.') tr.StillRunningAfter = ts tr.StillRunningAfter = server