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

lib/smbconf: add delete_global_parameter method to SMBConf

Add a delete_global_parameter method wrapping smbconf_delete_global_parameter.

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-25 10:16:56 -04:00
committed by Jeremy Allison
parent 64a36f5bf0
commit cc26fe829c
2 changed files with 49 additions and 0 deletions

View File

@@ -234,6 +234,31 @@ class SMBConfTests(samba.tests.TestCase):
),
)
def test_delete_global_parameter(self):
sconf = self.s3smbconf.init_reg(None)
sconf.drop()
sconf.set_global_parameter("workgroup", "EXAMPLE")
sconf.set_global_parameter("client min protocol", "NT1")
sconf.set_global_parameter("server min protocol", "SMB2")
s1 = sconf.get_share("global")
self.assertEqual(
s1,
(
"global",
[
("workgroup", "EXAMPLE"),
("client min protocol", "NT1"),
("server min protocol", "SMB2"),
],
),
)
sconf.delete_global_parameter("server min protocol")
sconf.delete_global_parameter("client min protocol")
s1 = sconf.get_share("global")
self.assertEqual(s1, ("global", [("workgroup", "EXAMPLE")]))
if __name__ == "__main__":
import unittest