]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/smb: add test cases for cluster rm w/ wildcard/recursive
authorJohn Mulligan <jmulligan@redhat.com>
Mon, 20 Apr 2026 20:11:51 +0000 (16:11 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Wed, 6 May 2026 19:44:14 +0000 (15:44 -0400)
Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/pybind/mgr/smb/tests/test_smb.py

index 10a6ee5478083e2e926e08197f6f8a696162127c..54f9fb19fae567ea456797fba5f87e0f2b11f98e 100644 (file)
@@ -1302,3 +1302,25 @@ def test_share_rm_wildcard_no_match(tmodule):
 
     with pytest.raises(smb.cli.NoMatchingValue):
         tmodule.share_rm('foo', 'q*', wildcard=True)
+
+
+def test_cluster_rm_recursive(tmodule):
+    _example_cfg_1(tmodule)
+
+    result = tmodule.cluster_rm('foo', recursive=True)
+    assert result.success
+
+
+def test_cluster_rm_recursive_wildcard(tmodule):
+    _example_cfg_1(tmodule)
+
+    result = tmodule.cluster_rm('*', recursive=True, wildcard=True)
+    assert result.success
+    assert len(list(result)) == 3  # 1 cluster + 2 share
+
+
+def test_cluster_rm_wildcard_no_match(tmodule):
+    _example_cfg_1(tmodule)
+
+    with pytest.raises(smb.cli.NoMatchingValue):
+        tmodule.cluster_rm('gonk', wildcard=True)