]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
GPO: Test rsop output for Messages policy
authorDavid Mulder <dmulder@suse.com>
Wed, 19 Aug 2020 17:25:57 +0000 (11:25 -0600)
committerDavid Mulder <dmulder@samba.org>
Thu, 27 Aug 2020 15:59:34 +0000 (15:59 +0000)
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/tests/gpo.py
selftest/knownfail.d/gpo [new file with mode: 0644]

index 82fdd50eaceb632a4a330b1de8a9a931b11fe668..a25f1a48875ae3e74cb1896731c3557bc71bb2f4 100644 (file)
@@ -487,6 +487,7 @@ class GPOTests(tests.TestCase):
         gp_extensions.append(gp_scripts_ext)
         gp_extensions.append(gp_sudoers_ext)
         gp_extensions.append(gp_smb_conf_ext)
+        gp_extensions.append(gp_msgs_ext)
 
         # Create registry stage data
         reg_pol = os.path.join(local_path, policies, '%s/MACHINE/REGISTRY.POL')
@@ -506,8 +507,13 @@ class GPOTests(tests.TestCase):
         e3.type = 4
         e3.data = 1
         e3.valuename = 'apply group policies'
-        reg_stage.num_entries = 3
-        reg_stage.entries = [e, e2, e3]
+        e4 = preg.entry()
+        e4.keyname = b'Software\\Policies\\Samba\\Unix Settings\\Messages'
+        e4.valuename = b'issue'
+        e4.type = 1
+        e4.data = b'Welcome to \\s \\r \\l'
+        reg_stage.num_entries = 4
+        reg_stage.entries = [e, e2, e3, e4]
 
         # Create krb stage date
         gpofile = os.path.join(local_path, policies, '%s/MACHINE/MICROSOFT/' \
@@ -556,6 +562,12 @@ class GPOTests(tests.TestCase):
                                   'apply group policies was not applied')
                     self.assertEquals(ret['smb.conf'][e3.valuename], e3.data,
                                       'apply group policies was not set')
+                # Check the Messages Extension
+                elif type(ext) == gp_msgs_ext:
+                    self.assertIn('/etc/issue', ret,
+                                  'Login Prompt Message not applied')
+                    self.assertEquals(ret['/etc/issue'], e4.data,
+                                      'Login Prompt Message 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 (file)
index 0000000..b1c8285
--- /dev/null
@@ -0,0 +1 @@
+samba.tests.gpo.samba.tests.gpo.GPOTests.test_rsop