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/12/14 22:41:37 UTC

[GitHub] [trafficserver] serrislew commented on a change in pull request #8484: Serve stale content when DNS lookup fails

serrislew commented on a change in pull request #8484:
URL: https://github.com/apache/trafficserver/pull/8484#discussion_r769102747



##########
File path: tests/gold_tests/proxy_protocol/proxy_serve_stale_dns_fail.test.py
##########
@@ -0,0 +1,79 @@
+'''
+Test proxy serving stale content when DNS lookup fails
+'''
+#  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.ContinueOnFail = True
+# Set up hierarchical caching processes
+ts_child = Test.MakeATSProcess("ts_child")
+ts_parent = Test.MakeATSProcess("ts_parent")
+server_name = "http://unknown.domain.com/"
+
+Test.testName = "STALE"
+
+# Config child proxy to route to parent proxy
+ts_child.Disk.records_config.update({
+    'proxy.config.url_remap.pristine_host_hdr': 1,
+    'proxy.config.http.cache.max_stale_age': 10,
+    'proxy.config.http.parent_proxy.self_detect': 0,
+})
+ts_child.Disk.parent_config.AddLine(
+    f'dest_domain=. parent=localhost:{ts_parent.Variables.port} round_robin=consistent_hash go_direct=false'
+)
+ts_child.Disk.remap_config.AddLine(
+    f'map http://localhost:{ts_child.Variables.port} {server_name}'
+)
+
+# Configure parent proxy
+ts_parent.Disk.records_config.update({
+    'proxy.config.url_remap.pristine_host_hdr': 1,
+    'proxy.config.http.cache.max_stale_age': 10,
+})
+ts_parent.Disk.remap_config.AddLine(
+    f'map http://localhost:{ts_parent.Variables.port} {server_name}'
+)
+ts_parent.Disk.remap_config.AddLine(
+    f'map {server_name} {server_name}'

Review comment:
       I am testing for non-hierarchical scenarios as well so the `ts_parent` server is mapped to the OS and gets called directly




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