From: John Mulligan Date: Mon, 20 Apr 2026 20:11:51 +0000 (-0400) Subject: mgr/smb: add test cases for cluster rm w/ wildcard/recursive X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d4528552285417794f70290dec148232f14564a8;p=ceph.git mgr/smb: add test cases for cluster rm w/ wildcard/recursive Signed-off-by: John Mulligan --- diff --git a/src/pybind/mgr/smb/tests/test_smb.py b/src/pybind/mgr/smb/tests/test_smb.py index 10a6ee547808..54f9fb19fae5 100644 --- a/src/pybind/mgr/smb/tests/test_smb.py +++ b/src/pybind/mgr/smb/tests/test_smb.py @@ -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)