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 2021/03/22 05:46:47 UTC

[GitHub] [trafficserver] masaori335 opened a new pull request #7613: Add AuTest for Background Fill

masaori335 opened a new pull request #7613:
URL: https://github.com/apache/trafficserver/pull/7613


   Test case 2 ( Background Fill on HTTP/1.1 over TLS ) will fail for now. Requires fix of #7603.


-- 
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.

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



[GitHub] [trafficserver] bneradt commented on pull request #7613: Add AuTest for Background Fill

Posted by GitBox <gi...@apache.org>.
bneradt commented on pull request #7613:
URL: https://github.com/apache/trafficserver/pull/7613#issuecomment-804949543


   Looks good to me.


-- 
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.

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



[GitHub] [trafficserver] bneradt commented on a change in pull request #7613: Add AuTest for Background Fill

Posted by GitBox <gi...@apache.org>.
bneradt commented on a change in pull request #7613:
URL: https://github.com/apache/trafficserver/pull/7613#discussion_r598776419



##########
File path: tests/gold_tests/cache/background_fill.test.py
##########
@@ -0,0 +1,125 @@
+'''
+'''
+#  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.
+
+Test.Summary = 'Exercise Background Fill'
+Test.SkipUnless(
+    Condition.HasCurlFeature('http2'),
+)
+Test.ContinueOnFail = True
+
+class BackgroundFillTest:
+    """
+    https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.config.en.html#proxy-config-http-background-fill-completed-threshold
+    """
+
+    def __init__(self):
+        self.__setupOriginServer()
+        self.__setupTS()
+        
+    def __setupOriginServer(self):
+        self.httpbin = Test.MakeHttpBinServer("httpbin")
+
+    def __setupTS(self):
+        self.ts = Test.MakeATSProcess(
+            "ts", select_ports=True, enable_tls=True, enable_cache=True)
+
+        self.ts.addDefaultSSLFiles()
+        self.ts.Disk.ssl_multicert_config.AddLine(
+            "dest_ip=* ssl_cert_name=server.pem ssl_key_name=server.key")
+
+        self.ts.Disk.records_config.update({
+            "proxy.config.http.server_ports": f"{self.ts.Variables.port} {self.ts.Variables.ssl_port}:ssl",
+            'proxy.config.ssl.server.cert.path': f"{self.ts.Variables.SSLDir}",
+            'proxy.config.ssl.server.private_key.path': f"{self.ts.Variables.SSLDir}",
+            "proxy.config.diags.debug.enabled": 1,
+            "proxy.config.diags.debug.tags": "http",
+            "proxy.config.http.background_fill_active_timeout": "0",
+            "proxy.config.http.background_fill_completed_threshold": "0.0",
+            "proxy.config.http.cache.required_headers": 0, # Force cache
+            "proxy.config.http.insert_response_via_str": 2,
+        })
+
+        self.ts.Disk.remap_config.AddLines([
+            f"map / http://127.0.0.1:{self.httpbin.Variables.Port}/",
+        ])
+
+    def __startProcess(self, tr):
+        tr.Processes.Default.StartBefore(self.httpbin, ready=When.PortOpen(self.httpbin.Variables.Port))
+        tr.Processes.Default.StartBefore(self.ts)
+
+    def __checkProcessBefore(self, tr):
+        tr.StillRunningBefore = self.httpbin
+        tr.StillRunningBefore = self.ts
+
+    def __checkProcessAfter(self, tr):
+        tr.StillRunningAfter = self.httpbin
+        tr.StillRunningAfter = self.ts
+
+    def __testCase0(self):
+        """
+        HTTP/1.1 over TCP
+        """
+        tr = Test.AddTestRun()
+        self.__startProcess(tr)

Review comment:
       It could be helpful to rewrite consolidate __startProcess and __checkProcessBefore into a single call site for the test run functions that uses a static variable to see whether the processes have been started already and, if not, calls StartBefore but, if it had been called, calls StillRunningBefore. Then the user can easily comment out all but one of the cases and things will work.
   
   This is just a suggestion. It would be pretty easy to do with the way you organized this. But feel free to ignore it.




-- 
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.

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



[GitHub] [trafficserver] masaori335 commented on a change in pull request #7613: Add AuTest for Background Fill

Posted by GitBox <gi...@apache.org>.
masaori335 commented on a change in pull request #7613:
URL: https://github.com/apache/trafficserver/pull/7613#discussion_r599187537



