summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorDavid Mulder <dmulder@suse.com>2020-08-19 13:02:48 -0600
committerDavid Mulder <dmulder@samba.org>2020-08-27 15:59:34 +0000
commit101b5f17f129cbbc2689de2dcc8d6e6cb164e270 (patch)
tree6a4bd9e71c665011e95e1a1c7794ec57062e8479 /python
parent3303869c4b8659904e490e4ca1bc8bbcd340138d (diff)
downloadsamba-101b5f17f129cbbc2689de2dcc8d6e6cb164e270.tar.gz
GPO: Test rsop output for smb.conf policy
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Diffstat (limited to 'python')
-rw-r--r--python/samba/tests/gpo.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/python/samba/tests/gpo.py b/python/samba/tests/gpo.py
index 7bc6ff0a9b6..a2c1cd9de97 100644
--- a/python/samba/tests/gpo.py
+++ b/python/samba/tests/gpo.py
@@ -485,6 +485,7 @@ class GPOTests(tests.TestCase):
gp_extensions.append(gp_krb_ext)
gp_extensions.append(gp_scripts_ext)
gp_extensions.append(gp_sudoers_ext)
+ gp_extensions.append(gp_smb_conf_ext)
# Create registry stage data
reg_pol = os.path.join(local_path, policies, '%s/MACHINE/REGISTRY.POL')
@@ -499,8 +500,13 @@ class GPOTests(tests.TestCase):
e2.valuename = b'Software\\Policies\\Samba\\Unix Settings'
e2.type = 1
e2.data = b'fakeu ALL=(ALL) NOPASSWD: ALL'
- reg_stage.num_entries = 2
- reg_stage.entries = [e, e2]
+ e3 = preg.entry()
+ e3.keyname = 'Software\\Policies\\Samba\\smb_conf\\apply group policies'
+ e3.type = 4
+ e3.data = 1
+ e3.valuename = 'apply group policies'
+ reg_stage.num_entries = 3
+ reg_stage.entries = [e, e2, e3]
# Create krb stage date
gpofile = os.path.join(local_path, policies, '%s/MACHINE/MICROSOFT/' \
@@ -541,6 +547,14 @@ class GPOTests(tests.TestCase):
self.assertIn('fakeu ALL=(ALL) NOPASSWD: ALL',
ret['Sudo Rights'],
'Sudoers policy not created')
+ # Check the smb.conf Extension
+ elif type(ext) == gp_smb_conf_ext:
+ self.assertIn('smb.conf', ret.keys(),
+ 'apply group policies was not applied')
+ self.assertIn(e3.valuename, ret['smb.conf'],
+ 'apply group policies was not applied')
+ self.assertEquals(ret['smb.conf'][e3.valuename], e3.data,
+ 'apply group policies was not set')
unstage_file(gpofile % g.name)
unstage_file(reg_pol % g.name)