Copilot commented on code in PR #13342: URL: https://github.com/apache/trafficserver/pull/13342#discussion_r3510290996
########## tests/gold_tests/tls/tls_secret_update_default.test.py: ########## @@ -0,0 +1,151 @@ +''' +Test default server certificate updates through TSSslSecretSet/TSSslSecretUpdate. +''' +# 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. + +import os + +Test.Summary = ''' +Verify that secret updates refresh the default server SSL_CTX used without SNI. +''' + + +class TestDefaultSecretUpdate: + '''Verify default server certificate updates through the secret API.''' + + initial_cert = 'signed-bar.pem' + updated_cert = 'signed2-bar.pem' + key_file = 'signed-bar.key' + plugin = 'ssl_secret_load_test.so' + + def __init__(self): + '''Configure the ATS process, origin server, and test runs.''' + self._configure_server() + self._configure_traffic_server() + self._add_initial_certificate_run() + self._add_mtime_delay_run() + self._add_certificate_update_run() + self._add_secret_update_wait_run() + self._add_updated_certificate_run() + + def _configure_server(self): + '''Configure the origin server.''' + server = Test.MakeOriginServer('server') + self._server = server + + request_header = {'headers': 'GET / HTTP/1.1\r\nHost: doesnotmatter\r\n\r\n', 'timestamp': '1469733493.993', 'body': ''} + response_header = {'headers': 'HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n', 'timestamp': '1469733493.993', 'body': ''} + server.addResponse('sessionlog.json', request_header, response_header) + return server + + def _configure_traffic_server(self): + '''Configure the Traffic Server process.''' + ts = Test.MakeATSProcess('ts', enable_tls=True) + self._ts = ts + + ts.addSSLfile(f'ssl/{self.initial_cert}') + ts.addSSLfile(f'ssl/{self.updated_cert}') + ts.addSSLfile(f'ssl/{self.key_file}') + Test.PrepareTestPlugin(os.path.join(Test.Variables.AtsTestPluginsDir, self.plugin), ts) + + ts.Disk.records_config.update( + { + 'proxy.config.diags.debug.enabled': 1, + 'proxy.config.diags.debug.tags': 'ssl_secret_load_test|ssl|ssl_config_updateCTX', + 'proxy.config.ssl.server.cert.path': f'{ts.Variables.SSLDir}/../', + 'proxy.config.ssl.server.private_key.path': f'{ts.Variables.SSLDir}/../', Review Comment: The test config points `proxy.config.ssl.server.cert.path` and `proxy.config.ssl.server.private_key.path` at `SSLDir/../`, but the test copies the cert/key into `ts.Variables.SSLDir` and `ssl_multicert.yaml` references filenames without a subdirectory. This is inconsistent with other TLS gold tests and is likely to make ATS look in the wrong directory for the default cert/key during startup/refresh. -- 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]
