qa/task/ceph.py: set-allow-crimson for crimson clusters

Signed-off-by: Samuel Just <sjust@redhat.com>
This commit is contained in:
Samuel Just 2022-10-10 00:36:17 +00:00
parent 8020ef3793
commit 0449a4093e

View File

@ -376,6 +376,24 @@ def crush_setup(ctx, config):
yield
@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'])
@ -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]
@ -1882,6 +1904,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),