]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: move cert import into rgw task 54856/head
authorAli Maredia <amaredia@redhat.com>
Mon, 12 Feb 2024 23:25:17 +0000 (18:25 -0500)
committerAli Maredia <amaredia@redhat.com>
Wed, 14 Feb 2024 18:04:35 +0000 (13:04 -0500)
Signed-off-by: Ali Maredia <amaredia@redhat.com>
qa/tasks/rgw.py
qa/tasks/s3tests_java.py

index e733b73c61e48a94d9e35f1f14b6827c906bfe81..fef38e505f309e971cb40604fea388b8cf0352b0 100644 (file)
@@ -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)
 
index 78a1edb6f613d1d03a6c1267a86b8c924057705e..3e20e10d06cacad0e41764bc4d2c8bd7651be2bb 100644 (file)
@@ -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.