You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ez...@apache.org on 2026/10/19 22:03:22 UTC

(trafficserver) 18/30: autest: expand server port placeholders in string remap entries

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

ezelkow1 pushed a commit to branch 9.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit f7ceba0a27f41e5a124ddc82868baad2449976c1
Author: Evan Zelkowitz <e_...@apple.com>
AuthorDate: Fri Aug 28 21:38:20 2026 -0600

    autest: expand server port placeholders in string remap entries
    
    ATSReplayTest only expanded {SERVER_HTTP_PORT} and {SERVER_HTTPS_PORT} for
    the dictionary form of a remap_config entry; the string form was written to
    remap.config verbatim. A rule needing the origin's dynamic port could
    therefore only be written in the dictionary form, which hardcodes "map" as
    the verb and so cannot express regex_map or any other remap directive.
---
 tests/gold_tests/autest-site/ats_replay.test.ext | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/gold_tests/autest-site/ats_replay.test.ext b/tests/gold_tests/autest-site/ats_replay.test.ext
index b3628fbb1d..9c0ec55557 100644
--- a/tests/gold_tests/autest-site/ats_replay.test.ext
+++ b/tests/gold_tests/autest-site/ats_replay.test.ext
@@ -65,6 +65,8 @@ def configure_ats(obj: 'TestRun', server: 'Process', ats_config: dict, dns: Opti
     remap_config = ats_config.get('remap_config', [])
     for remap_entry in remap_config:
         if isinstance(remap_entry, str):
+            remap_entry = remap_entry.replace('{SERVER_HTTP_PORT}', str(server.Variables.http_port))
+            remap_entry = remap_entry.replace('{SERVER_HTTPS_PORT}', str(server.Variables.https_port))
             ts.Disk.remap_config.AddLine(remap_entry)
         elif isinstance(remap_entry, dict):
             from_url = remap_entry['from']