Skip to content

Commit

Permalink
test: create directory for certs before copying
Browse files Browse the repository at this point in the history
If the directory in which certs are copied to does not exist then an
error will be thrown. This PR ensure the target directory exists before
copying the cert files.

Fixes: #4552

Signed-off-by: Noah Watkins <noah@redpanda.com>
  • Loading branch information
dotnwat committed May 5, 2022
1 parent 0f69d67 commit 42091f2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/rptest/services/redpanda.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,18 +645,24 @@ def write_tls_certs(self):
f"Writing Redpanda node tls key file: {RedpandaService.TLS_SERVER_KEY_FILE}"
)
self.logger.debug(open(cert.key, "r").read())
node.account.mkdirs(
os.path.dirname(RedpandaService.TLS_SERVER_KEY_FILE))
node.account.copy_to(cert.key, RedpandaService.TLS_SERVER_KEY_FILE)

self.logger.info(
f"Writing Redpanda node tls cert file: {RedpandaService.TLS_SERVER_CRT_FILE}"
)
self.logger.debug(open(cert.crt, "r").read())
node.account.mkdirs(
os.path.dirname(RedpandaService.TLS_SERVER_CRT_FILE))
node.account.copy_to(cert.crt, RedpandaService.TLS_SERVER_CRT_FILE)

self.logger.info(
f"Writing Redpanda node tls ca cert file: {RedpandaService.TLS_CA_CRT_FILE}"
)
self.logger.debug(open(ca.crt, "r").read())
node.account.mkdirs(
os.path.dirname(RedpandaService.TLS_CA_CRT_FILE))
node.account.copy_to(ca.crt, RedpandaService.TLS_CA_CRT_FILE)

def security_config(self):
Expand Down

0 comments on commit 42091f2

Please sign in to comment.