From: John Mulligan Date: Thu, 12 Mar 2026 22:42:59 +0000 (-0400) Subject: mgr/cephadm: add unit test to check smb service get_dependencies call X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e9dbee4f8be4e0866e3994efed2e82df5c107228;p=ceph.git mgr/cephadm: add unit test to check smb service get_dependencies call Signed-off-by: John Mulligan --- diff --git a/src/pybind/mgr/cephadm/tests/services/test_smb.py b/src/pybind/mgr/cephadm/tests/services/test_smb.py index e55be55f5435..70f999a03554 100644 --- a/src/pybind/mgr/cephadm/tests/services/test_smb.py +++ b/src/pybind/mgr/cephadm/tests/services/test_smb.py @@ -1,7 +1,7 @@ import json from unittest.mock import patch -from cephadm.services.smb import SMBSpec +from cephadm.services.smb import SMBSpec, SMBExternalCephCluster from cephadm.module import CephadmOrchestrator from cephadm.tests.fixtures import with_host, with_service, async_side_effect @@ -148,3 +148,35 @@ class TestSMB: error_ok=True, use_current_daemon_image=False, ) + + +def test_smb_get_dependencies(cephadm_module): + from cephadm.services.smb import SMBService + + spec = SMBSpec( + cluster_id='foxtrot', + features=['domain'], + config_uri='rados://.smb/foxtrot/config2.json', + join_sources=[ + 'rados:mon-config-key:smb/config/foxtrot/join2.json', + ], + include_ceph_users=[ + 'client.smb.fs.cephfs.share1', + 'client.smb.fs.cephfs.share2', + 'client.smb.fs.fs2.share3', + ], + ceph_cluster_configs=[ + SMBExternalCephCluster( + alias="exo", + fsid='cf05db31-3d4e-4ffd-85ad-753434d5add1', + mon_host='[v2:192.168.76.200:3300/0,v1:192.168.76.200:6789/0]', + user='client.smb.remote1', + key='AQBAAK9ptYayIRAAQ1Bcpti9yMvX2Gl0KMmc4Q==' + ) + ] + ) + + deps = SMBService.get_dependencies(cephadm_module, spec, spec.service_type) + assert deps == [ + 'smb+meta:ceph_cluster_config.exo=sha256:859b001f76df4d184b858b9c3e323ca8ff85a311414d0405f4484d17aa481ef3' + ]