From: John Mulligan Date: Wed, 7 Jan 2026 23:02:21 +0000 (-0500) Subject: qa/tasks: embed use of ssh_keys task in smb workunit X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9383728125a343aa50b165baf5b50bf2664d91bb;p=ceph.git qa/tasks: embed use of ssh_keys task in smb workunit Automatically use the ssh_keys tasks in the smb workunit task. It can be disabled by passing false to `ssh_keys:` config key. This allows the node running the tests to ssh into the node where cephadm is installed in order to execute commands within the cephadm shell. Signed-off-by: John Mulligan --- diff --git a/qa/tasks/smb.py b/qa/tasks/smb.py index adc64d05ec19..ea226cc1aae1 100644 --- a/qa/tasks/smb.py +++ b/qa/tasks/smb.py @@ -10,6 +10,7 @@ import shlex import time from teuthology.exceptions import ConfigError, CommandFailedError +from teuthology.task import ssh_keys log = logging.getLogger(__name__) @@ -372,8 +373,13 @@ def workunit(ctx, config): _config['no_coverage_and_limits'] = config.get( 'no_coverage_and_limits', True ) + _ssh_keys_config = config.get('ssh_keys', {}) + _config['enable_ssh_keys'] = _ssh_keys_config not in (False, None) log.info('Passing workunit config: %r', _config) - with write_metadata_file(ctx, _config): + with contextlib.ExitStack() as estack: + if _config['enable_ssh_keys']: + estack.enter_context(ssh_keys.task(ctx, _ssh_keys_config)) + estack.enter_context(write_metadata_file(ctx, _config)) return workunit.task(ctx, _config)