bneradt commented on code in PR #12540:
URL: https://github.com/apache/trafficserver/pull/12540#discussion_r2408646102


##########
tests/gold_tests/remap/remap_acl.test.py:
##########
@@ -104,9 +124,64 @@ def _configure_traffic_server(self, tr: 'TestRun', 
proxy_protocol: bool) -> None
         for name, _ in self._named_acls:
             remap_config_lines.append(f'.activatefilter {name}')
 
-        remap_config_lines.append(f'map / 
http://127.0.0.1:{self._server.Variables.http_port} {self._acl_configuration}')
-        ts.Disk.remap_config.AddLines(remap_config_lines)
-        ts.Disk.ip_allow_yaml.AddLines(self._ip_allow_content.split("\n"))
+        remap_config_lines.append(f'map / http://127.0.0.1:{server_port} 
{self._acl_configuration}')
+
+        if call_reload:
+            #
+            # Update the ATS configuration.
+            #
+            tr = Test.AddTestRun("Change the ATS configuration")
+            p = tr.Processes.Default
+            p.Command = (
+                f'traffic_ctl config set proxy.config.http.connect_ports 
{server_port} && '
+                f'traffic_ctl config set 
proxy.config.url_remap.acl_behavior_policy {self._acl_behavior_policy}')
+
+            p.Env = ts.Env
+            tr.StillRunningAfter = ts
+
+            remap_cfg_path = os.path.join(ts.Variables.CONFIGDIR, 
'remap.config')
+            ip_allow_path = os.path.join(ts.Variables.CONFIGDIR, 
'ip_allow.yaml')
+            p.Setup.Lambda(
+                lambda: update_config_file(
+                    remap_cfg_path, '\n'.join(remap_config_lines), 
ip_allow_path, '\n'.join(self._ip_allow_lines)))
+

Review Comment:
   This is the heart of this patch:
   * For the first test run, start ATS via MakeATSProcess (see the `else:` 
below this).
   * For subsequent test runs, update the config and do a config reload instead 
of starting a new test process. Doing a config reload is faster than starting a 
brand new ATS process for every test run.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to