From: John Mulligan Date: Mon, 20 Apr 2026 19:17:47 +0000 (-0400) Subject: mgr/smb: add unit tests to verify deleting shares by wildcard X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ee6ebce693d156f01edafdbb502b502677040b3a;p=ceph.git mgr/smb: add unit tests to verify deleting shares by wildcard 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 c9e2eec5a636..10a6ee547808 100644 --- a/src/pybind/mgr/smb/tests/test_smb.py +++ b/src/pybind/mgr/smb/tests/test_smb.py @@ -1279,3 +1279,26 @@ def test_share_fscrypt_config_error(tmodule, params): assert len(failures) == 1 failure = failures[0] assert params['expected'] in failure.msg + + +def test_share_rm_wildcard(tmodule): + _example_cfg_1(tmodule) + + result = tmodule.share_rm('foo', 's*', wildcard=True) + assert result.success + assert len(list(result)) == 2 + + +def test_share_rm_wildcard_one_match(tmodule): + _example_cfg_1(tmodule) + + result = tmodule.share_rm('foo', 'st*', wildcard=True) + assert result.success + assert len(list(result)) == 1 + + +def test_share_rm_wildcard_no_match(tmodule): + _example_cfg_1(tmodule) + + with pytest.raises(smb.cli.NoMatchingValue): + tmodule.share_rm('foo', 'q*', wildcard=True)