You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2022/08/28 23:11:36 UTC

[trafficserver] branch master updated: Test: add nameserver to proxy_serve_stale_dns_fail test (#9058)

This is an automated email from the ASF dual-hosted git repository.

maskit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 1f7799c2b Test: add nameserver to proxy_serve_stale_dns_fail test (#9058)
1f7799c2b is described below

commit 1f7799c2b66a6a57709fa9f1176774da57c778fc
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Mon Aug 29 08:11:31 2022 +0900

    Test: add nameserver to proxy_serve_stale_dns_fail test (#9058)
    
    * Test: add nameserver to proxy_serve_stale_dns_fail test
    
    * autopep8
---
 tests/gold_tests/proxy_protocol/proxy_serve_stale_dns_fail.test.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/gold_tests/proxy_protocol/proxy_serve_stale_dns_fail.test.py b/tests/gold_tests/proxy_protocol/proxy_serve_stale_dns_fail.test.py
index 4334dd5c7..19e87df22 100644
--- a/tests/gold_tests/proxy_protocol/proxy_serve_stale_dns_fail.test.py
+++ b/tests/gold_tests/proxy_protocol/proxy_serve_stale_dns_fail.test.py
@@ -21,6 +21,7 @@ Test.ContinueOnFail = True
 # Set up hierarchical caching processes
 ts_child = Test.MakeATSProcess("ts_child")
 ts_parent = Test.MakeATSProcess("ts_parent")
+nameserver = Test.MakeDNServer("dns")
 server_name = "http://unknown.domain.com/"
 
 Test.testName = "STALE"
@@ -30,6 +31,7 @@ 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,
+    'proxy.config.dns.nameservers': f"127.0.0.1:{nameserver.Variables.Port}",
 })
 ts_child.Disk.parent_config.AddLine(
     f'dest_domain=. parent=localhost:{ts_parent.Variables.port} round_robin=consistent_hash go_direct=false'
@@ -42,6 +44,7 @@ ts_child.Disk.remap_config.AddLine(
 ts_parent.Disk.records_config.update({
     'proxy.config.url_remap.pristine_host_hdr': 1,
     'proxy.config.http.cache.max_stale_age': 10,
+    'proxy.config.dns.nameservers': f"127.0.0.1:{nameserver.Variables.Port}",
 })
 ts_parent.Disk.remap_config.AddLine(
     f'map http://localhost:{ts_parent.Variables.port} {server_name}'
@@ -50,6 +53,9 @@ ts_parent.Disk.remap_config.AddLine(
     f'map {server_name} {server_name}'
 )
 
+# Configure nameserver
+nameserver.addRecords(records={"localhost": ["127.0.0.1"]})
+
 # Object to push to proxies
 stale_5 = "HTTP/1.1 200 OK\nServer: ATS/10.0.0\nAccept-Ranges: bytes\nContent-Length: 6\nCache-Control: public, max-age=5\n\nCACHED"
 stale_10 = "HTTP/1.1 200 OK\nServer: ATS/10.0.0\nAccept-Ranges: bytes\nContent-Length: 6\nCache-Control: public, max-age=10\n\nCACHED"
@@ -74,6 +80,7 @@ tr.Processes.Default.Command = child_curl_request
 tr.Processes.Default.ReturnCode = 0
 tr.Processes.Default.StartBefore(ts_child)
 tr.Processes.Default.StartBefore(ts_parent)
+tr.Processes.Default.StartBefore(nameserver)
 tr.Processes.Default.Streams.stderr = "gold/serve_stale_dns_fail.gold"
 tr.StillRunningAfter = ts_child
 tr.StillRunningAfter = ts_parent