From: David Mulder Date: Wed, 19 Aug 2020 19:02:48 +0000 (-0600) Subject: GPO: Test rsop output for smb.conf policy X-Git-Tag: talloc-2.3.2~695 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=101b5f17f129cbbc2689de2dcc8d6e6cb164e270;p=thirdparty%2Fsamba.git GPO: Test rsop output for smb.conf policy Signed-off-by: David Mulder Reviewed-by: Douglas Bagnall --- 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) diff --git a/selftest/knownfail.d/gpo b/selftest/knownfail.d/gpo new file mode 100644 index 00000000000..b1c8285117f --- /dev/null +++ b/selftest/knownfail.d/gpo @@ -0,0 +1 @@ +samba.tests.gpo.samba.tests.gpo.GPOTests.test_rsop