]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/rgw - run sse-s3 test cases only if configured or requested 44494/head
authorMarcus Watts <mwatts@redhat.com>
Wed, 27 Apr 2022 22:50:56 +0000 (18:50 -0400)
committerMarcus Watts <mwatts@redhat.com>
Thu, 28 Apr 2022 01:14:55 +0000 (21:14 -0400)
This commit adds logic to automatically detect when sse-s3 is
available and if not, disables sse-s3 tests by default.
Configuration opions are provided to override the default either way.

Signed-off-by: Marcus Watts <mwatts@redhat.com>
qa/tasks/ceph_manager.py
qa/tasks/s3tests.py

index 51d802cd7ce9d53cf7278863711465aff32aa03d..8768a40e4f28d56fd0bc03d0d3fbfeebdaa32240 100644 (file)
@@ -14,6 +14,7 @@ import logging
 import threading
 import traceback
 import os
+import re
 import shlex
 
 from io import BytesIO, StringIO
@@ -70,6 +71,14 @@ def write_conf(ctx, conf_path=DEFAULT_CONF_PATH, cluster='ceph'):
     conf_fp = BytesIO()
     ctx.ceph[cluster].conf.write(conf_fp)
     conf_fp.seek(0)
+    lines = conf_fp.readlines()
+    m = None
+    for l in lines:
+     m = re.search("rgw.crypt.sse.s3.backend *= *(.*)", l.decode())
+     if m:
+      break
+    ctx.ceph[cluster].rgw_crypt_sse_s3_backend = m.expand("\\1") if m else None
+    conf_fp.seek(0)
     writes = ctx.cluster.run(
         args=[
             'sudo', 'mkdir', '-p', '/etc/ceph', run.Raw('&&'),
index e5238563f4e385e4d2563e81419fd53b9d71675b..a92b737728762527514a3348e94f73ff40c8fc7d 100644 (file)
@@ -416,6 +416,7 @@ def run_tests(ctx, config):
     testdir = teuthology.get_testdir(ctx)
     for client, client_config in config.items():
         client_config = client_config or {}
+        (cluster_name,_,_) = teuthology.split_role(client)
         (remote,) = ctx.cluster.only(client).remotes.keys()
         args = [
             'S3TEST_CONF={tdir}/archive/s3-tests.{client}.conf'.format(tdir=testdir, client=client),
@@ -434,6 +435,10 @@ def run_tests(ctx, config):
             attrs += ['!fails_with_subdomain']
         if client_config.get('without-sse-s3'):
             attrs += ['!sse-s3']
+        elif client_config.get('with-sse-s3'):
+            pass
+        elif ctx.ceph[cluster_name].rgw_crypt_sse_s3_backend is None:
+            attrs += ['!sse-s3']
        
         if 'extra_attrs' in client_config:
             attrs = client_config.get('extra_attrs')