masaori335 commented on code in PR #13848:
URL: https://github.com/apache/trafficserver/pull/13848#discussion_r4570353898
##########
tests/gold_tests/autest-site/ats_replay.test.ext:
##########
@@ -150,6 +150,15 @@ def configure_ats(obj: 'TestRun', server: 'Process',
ats_config: dict, dns: Opti
parent_line = parent_line.replace('{SERVER_HTTPS_PORT}',
str(server.Variables.https_port))
ts.Disk.parent_config.AddLine(parent_line)
+ # Configure strategies.yaml if specified.
+ strategies_yaml = ats_config.get('strategies_yaml')
+ if strategies_yaml is not None:
+ strategies_text = yaml.dump(strategies_yaml)
+ strategies_text = strategies_text.replace('{SERVER_HTTP_PORT}',
str(server.Variables.http_port))
+ strategies_text = strategies_text.replace('{SERVER_HTTPS_PORT}',
str(server.Variables.https_port))
+ ts.Disk.File(ts.Variables.CONFIGDIR + "/strategies.yaml",
id="strategies_yaml", typename="ats:config")
+ ts.Disk.strategies_yaml.AddLines(strategies_text.split('\n'))
Review Comment:
The input comes from yaml.safe_load, so only plain types reach yaml.dump,
and the strategies loader doesn't depend on key order. This follows the
sni_yaml / logging_yaml / storage_yaml handling a few lines away; I'd rather
keep them consistent and change all four separately if needed.
##########
tests/gold_tests/autest-site/ats_replay.test.ext:
##########
@@ -150,6 +150,15 @@ def configure_ats(obj: 'TestRun', server: 'Process',
ats_config: dict, dns: Opti
parent_line = parent_line.replace('{SERVER_HTTPS_PORT}',
str(server.Variables.https_port))
ts.Disk.parent_config.AddLine(parent_line)
+ # Configure strategies.yaml if specified.
+ strategies_yaml = ats_config.get('strategies_yaml')
+ if strategies_yaml is not None:
+ strategies_text = yaml.dump(strategies_yaml)
+ strategies_text = strategies_text.replace('{SERVER_HTTP_PORT}',
str(server.Variables.http_port))
+ strategies_text = strategies_text.replace('{SERVER_HTTPS_PORT}',
str(server.Variables.https_port))
+ ts.Disk.File(ts.Variables.CONFIGDIR + "/strategies.yaml",
id="strategies_yaml", typename="ats:config")
Review Comment:
Switched to os.path.join in 651d2dcd31, matching how the same file builds
its other CONFIGDIR paths.
--
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]