]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks: embed use of ssh_keys task in smb workunit
authorJohn Mulligan <jmulligan@redhat.com>
Wed, 7 Jan 2026 23:02:21 +0000 (18:02 -0500)
committerJohn Mulligan <jmulligan@redhat.com>
Thu, 29 Jan 2026 17:07:04 +0000 (12:07 -0500)
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 <jmulligan@redhat.com>
qa/tasks/smb.py

index adc64d05ec1992de73ef044ee5b9c1091e61f760..ea226cc1aae14dce1107f3b903fdf1898fe03657 100644 (file)
@@ -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)