samba-tool: Test gpo show/load handling of utf-16-le strings
authorDavid Mulder <dmulder@suse.com>
Thu, 24 Mar 2022 17:35:02 +0000 (11:35 -0600)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 30 Jan 2023 09:00:39 +0000 (09:00 +0000)
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Tested-by: Kees van Vloten <keesvanvloten@gmail.com>
python/samba/tests/samba_tool/gpo.py

index 9849207fbe4b09ae83790f94328b4a3d9c9d1820..ae19a57371103e53d95c19c2e137c15a2085bd51 100644 (file)
@@ -65,6 +65,17 @@ b"""
         "class": "USER",
         "type": "REG_DWORD",
         "data": 1
+    },
+    {
+        "keyname": "Software\\\\Policies\\\\Mozilla\\\\Firefox",
+        "valuename": "ExtensionSettings",
+        "class": "MACHINE",
+        "type": "REG_MULTI_SZ",
+        "data": [
+            "{",
+            "   \\"key\\": \\"value\\"",
+            "}"
+        ]
     }
 ]
 """
@@ -91,6 +102,11 @@ b"""
         "keyname": "Software\\\\Policies\\\\Microsoft\\\\InputPersonalization",
         "valuename": "RestrictImplicitTextCollection",
         "class": "USER"
+    },
+    {
+        "keyname": "Software\\\\Policies\\\\Mozilla\\\\Firefox",
+        "valuename": "ExtensionSettings",
+        "class": "MACHINE"
     }
 ]
 """
@@ -1615,6 +1631,8 @@ class GpoCmdTestCase(SambaToolCmdTest):
                         '\n        "class": "USER",' + \
                         '\n        "type": "REG_DWORD",\n        "data": 1\n'
         self.assertIn(restrict_data, out, 'Restrict policy not loaded')
+        ext_data = '"   \\"key\\": \\"value\\"",'
+        self.assertIn(ext_data, out, 'Extension policy not loaded')
 
         with NamedTemporaryFile() as f:
             f.write(gpo_remove_json)