From 9235cf95c1ef976af6d5a1aa7919b135066d7208 Mon Sep 17 00:00:00 2001 From: Marcus Watts Date: Wed, 27 Apr 2022 18:50:56 -0400 Subject: [PATCH] qa/rgw - run sse-s3 test cases only if configured or requested 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 --- qa/tasks/ceph_manager.py | 9 +++++++++ qa/tasks/s3tests.py | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/qa/tasks/ceph_manager.py b/qa/tasks/ceph_manager.py index 51d802cd7ce9..8768a40e4f28 100644 --- a/qa/tasks/ceph_manager.py +++ b/qa/tasks/ceph_manager.py @@ -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('&&'), diff --git a/qa/tasks/s3tests.py b/qa/tasks/s3tests.py index e5238563f4e3..a92b73772876 100644 --- a/qa/tasks/s3tests.py +++ b/qa/tasks/s3tests.py @@ -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') -- 2.47.3