samba-gpupdate: Test that sysvol paths download in case-insensitive way
authorDavid Mulder <dmulder@suse.com>
Tue, 9 Mar 2021 19:30:14 +0000 (12:30 -0700)
committerBjörn Baumbach <bb@sernet.de>
Thu, 11 Mar 2021 20:29:41 +0000 (20:29 +0000)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=14665

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Björn Baumbach <bb@sernet.de>
python/samba/tests/gpo.py
selftest/knownfail.d/gpo [new file with mode: 0644]

index dfd2394f353ac0bd5f5159badd60ec9b226876d6..b5d195b044587ccc326bbd17fcb3024ce2634946 100644 (file)
@@ -188,6 +188,16 @@ class GPOTests(tests.TestCase):
         self.assertEqual(result, after, 'check_safe_path() didn\'t'
                           ' correctly convert \\ to /')
 
+    def test_check_safe_path_typesafe_name(self):
+        path = '\\\\toady.suse.de\\SysVol\\toady.suse.de\\Policies\\' \
+               '{31B2F340-016D-11D2-945F-00C04FB984F9}\\GPT.INI'
+        expected_path = 'toady.suse.de/Policies/' \
+                        '{31B2F340-016D-11D2-945F-00C04FB984F9}/GPT.INI'
+
+        result = check_safe_path(path)
+        self.assertEqual(result, expected_path,
+            'check_safe_path unable to detect variable case sysvol components')
+
     def test_gpt_ext_register(self):
         this_path = os.path.dirname(os.path.realpath(__file__))
         samba_path = os.path.realpath(os.path.join(this_path, '../../../'))
diff --git a/selftest/knownfail.d/gpo b/selftest/knownfail.d/gpo
new file mode 100644 (file)
index 0000000..a1c0ac4
--- /dev/null
@@ -0,0 +1 @@
+^samba.tests.gpo.samba.tests.gpo.GPOTests.test_check_safe_path_typesafe_name