You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2023/01/18 19:20:33 UTC

[GitHub] [trafficserver] lzx404243 opened a new pull request, #9315: Added http connect Autest with proxy verifier

lzx404243 opened a new pull request, #9315:
URL: https://github.com/apache/trafficserver/pull/9315

   Added an Autest with proxy verifier to generate traffic that executes the http `CONNECT` request.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] randall merged pull request #9315: Added http connect Autest with proxy verifier

Posted by "randall (via GitHub)" <gi...@apache.org>.
randall merged PR #9315:
URL: https://github.com/apache/trafficserver/pull/9315


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] bneradt commented on a diff in pull request #9315: Added http connect Autest with proxy verifier

Posted by GitBox <gi...@apache.org>.
bneradt commented on code in PR #9315:
URL: https://github.com/apache/trafficserver/pull/9315#discussion_r1073981146


##########
tests/gold_tests/connect/connect.test.py:
##########
@@ -106,3 +107,61 @@ def run(self):
 
 
 ConnectTest().run()
+
+
+class ConnectViaPVTest:
+    # This test also executes the CONNECT request but using proxy verifier to
+    # generate traffic
+    connectReplayFile = "replays/connect.replay.yaml"
+
+    def __init__(self):
+        self.setupOriginServer()
+        self.setupTS()
+
+    def setupOriginServer(self):
+        self.server = Test.MakeVerifierServerProcess(
+            "connect-verifier-server",
+            self.connectReplayFile)
+        # Verify server output
+        self.server.Streams.stdout += Testers.ExcludesExpression(
+            "uuid: 1",
+            "Verify the CONNECT request doesn't reach the server.")
+        self.server.Streams.stdout += Testers.ContainsExpression(
+            "GET /get HTTP/1.1\nuuid: 2", reflags=re.MULTILINE,
+            description="Verify the server gets the second request.")
+
+    def setupTS(self):
+        self.ts = Test.MakeATSProcess("connect-ts")
+
+        self.ts.Disk.records_config.update({
+            'proxy.config.diags.debug.enabled': 1,
+            'proxy.config.diags.debug.tags': 'http',
+            'proxy.config.http.server_ports': f"{self.ts.Variables.port}",
+            'proxy.config.http.connect_ports': f"{self.server.Variables.http_port}",

Review Comment:
   I don't think these need to be strings. Can you try without making these string literals and see whether that works?



##########
tests/gold_tests/connect/replays/connect.replay.yaml:
##########
@@ -0,0 +1,53 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+#
+# This replay file executes a CONNECT request and a subsequent GET request
+#
+meta:
+  version: "1.0"
+
+sessions:
+  - transactions:
+      - client-request:
+          method: CONNECT
+          version: "1.1"
+          url: www.example.com:80
+          headers:
+            fields:
+              - [uuid, 1]
+              - [Host, www.example.com:80]
+        # This is a CONNECT request so it should not reach the origin server
+        server-response:
+          status: 200
+
+        # ATS returns a 200 responses to client when it establishes a tunnel
+        # between the client and server
+        proxy-response:
+          status: 200
+
+      # Once the tunnel between client and server is established, subsequent
+      # requests will reach the server(via the tunnel)
+      - client-request:
+          method: GET
+          version: "1.1"
+          url: /get
+          headers:
+            fields:
+              - [uuid, 2]
+              - [Host, www.example.com]
+        server-response:
+          status: 200

Review Comment:
   Let's add some `X-Response` header for this proxied transaction and add a `proxy-response` verification that the client gets that back. The content will be opaque to ATS, but the proxy-verifier server should still function as normal and the client should get its response back.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] lzx404243 commented on a diff in pull request #9315: Added http connect Autest with proxy verifier

Posted by GitBox <gi...@apache.org>.
lzx404243 commented on code in PR #9315:
URL: https://github.com/apache/trafficserver/pull/9315#discussion_r1074045434


##########
tests/gold_tests/connect/connect.test.py:
##########
@@ -106,3 +107,61 @@ def run(self):
 
 
 ConnectTest().run()
+
+
+class ConnectViaPVTest:
+    # This test also executes the CONNECT request but using proxy verifier to
+    # generate traffic
+    connectReplayFile = "replays/connect.replay.yaml"
+
+    def __init__(self):
+        self.setupOriginServer()
+        self.setupTS()
+
+    def setupOriginServer(self):
+        self.server = Test.MakeVerifierServerProcess(
+            "connect-verifier-server",
+            self.connectReplayFile)
+        # Verify server output
+        self.server.Streams.stdout += Testers.ExcludesExpression(
+            "uuid: 1",
+            "Verify the CONNECT request doesn't reach the server.")
+        self.server.Streams.stdout += Testers.ContainsExpression(
+            "GET /get HTTP/1.1\nuuid: 2", reflags=re.MULTILINE,
+            description="Verify the server gets the second request.")
+
+    def setupTS(self):
+        self.ts = Test.MakeATSProcess("connect-ts")
+
+        self.ts.Disk.records_config.update({
+            'proxy.config.diags.debug.enabled': 1,
+            'proxy.config.diags.debug.tags': 'http',
+            'proxy.config.http.server_ports': f"{self.ts.Variables.port}",
+            'proxy.config.http.connect_ports': f"{self.server.Variables.http_port}",

Review Comment:
   Tried that but that didn't work out. I think they take string type to support specifying a range of ports.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] lzx404243 commented on a diff in pull request #9315: Added http connect Autest with proxy verifier

Posted by GitBox <gi...@apache.org>.
lzx404243 commented on code in PR #9315:
URL: https://github.com/apache/trafficserver/pull/9315#discussion_r1074045712


##########
tests/gold_tests/connect/replays/connect.replay.yaml:
##########
@@ -0,0 +1,53 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+#
+# This replay file executes a CONNECT request and a subsequent GET request
+#
+meta:
+  version: "1.0"
+
+sessions:
+  - transactions:
+      - client-request:
+          method: CONNECT
+          version: "1.1"
+          url: www.example.com:80
+          headers:
+            fields:
+              - [uuid, 1]
+              - [Host, www.example.com:80]
+        # This is a CONNECT request so it should not reach the origin server
+        server-response:
+          status: 200
+
+        # ATS returns a 200 responses to client when it establishes a tunnel
+        # between the client and server
+        proxy-response:
+          status: 200
+
+      # Once the tunnel between client and server is established, subsequent
+      # requests will reach the server(via the tunnel)
+      - client-request:
+          method: GET
+          version: "1.1"
+          url: /get
+          headers:
+            fields:
+              - [uuid, 2]
+              - [Host, www.example.com]
+        server-response:
+          status: 200

Review Comment:
   Good point! Added those



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] bneradt commented on a diff in pull request #9315: Added http connect Autest with proxy verifier

Posted by GitBox <gi...@apache.org>.
bneradt commented on code in PR #9315:
URL: https://github.com/apache/trafficserver/pull/9315#discussion_r1081983669


##########
tests/gold_tests/connect/connect.test.py:
##########
@@ -106,3 +107,61 @@ def run(self):
 
 
 ConnectTest().run()
+
+
+class ConnectViaPVTest:
+    # This test also executes the CONNECT request but using proxy verifier to
+    # generate traffic
+    connectReplayFile = "replays/connect.replay.yaml"
+
+    def __init__(self):
+        self.setupOriginServer()
+        self.setupTS()
+
+    def setupOriginServer(self):
+        self.server = Test.MakeVerifierServerProcess(
+            "connect-verifier-server",
+            self.connectReplayFile)
+        # Verify server output
+        self.server.Streams.stdout += Testers.ExcludesExpression(
+            "uuid: 1",
+            "Verify the CONNECT request doesn't reach the server.")
+        self.server.Streams.stdout += Testers.ContainsExpression(
+            "GET /get HTTP/1.1\nuuid: 2", reflags=re.MULTILINE,
+            description="Verify the server gets the second request.")
+
+    def setupTS(self):
+        self.ts = Test.MakeATSProcess("connect-ts")
+
+        self.ts.Disk.records_config.update({
+            'proxy.config.diags.debug.enabled': 1,
+            'proxy.config.diags.debug.tags': 'http',
+            'proxy.config.http.server_ports': f"{self.ts.Variables.port}",
+            'proxy.config.http.connect_ports': f"{self.server.Variables.http_port}",

Review Comment:
   Gotcha. Thanks for trying it out.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org