From: Ali Maredia Date: Mon, 12 Feb 2024 23:25:17 +0000 (-0500) Subject: qa: move cert import into rgw task X-Git-Tag: testing/wip-xiubli-testing-20240812.080715-reef~11^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=34d2c060de1f5fd21e7debf3a2226626291462e0;p=ceph-ci.git qa: move cert import into rgw task Signed-off-by: Ali Maredia (cherry picked from commit ccbb1f5aa9c970ca1d2a15690543f8039566d2ae) --- diff --git a/qa/tasks/rgw.py b/qa/tasks/rgw.py index a8aa3150440..23fffc3fb2f 100644 --- a/qa/tasks/rgw.py +++ b/qa/tasks/rgw.py @@ -1,6 +1,7 @@ """ rgw routines """ +from io import BytesIO import argparse import contextlib import logging @@ -80,6 +81,21 @@ def start_rgw(ctx, config, clients): # add the ssl certificate path frontends += ' ssl_certificate={}'.format(endpoint.cert.certificate) frontends += ' ssl_port={}'.format(endpoint.port) + path = 'lib/security/cacerts' + ctx.cluster.only(client).run( + args=['sudo', + 'keytool', + '-import', '-alias', '{alias}'.format( + alias=endpoint.hostname), + '-keystore', + run.Raw( + '$(readlink -e $(dirname $(readlink -e $(which keytool)))/../{path})'.format(path=path)), + '-file', endpoint.cert.certificate, + '-storepass', 'changeit', + ], + stdout=BytesIO() + ) + else: frontends += ' port={}'.format(endpoint.port) diff --git a/qa/tasks/s3tests_java.py b/qa/tasks/s3tests_java.py index dbe03921c60..6aa88c12e2f 100644 --- a/qa/tasks/s3tests_java.py +++ b/qa/tasks/s3tests_java.py @@ -159,23 +159,6 @@ class S3tests_java(Task): stdout=BytesIO() ) - endpoint = self.ctx.rgw.role_endpoints[client] - if endpoint.cert: - path = 'lib/security/cacerts' - self.ctx.cluster.only(client).run( - args=['sudo', - 'keytool', - '-import', '-alias', '{alias}'.format( - alias=endpoint.hostname), - '-keystore', - run.Raw( - '$(readlink -e $(dirname $(readlink -e $(which keytool)))/../{path})'.format(path=path)), - '-file', endpoint.cert.certificate, - '-storepass', 'changeit', - ], - stdout=BytesIO() - ) - def create_users(self): """ Create a main and an alternative s3 user.