##########
File path: tests/gold_tests/cache/background_fill.test.py
##########
@@ -0,0 +1,125 @@
+'''
+'''
+#  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.
+
+Test.Summary = 'Exercise Background Fill'
+Test.SkipUnless(
+    Condition.HasCurlFeature('http2'),
+)
+Test.ContinueOnFail = True
+
+class BackgroundFillTest:
+    """
+    https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.config.en.html#proxy-config-http-background-fill-completed-threshold
+    """
+
+    def __init__(self):
+        self.__setupOriginServer()
+        self.__setupTS()
+        
+    def __setupOriginServer(self):
+        self.httpbin = Test.MakeHttpBinServer("httpbin")
+
+    def __setupTS(self):
+        self.ts = Test.MakeATSProcess(
+            "ts", select_ports=True, enable_tls=True, enable_cache=True)
+
+        self.ts.addDefaultSSLFiles()
+        self.ts.Disk.ssl_multicert_config.AddLine(
+            "dest_ip=* ssl_cert_name=server.pem ssl_key_name=server.key")
+
+        self.ts.Disk.records_config.update({
+            "proxy.config.http.server_ports": f"{self.ts.Variables.port} {self.ts.Variables.ssl_port}:ssl",
+            'proxy.config.ssl.server.cert.path': f"{self.ts.Variables.SSLDir}",
+            'proxy.config.ssl.server.private_key.path': f"{self.ts.Variables.SSLDir}",
+            "proxy.config.diags.debug.enabled": 1,
+            "proxy.config.diags.debug.tags": "http",
+            "proxy.config.http.background_fill_active_timeout": "0",
+            "proxy.config.http.background_fill_completed_threshold": "0.0",
+            "proxy.config.http.cache.required_headers": 0, # Force cache
+            "proxy.config.http.insert_response_via_str": 2,
+        })
+
+        self.ts.Disk.remap_config.AddLines([
+            f"map / http://127.0.0.1:{self.httpbin.Variables.Port}/",
+        ])
+
+    def __startProcess(self, tr):
+        tr.Processes.Default.StartBefore(self.httpbin, ready=When.PortOpen(self.httpbin.Variables.Port))
+        tr.Processes.Default.StartBefore(self.ts)
+
+    def __checkProcessBefore(self, tr):
+        tr.StillRunningBefore = self.httpbin
+        tr.StillRunningBefore = self.ts
+
+    def __checkProcessAfter(self, tr):
+        tr.StillRunningAfter = self.httpbin
+        tr.StillRunningAfter = self.ts
+
+    def __testCase0(self):
+        """
+        HTTP/1.1 over TCP
+        """
+        tr = Test.AddTestRun()
+        self.__startProcess(tr)

Review comment:
       Good suggestion. I combined them. 




-- 
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.

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



[GitHub] [trafficserver] masaori335 commented on pull request #7613: Add AuTest for Background Fill

Posted by GitBox <gi...@apache.org>.
masaori335 commented on pull request #7613:
URL: https://github.com/apache/trafficserver/pull/7613#issuecomment-812239812


   @bneradt Would you take another look? The fix (#7641) is merged. This is ready for review. 


-- 
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.

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



[GitHub] [trafficserver] ezelkow1 commented on pull request #7613: Add AuTest for Background Fill

Posted by GitBox <gi...@apache.org>.
ezelkow1 commented on pull request #7613:
URL: https://github.com/apache/trafficserver/pull/7613#issuecomment-803781206


   Can one of the admins verify this patch?


-- 
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.

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



[GitHub] [trafficserver] masaori335 commented on pull request #7613: Add AuTest for Background Fill

Posted by GitBox <gi...@apache.org>.
masaori335 commented on pull request #7613:
URL: https://github.com/apache/trafficserver/pull/7613#issuecomment-812220537


   [approve ci autest]


-- 
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.

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



[GitHub] [trafficserver] ezelkow1 removed a comment on pull request #7613: Add AuTest for Background Fill

Posted by GitBox <gi...@apache.org>.
ezelkow1 removed a comment on pull request #7613:
URL: https://github.com/apache/trafficserver/pull/7613#issuecomment-803781206


   Can one of the admins verify this patch?


-- 
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.

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



[GitHub] [trafficserver] masaori335 merged pull request #7613: Add AuTest for Background Fill

Posted by GitBox <gi...@apache.org>.
masaori335 merged pull request #7613:
URL: https://github.com/apache/trafficserver/pull/7613


   


-- 
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.

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