CVE-2023-4154 dsdb/tests: Do not run SimpleDirsyncTests twice
authorAndrew Bartlett <abartlet@samba.org>
Sun, 6 Aug 2023 23:55:55 +0000 (11:55 +1200)
committerJule Anger <janger@samba.org>
Sun, 8 Oct 2023 20:06:18 +0000 (22:06 +0200)
To re-use setup code, the super-class must have no test_*() methods
otherwise these will be run as well as the class-local tests.

We rename tests that would otherwise have duplicate names

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15424

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
selftest/knownfail
source4/dsdb/tests/python/dirsync.py

index c6e0a242ecbdd8b86b25643630bb915183f1e67a..f1768a270b5247f543ba6552fd99386669f324e4 100644 (file)
 ^samba4.smb2.acls.*.inheritflags
 ^samba4.smb2.acls.*.owner
 ^samba4.smb2.acls.*.ACCESSBASED
-^samba4.ldap.dirsync.python.ad_dc_ntvfs..__main__.ExtendedDirsyncTests.test_dirsync_deleted_items
+^samba4.ldap.dirsync.python.ad_dc_ntvfs..__main__.SimpleDirsyncTests.test_dirsync_deleted_items_OBJECT_SECURITY
 #^samba4.ldap.dirsync.python.ad_dc_ntvfs..__main__.ExtendedDirsyncTests.*
 ^samba4.libsmbclient.opendir.(NT1|SMB3).opendir # This requires netbios browsing
 ^samba4.rpc.drsuapi.*.drsuapi.DsGetDomainControllerInfo\(.*\)$
index ca0947e2d21bec7680742bf7e3b5388fcbee71ee..ad136b7efeef08127bf039defd5f1b1691cad1e6 100755 (executable)
@@ -458,7 +458,7 @@ class SimpleDirsyncTests(DirsyncBaseTests):
         self.assertTrue(res[0].get("name") is not None)
         delete_force(self.ldb_admin, ouname)
 
-    def test_dirsync_linkedattributes(self):
+    def test_dirsync_linkedattributes_OBJECT_SECURITY(self):
         """Check that dirsync returned deleted objects too"""
         # Let's search for members
         self.ldb_simple = self.get_ldb_connection(self.simple_user, self.user_pass)
@@ -585,9 +585,6 @@ class SimpleDirsyncTests(DirsyncBaseTests):
                                     expression="(&(objectClass=organizationalUnit)(!(isDeleted=*)))",
                                     controls=controls)
 
-
-class ExtendedDirsyncTests(SimpleDirsyncTests):
-
     def test_dirsync_linkedattributes_range(self):
         self.ldb_simple = self.get_ldb_connection(self.simple_user, self.user_pass)
         res = self.ldb_admin.search(self.base_dn,
@@ -711,7 +708,7 @@ class ExtendedDirsyncTests(SimpleDirsyncTests):
         self.assertIn(b"<GUID=", resEX0[0]["member"][0])
         self.assertIn(b">;<SID=010500000000000515", resEX0[0]["member"][0])
 
-    def test_dirsync_deleted_items(self):
+    def test_dirsync_deleted_items_OBJECT_SECURITY(self):
         """Check that dirsync returned deleted objects too"""
         # Let's create an OU
         self.ldb_simple = self.get_ldb_connection(self.simple_user, self.user_pass)