]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: add unit test to check smb service get_dependencies call 68164/head
authorJohn Mulligan <jmulligan@redhat.com>
Thu, 12 Mar 2026 22:42:59 +0000 (18:42 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Wed, 1 Apr 2026 15:13:25 +0000 (11:13 -0400)
Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/pybind/mgr/cephadm/tests/services/test_smb.py

index e55be55f543507bda6a8c41a8f7130d347a381dc..70f999a03554b886a5bfb925a538f8984e764862 100644 (file)
@@ -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'
+    ]