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

lib/smbconf: add set_global_parameter method to SMBConf

Add a set_global_parameter method wrapping smbconf_set_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-24 10:19:37 -04:00
committed by Jeremy Allison
parent 565d8ae8cd
commit 35df07d5ca
2 changed files with 37 additions and 0 deletions

View File

@@ -160,6 +160,17 @@ class SMBConfTests(samba.tests.TestCase):
s1, ("foobar", [("path", "/mnt/foobar"), ("browseable", "no")])
)
def test_set_global_parameter(self):
sconf = self.s3smbconf.init_reg(None)
sconf.drop()
sconf.set_global_parameter("workgroup", "EXAMPLE")
sconf.set_global_parameter("x:custom", "fake")
s1 = sconf.get_share("global")
self.assertEqual(
s1, ("global", [("workgroup", "EXAMPLE"), ("x:custom", "fake")])
)
if __name__ == "__main__":
import unittest