1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-14 20:23:54 +03:00

lib/smbconf: add delete_share method to SMBConf

Add a delete_share method wrapping smbconf_delete_share.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
John Mulligan
2022-04-24 10:25:50 -04:00
committed by Jeremy Allison
parent 35df07d5ca
commit 7e4bc41983
2 changed files with 36 additions and 0 deletions

View File

@@ -171,6 +171,19 @@ class SMBConfTests(samba.tests.TestCase):
s1, ("global", [("workgroup", "EXAMPLE"), ("x:custom", "fake")])
)
def test_delete_share(self):
sconf = self.s3smbconf.init_reg(None)
sconf.drop()
sconf.create_share("alice")
sconf.create_share("bob")
names = sconf.share_names()
self.assertEqual(names, ["alice", "bob"])
sconf.delete_share("alice")
names = sconf.share_names()
self.assertEqual(names, ["bob"])
if __name__ == "__main__":
import unittest