summaryrefslogtreecommitdiffstats
path: root/qa/tasks/ceph.py
diff options
context:
space:
mode:
authorSamuel Just <sjust@redhat.com>2023-02-24 03:39:27 +0100
committerGitHub <noreply@github.com>2023-02-24 03:39:27 +0100
commitacedd169e42d5b579ef303bc00e387898d9277eb (patch)
tree6508cd994b9bcd0cfc5f216923fcee69a0a2596c /qa/tasks/ceph.py
parentMerge pull request #50246 from zdover23/wip-doc-2023-02-24-glossary-bucket-2 (diff)
parenttest/librados: SKIP_IF_CRIMSON remaining ec/cache tests (diff)
downloadceph-acedd169e42d5b579ef303bc00e387898d9277eb.tar.xz
ceph-acedd169e42d5b579ef303bc00e387898d9277eb.zip
Merge pull request #48516 from athanatos/sjust/wip-57801
crimson,mon: add guards to avoid accidental crimson deployment and to avoid usage of unsupported features with crimson Reviewed-by: Radoslaw Zarzynski <rzarzyns@redhat.com> Reviewed-by: Greg Farnum <gfarnum@redhat.com>
Diffstat (limited to 'qa/tasks/ceph.py')
-rw-r--r--qa/tasks/ceph.py27
1 files changed, 25 insertions, 2 deletions
diff --git a/qa/tasks/ceph.py b/qa/tasks/ceph.py
index 08d66e60d4c..35b52fbf552 100644
--- a/qa/tasks/ceph.py
+++ b/qa/tasks/ceph.py
@@ -377,6 +377,24 @@ def crush_setup(ctx, config):
@contextlib.contextmanager
+def check_enable_crimson(ctx, config):
+ # enable crimson-osds if crimson
+ log.info("check_enable_crimson: {}".format(is_crimson(config)))
+ if is_crimson(config):
+ cluster_name = config['cluster']
+ first_mon = teuthology.get_first_mon(ctx, config, cluster_name)
+ (mon_remote,) = ctx.cluster.only(first_mon).remotes.keys()
+ log.info('check_enable_crimson: setting set-allow-crimson')
+ mon_remote.run(
+ args=[
+ 'sudo', 'ceph', '--cluster', cluster_name,
+ 'osd', 'set-allow-crimson', '--yes-i-really-mean-it'
+ ]
+ )
+ yield
+
+
+@contextlib.contextmanager
def setup_manager(ctx, config):
first_mon = teuthology.get_first_mon(ctx, config, config['cluster'])
(mon,) = ctx.cluster.only(first_mon).remotes.keys()
@@ -597,9 +615,12 @@ def create_simple_monmap(ctx, remote, conf, mons,
return fsid
+def is_crimson(config):
+ return config.get('flavor', 'default') == 'crimson'
+
+
def maybe_redirect_stderr(config, type_, args, log_path):
- if type_ == 'osd' and \
- config.get('flavor', 'default') == 'crimson':
+ if type_ == 'osd' and is_crimson(config):
# teuthworker uses ubuntu:ubuntu to access the test nodes
create_log_cmd = \
f'sudo install -b -o ubuntu -g ubuntu /dev/null {log_path}'
@@ -870,6 +891,7 @@ def cluster(ctx, config):
teuthology.deep_merge(ctx.disk_config.remote_to_roles_to_dev, remote_to_roles_to_devs)
log.info("ctx.disk_config.remote_to_roles_to_dev: {r}".format(r=str(ctx.disk_config.remote_to_roles_to_dev)))
+
for remote, roles_for_host in osds.remotes.items():
roles_to_devs = remote_to_roles_to_devs[remote]
@@ -1896,6 +1918,7 @@ def task(ctx, config):
lambda: run_daemon(ctx=ctx, config=config, type_='mon'),
lambda: run_daemon(ctx=ctx, config=config, type_='mgr'),
lambda: crush_setup(ctx=ctx, config=config),
+ lambda: check_enable_crimson(ctx=ctx, config=config),
lambda: run_daemon(ctx=ctx, config=config, type_='osd'),
lambda: setup_manager(ctx=ctx, config=config),
lambda: create_rbd_pool(ctx=ctx, config=config),