diff options
Diffstat (limited to 'source4/dsdb/tests/python')
-rwxr-xr-x | source4/dsdb/tests/python/acl.py | 2 | ||||
-rwxr-xr-x | source4/dsdb/tests/python/deletetest.py | 4 | ||||
-rwxr-xr-x | source4/dsdb/tests/python/dirsync.py | 8 | ||||
-rwxr-xr-x | source4/dsdb/tests/python/dsdb_schema_info.py | 4 | ||||
-rwxr-xr-x | source4/dsdb/tests/python/ldap.py | 18 | ||||
-rwxr-xr-x | source4/dsdb/tests/python/ldap_schema.py | 50 | ||||
-rwxr-xr-x | source4/dsdb/tests/python/ldap_syntaxes.py | 8 | ||||
-rw-r--r-- | source4/dsdb/tests/python/linked_attributes.py | 2 | ||||
-rw-r--r-- | source4/dsdb/tests/python/rodc_rwdc.py | 2 | ||||
-rwxr-xr-x | source4/dsdb/tests/python/sam.py | 20 | ||||
-rwxr-xr-x | source4/dsdb/tests/python/sec_descriptor.py | 8 | ||||
-rwxr-xr-x | source4/dsdb/tests/python/urgent_replication.py | 38 | ||||
-rwxr-xr-x | source4/dsdb/tests/python/user_account_control.py | 4 |
13 files changed, 84 insertions, 84 deletions
diff --git a/source4/dsdb/tests/python/acl.py b/source4/dsdb/tests/python/acl.py index 92e0a1a7fe4..c6703ca56e4 100755 --- a/source4/dsdb/tests/python/acl.py +++ b/source4/dsdb/tests/python/acl.py @@ -1758,7 +1758,7 @@ class AclExtendedTests(AclTests): #u3 is member of administrators group, should be able to read sd res = self.ldb_user3.search("CN=ext_group1,OU=ext_ou1," + self.base_dn, SCOPE_BASE, None, ["nTSecurityDescriptor"]) - self.assertEqual(len(res),1) + self.assertEqual(len(res), 1) self.assertTrue("nTSecurityDescriptor" in res[0].keys()) class AclUndeleteTests(AclTests): diff --git a/source4/dsdb/tests/python/deletetest.py b/source4/dsdb/tests/python/deletetest.py index ca416e642ac..01e7a1d2378 100755 --- a/source4/dsdb/tests/python/deletetest.py +++ b/source4/dsdb/tests/python/deletetest.py @@ -63,7 +63,7 @@ class BaseDeleteTests(samba.tests.TestCase): self.assertEquals(len(res), 1) return res[0] - def search_dn(self,dn): + def search_dn(self, dn): print("SEARCH by DN %s" % dn) res = self.ldb.search(expression="(objectClass=*)", @@ -83,7 +83,7 @@ class BasicDeleteTests(BaseDeleteTests): def del_attr_values(self, delObj): print("Checking attributes for %s" % delObj["dn"]) - self.assertEquals(delObj["isDeleted"][0],"TRUE") + self.assertEquals(delObj["isDeleted"][0], "TRUE") self.assertTrue(not("objectCategory" in delObj)) self.assertTrue(not("sAMAccountType" in delObj)) diff --git a/source4/dsdb/tests/python/dirsync.py b/source4/dsdb/tests/python/dirsync.py index ca3a1e936f6..71ea23f05e8 100755 --- a/source4/dsdb/tests/python/dirsync.py +++ b/source4/dsdb/tests/python/dirsync.py @@ -554,7 +554,7 @@ class SimpleDirsyncTests(DirsyncBaseTests): guid = None for e in res: if str(e["name"]) == "testou3": - guid = str(ndr_unpack(misc.GUID,e.get("objectGUID")[0])) + guid = str(ndr_unpack(misc.GUID, e.get("objectGUID")[0])) ctl = str(res.controls[0]).split(":") ctl[1] = "1" @@ -570,7 +570,7 @@ class SimpleDirsyncTests(DirsyncBaseTests): expression="(objectClass=organizationalUnit)", controls=[control1]) self.assertEqual(len(res), 1) - guid2 = str(ndr_unpack(misc.GUID,res[0].get("objectGUID")[0])) + guid2 = str(ndr_unpack(misc.GUID, res[0].get("objectGUID")[0])) self.assertEqual(guid2, guid) self.assertTrue(res[0].get("isDeleted")) self.assertTrue(res[0].get("name") != None) @@ -674,7 +674,7 @@ class ExtendedDirsyncTests(SimpleDirsyncTests): guid = None for e in res: if str(e["name"]) == "testou3": - guid = str(ndr_unpack(misc.GUID,e.get("objectGUID")[0])) + guid = str(ndr_unpack(misc.GUID, e.get("objectGUID")[0])) self.assertTrue(guid != None) ctl = str(res.controls[0]).split(":") @@ -692,7 +692,7 @@ class ExtendedDirsyncTests(SimpleDirsyncTests): expression="(objectClass=organizationalUnit)", controls=[control1]) self.assertEqual(len(res), 1) - guid2 = str(ndr_unpack(misc.GUID,res[0].get("objectGUID")[0])) + guid2 = str(ndr_unpack(misc.GUID, res[0].get("objectGUID")[0])) self.assertEqual(guid2, guid) self.assertEqual(str(res[0].dn), "") diff --git a/source4/dsdb/tests/python/dsdb_schema_info.py b/source4/dsdb/tests/python/dsdb_schema_info.py index 648ee45b22f..a1eba2c0557 100755 --- a/source4/dsdb/tests/python/dsdb_schema_info.py +++ b/source4/dsdb/tests/python/dsdb_schema_info.py @@ -112,7 +112,7 @@ objectClass: attributeSchema adminDescription: """ + attr_name + """ adminDisplayName: """ + attr_name + """ cn: """ + attr_name + """ -attributeId: 1.3.6.1.4.1.7165.4.6.1.7.%d.""" % sub_oid + str(random.randint(1,100000)) + """ +attributeId: 1.3.6.1.4.1.7165.4.6.1.7.%d.""" % sub_oid + str(random.randint(1, 100000)) + """ attributeSyntax: 2.5.5.12 omSyntax: 64 instanceType: 4 @@ -158,7 +158,7 @@ objectClass: classSchema adminDescription: """ + class_name + """ adminDisplayName: """ + class_name + """ cn: """ + class_name + """ -governsId: 1.3.6.1.4.1.7165.4.6.2.7.%d.""" % sub_oid + str(random.randint(1,100000)) + """ +governsId: 1.3.6.1.4.1.7165.4.6.2.7.%d.""" % sub_oid + str(random.randint(1, 100000)) + """ instanceType: 4 objectClassCategory: 1 subClassOf: organizationalPerson diff --git a/source4/dsdb/tests/python/ldap.py b/source4/dsdb/tests/python/ldap.py index 9d14e037eb3..6e4d3e3e39b 100755 --- a/source4/dsdb/tests/python/ldap.py +++ b/source4/dsdb/tests/python/ldap.py @@ -728,7 +728,7 @@ class BasicTests(samba.tests.TestCase): m = Message() m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn) - m["sAMAccountName"] = MessageElement(["nam1","nam2"], FLAG_MOD_REPLACE, + m["sAMAccountName"] = MessageElement(["nam1", "nam2"], FLAG_MOD_REPLACE, "sAMAccountName") try: ldb.modify(m) @@ -1378,7 +1378,7 @@ class BasicTests(samba.tests.TestCase): rdn = "CN=a012345678901234567890123456789012345678901234567890123456789012" delete_force(self.ldb, "%s,%s" % (rdn, self.base_dn)) ldif = """ -dn: %s,%s""" % (rdn,self.base_dn) + """ +dn: %s,%s""" % (rdn, self.base_dn) + """ objectClass: container """ self.ldb.add_ldif(ldif) @@ -1388,7 +1388,7 @@ objectClass: container delete_force(self.ldb, "%s,%s" % (rdn, self.base_dn)) try: ldif = """ -dn: %s,%s""" % (rdn,self.base_dn) + """ +dn: %s,%s""" % (rdn, self.base_dn) + """ objectClass: container """ self.ldb.add_ldif(ldif) @@ -1575,11 +1575,11 @@ objectGUID: bd3480c9-58af-4cd8-92df-bc4a18b6e44d """Test parentGUID behaviour""" self.ldb.add({ "dn": "cn=parentguidtest,cn=users," + self.base_dn, - "objectclass":"user", - "samaccountname":"parentguidtest"}) + "objectclass": "user", + "samaccountname": "parentguidtest"}) res1 = ldb.search(base="cn=parentguidtest,cn=users," + self.base_dn, scope=SCOPE_BASE, attrs=["parentGUID", "samaccountname"]) - res2 = ldb.search(base="cn=users," + self.base_dn,scope=SCOPE_BASE, + res2 = ldb.search(base="cn=users," + self.base_dn, scope=SCOPE_BASE, attrs=["objectGUID"]) res3 = ldb.search(base=self.base_dn, scope=SCOPE_BASE, attrs=["parentGUID"]) @@ -1630,8 +1630,8 @@ objectGUID: bd3480c9-58af-4cd8-92df-bc4a18b6e44d self.ldb.add({ "dn": "cn=testotherusers," + self.base_dn, - "objectclass":"container"}) - res1 = ldb.search(base="cn=testotherusers," + self.base_dn,scope=SCOPE_BASE, + "objectclass": "container"}) + res1 = ldb.search(base="cn=testotherusers," + self.base_dn, scope=SCOPE_BASE, attrs=["objectGUID"]) ldb.rename("cn=parentguidtest,cn=users," + self.base_dn, "cn=parentguidtest,cn=testotherusers," + self.base_dn) @@ -3072,7 +3072,7 @@ nTSecurityDescriptor:: """ + desc_base64 # there does not seem to be another limitation. try: dshstr = "" - for i in range(1,11): + for i in range(1, 11): # This is in the range self.ldb.set_dsheuristics(dshstr + "x") self.ldb.set_dsheuristics(dshstr + "xxxxx") diff --git a/source4/dsdb/tests/python/ldap_schema.py b/source4/dsdb/tests/python/ldap_schema.py index e98ab4a5656..3d4a9d9f039 100755 --- a/source4/dsdb/tests/python/ldap_schema.py +++ b/source4/dsdb/tests/python/ldap_schema.py @@ -99,7 +99,7 @@ class SchemaTests(samba.tests.TestCase): def test_schemaUpdateNow(self): """Testing schemaUpdateNow""" - rand = str(random.randint(1,100000)) + rand = str(random.randint(1, 100000)) attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand attr_ldap_display_name = attr_name.replace("-", "") @@ -131,7 +131,7 @@ schemaUpdateNow: 1 # Search for created attribute res = [] res = self.ldb.search("cn=%s,%s" % (attr_name, self.schema_dn), scope=SCOPE_BASE, - attrs=["lDAPDisplayName","schemaIDGUID", "msDS-IntID"]) + attrs=["lDAPDisplayName", "schemaIDGUID", "msDS-IntID"]) self.assertEquals(len(res), 1) self.assertEquals(res[0]["lDAPDisplayName"][0], attr_ldap_display_name) self.assertTrue("schemaIDGUID" in res[0]) @@ -154,7 +154,7 @@ defaultObjectCategory: CN=_ adminDescription: """ + class_name + """ adminDisplayName: """ + class_name + """ cn: """ + class_name + """ -governsId: 1.3.6.1.4.1.7165.4.6.2.6.1.""" + str(random.randint(1,100000)) + """ +governsId: 1.3.6.1.4.1.7165.4.6.2.6.1.""" + str(random.randint(1, 100000)) + """ instanceType: 4 objectClassCategory: 1 subClassOf: organizationalPerson @@ -178,7 +178,7 @@ objectClass: classSchema adminDescription: """ + class_name + """ adminDisplayName: """ + class_name + """ cn: """ + class_name + """ -governsId: 1.3.6.1.4.1.7165.4.6.2.6.2.""" + str(random.randint(1,100000)) + """ +governsId: 1.3.6.1.4.1.7165.4.6.2.6.2.""" + str(random.randint(1, 100000)) + """ instanceType: 4 objectClassCategory: 1 subClassOf: organizationalPerson @@ -260,7 +260,7 @@ objectClass: classSchema adminDescription: """ + class_name + """ adminDisplayName: """ + class_name + """ cn: """ + class_name + """ -governsId: 1.3.6.1.4.1.7165.4.6.2.6.3.""" + str(random.randint(1,100000)) + """ +governsId: 1.3.6.1.4.1.7165.4.6.2.6.3.""" + str(random.randint(1, 100000)) + """ instanceType: 4 objectClassCategory: 1 subClassOf: organizationalUnit @@ -307,7 +307,7 @@ instanceType: 4 def test_duplicate_attributeID(self): """Testing creating a duplicate attribute""" - rand = str(random.randint(1,100000)) + rand = str(random.randint(1, 100000)) attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand attr_ldap_display_name = attr_name.replace("-", "") attributeID = "1.3.6.1.4.1.7165.4.6.1.6.2." + rand @@ -351,7 +351,7 @@ systemOnly: FALSE def test_duplicate_attributeID_governsID(self): """Testing creating a duplicate attribute and class""" - rand = str(random.randint(1,100000)) + rand = str(random.randint(1, 100000)) attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand attr_ldap_display_name = attr_name.replace("-", "") attributeID = "1.3.6.1.4.1.7165.4.6.1.6.3." + rand @@ -396,7 +396,7 @@ systemOnly: FALSE def test_duplicate_cn(self): """Testing creating a duplicate attribute""" - rand = str(random.randint(1,100000)) + rand = str(random.randint(1, 100000)) attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand attr_ldap_display_name = attr_name.replace("-", "") attributeID = "1.3.6.1.4.1.7165.4.6.1.6.4." + rand @@ -439,7 +439,7 @@ systemOnly: FALSE def test_duplicate_implicit_ldapdisplayname(self): """Testing creating a duplicate attribute ldapdisplayname""" - rand = str(random.randint(1,100000)) + rand = str(random.randint(1, 100000)) attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand attr_ldap_display_name = attr_name.replace("-", "") attributeID = "1.3.6.1.4.1.7165.4.6.1.6.5." + rand @@ -484,7 +484,7 @@ systemOnly: FALSE def test_duplicate_explicit_ldapdisplayname(self): """Testing creating a duplicate attribute ldapdisplayname""" - rand = str(random.randint(1,100000)) + rand = str(random.randint(1, 100000)) attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand attr_ldap_display_name = attr_name.replace("-", "") attributeID = "1.3.6.1.4.1.7165.4.6.1.6.6." + rand @@ -531,7 +531,7 @@ systemOnly: FALSE def test_duplicate_explicit_ldapdisplayname_with_class(self): """Testing creating a duplicate attribute ldapdisplayname between and attribute and a class""" - rand = str(random.randint(1,100000)) + rand = str(random.randint(1, 100000)) attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand attr_ldap_display_name = attr_name.replace("-", "") attributeID = "1.3.6.1.4.1.7165.4.6.1.6.7." + rand @@ -579,7 +579,7 @@ systemOnly: FALSE def test_duplicate_via_rename_ldapdisplayname(self): """Testing creating a duplicate attribute ldapdisplayname""" - rand = str(random.randint(1,100000)) + rand = str(random.randint(1, 100000)) attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand attr_ldap_display_name = attr_name.replace("-", "") attributeID = "1.3.6.1.4.1.7165.4.6.1.6.8." + rand @@ -634,7 +634,7 @@ ldapDisplayName: """ + attr_ldap_display_name + """ def test_duplicate_via_rename_attributeID(self): """Testing creating a duplicate attributeID""" - rand = str(random.randint(1,100000)) + rand = str(random.randint(1, 100000)) attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand attr_ldap_display_name = attr_name.replace("-", "") attributeID = "1.3.6.1.4.1.7165.4.6.1.6.9." + rand @@ -688,7 +688,7 @@ attributeId: """ + attributeID + """ def test_remove_ldapdisplayname(self): """Testing removing the ldapdisplayname""" - rand = str(random.randint(1,100000)) + rand = str(random.randint(1, 100000)) attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand attr_ldap_display_name = attr_name.replace("-", "") attributeID = "1.3.6.1.4.1.7165.4.6.1.6.10." + rand @@ -724,7 +724,7 @@ replace: ldapDisplayName def test_rename_ldapdisplayname(self): """Testing renaming ldapdisplayname""" - rand = str(random.randint(1,100000)) + rand = str(random.randint(1, 100000)) attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand attr_ldap_display_name = attr_name.replace("-", "") attributeID = "1.3.6.1.4.1.7165.4.6.1.6.11." + rand @@ -757,7 +757,7 @@ ldapDisplayName: """ + attr_ldap_display_name + """2 def test_change_attributeID(self): """Testing change the attributeID""" - rand = str(random.randint(1,100000)) + rand = str(random.randint(1, 100000)) attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand attr_ldap_display_name = attr_name.replace("-", "") attributeID = "1.3.6.1.4.1.7165.4.6.1.6.12." + rand @@ -795,7 +795,7 @@ attributeId: """ + attributeID + """.1 def test_change_attributeID_same(self): """Testing change the attributeID to the same value""" - rand = str(random.randint(1,100000)) + rand = str(random.randint(1, 100000)) attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand attr_ldap_display_name = attr_name.replace("-", "") attributeID = "1.3.6.1.4.1.7165.4.6.1.6.13." + rand @@ -849,7 +849,7 @@ attributeId: """ + attributeID + """ if dc_level < DS_DOMAIN_FUNCTION_2003: return - rand = str(random.randint(1,100000)) + rand = str(random.randint(1, 100000)) attr_name_1 = "test-generated-linkID" + time.strftime("%s", time.gmtime()) + "-" + rand attr_ldap_display_name_1 = attr_name_1.replace("-", "") @@ -1130,7 +1130,7 @@ systemOnly: FALSE duplicate mAPIIDs. """ - rand = str(random.randint(1,100000)) + rand = str(random.randint(1, 100000)) attr_name_1 = "test-generated-mAPIID" + time.strftime("%s", time.gmtime()) + "-" + rand attr_ldap_display_name_1 = attr_name_1.replace("-", "") @@ -1203,7 +1203,7 @@ systemOnly: FALSE def test_change_governsID(self): """Testing change the governsID""" - rand = str(random.randint(1,100000)) + rand = str(random.randint(1, 100000)) class_name = "test-Class" + time.strftime("%s", time.gmtime()) + "-" + rand class_ldap_display_name = class_name.replace("-", "") governsID = "1.3.6.1.4.1.7165.4.6.2.6.5." + rand @@ -1242,7 +1242,7 @@ governsId: """ + governsID + """.1 def test_change_governsID_same(self): """Testing change the governsID""" - rand = str(random.randint(1,100000)) + rand = str(random.randint(1, 100000)) class_name = "test-Class" + time.strftime("%s", time.gmtime()) + "-" + rand class_ldap_display_name = class_name.replace("-", "") governsID = "1.3.6.1.4.1.7165.4.6.2.6.6." + rand @@ -1293,7 +1293,7 @@ objectClass: classSchema adminDescription: """ + class_name + """ adminDisplayName: """ + class_name + """ cn: """ + class_name + """ -governsId: 1.3.6.1.4.1.7165.4.6.2.6.7.""" + str(random.randint(1,100000)) + """ +governsId: 1.3.6.1.4.1.7165.4.6.2.6.7.""" + str(random.randint(1, 100000)) + """ instanceType: 4 objectClassCategory: 1 subClassOf: organizationalUnit @@ -1382,7 +1382,7 @@ objectClass: attributeSchema adminDescription: """ + attr_name + """ adminDisplayName: """ + attr_name + """ cn: """ + attr_name + """ -attributeId: 1.3.6.1.4.1.7165.4.6.1.6.14.""" + str(random.randint(1,100000)) + """ +attributeId: 1.3.6.1.4.1.7165.4.6.1.6.14.""" + str(random.randint(1, 100000)) + """ attributeSyntax: 2.5.5.12 omSyntax: 64 instanceType: 4 @@ -1502,7 +1502,7 @@ objectClass: classSchema adminDescription: """ + class_name + """ adminDisplayName: """ + class_name + """ cn: """ + class_name + """ -governsId: 1.3.6.1.4.1.7165.4.6.2.6.%d.""" % sub_oid + str(random.randint(1,100000)) + """ +governsId: 1.3.6.1.4.1.7165.4.6.2.6.%d.""" % sub_oid + str(random.randint(1, 100000)) + """ instanceType: 4 objectClassCategory: 1 subClassOf: organizationalPerson @@ -1654,7 +1654,7 @@ class SchemaTests_msDS_isRODC(samba.tests.TestCase): def test_objectClass_computer(self): res = self.ldb.search(self.base_dn, expression="objectClass=computer", - attrs=["serverReferenceBL","msDS-isRODC"], controls=["search_options:1:2"]) + attrs=["serverReferenceBL", "msDS-isRODC"], controls=["search_options:1:2"]) for ldb_msg in res: if "serverReferenceBL" not in ldb_msg: print("Computer entry %s doesn't have a serverReferenceBL attribute" % ldb_msg['dn']) diff --git a/source4/dsdb/tests/python/ldap_syntaxes.py b/source4/dsdb/tests/python/ldap_syntaxes.py index ab6bc7c9b60..932d3d8d00c 100755 --- a/source4/dsdb/tests/python/ldap_syntaxes.py +++ b/source4/dsdb/tests/python/ldap_syntaxes.py @@ -65,7 +65,7 @@ ldapDisplayName: """ + attr_ldap_display_name + """ objectClass: top objectClass: attributeSchema cn: """ + attr_name + """ -attributeId: 1.3.6.1.4.1.7165.4.6.1.1.""" + str(random.randint(1,100000)) + """ +attributeId: 1.3.6.1.4.1.7165.4.6.1.1.""" + str(random.randint(1, 100000)) + """ attributeSyntax: 2.5.5.14 omSyntax: 127 omObjectClass: \x2A\x86\x48\x86\xF7\x14\x01\x01\x01\x0C @@ -92,7 +92,7 @@ objectClass: classSchema adminDescription: """ + class_name + """ adminDisplayName: """ + class_name + """ cn: """ + class_name + """ -governsId: 1.3.6.1.4.1.7165.4.6.2.1.""" + str(random.randint(1,100000)) + """ +governsId: 1.3.6.1.4.1.7165.4.6.2.1.""" + str(random.randint(1, 100000)) + """ schemaIdGuid: """ + str(uuid.uuid4()) + """ objectClassCategory: 1 subClassOf: organizationalPerson @@ -125,7 +125,7 @@ ldapDisplayName: """ + attr_ldap_display_name + """ objectClass: top objectClass: attributeSchema cn: """ + attr_name + """ -attributeId: 1.3.6.1.4.1.7165.4.6.1.2.""" + str(random.randint(1,100000)) + """ +attributeId: 1.3.6.1.4.1.7165.4.6.1.2.""" + str(random.randint(1, 100000)) + """ attributeSyntax: 2.5.5.7 omSyntax: 127 omObjectClass: \x2A\x86\x48\x86\xF7\x14\x01\x01\x01\x0B @@ -152,7 +152,7 @@ objectClass: classSchema adminDescription: """ + class_name + """ adminDisplayName: """ + class_name + """ cn: """ + class_name + """ -governsId: 1.3.6.1.4.1.7165.4.6.2.2.""" + str(random.randint(1,100000)) + """ +governsId: 1.3.6.1.4.1.7165.4.6.2.2.""" + str(random.randint(1, 100000)) + """ schemaIdGuid: """ + str(uuid.uuid4()) + """ objectClassCategory: 1 subClassOf: organizationalPerson diff --git a/source4/dsdb/tests/python/linked_attributes.py b/source4/dsdb/tests/python/linked_attributes.py index 58876680d86..83910c784a8 100644 --- a/source4/dsdb/tests/python/linked_attributes.py +++ b/source4/dsdb/tests/python/linked_attributes.py @@ -331,7 +331,7 @@ class LATests(samba.tests.TestCase): # removing a duplicate link in the same message should fail self.add_linked_attribute(g2, [u1, u2]) self.assertRaises(ldb.LdbError, - self.remove_linked_attribute,g2, [u1, u1]) + self.remove_linked_attribute, g2, [u1, u1]) def _test_la_links_delete_link_reveal(self): u1, u2 = self.add_objects(2, 'user', 'u_del_link_reveal') diff --git a/source4/dsdb/tests/python/rodc_rwdc.py b/source4/dsdb/tests/python/rodc_rwdc.py index 716bcdda1fa..50f722d57b5 100644 --- a/source4/dsdb/tests/python/rodc_rwdc.py +++ b/source4/dsdb/tests/python/rodc_rwdc.py @@ -97,7 +97,7 @@ def preload_rodc_user(user_dn): 'rodc', 'preload', user_dn, credstring, - '--server', RWDC,] + '--server', RWDC, ] print(' '.join(cmd)) subprocess.check_call(cmd) diff --git a/source4/dsdb/tests/python/sam.py b/source4/dsdb/tests/python/sam.py index a1806f9bae3..77fd8f5b659 100755 --- a/source4/dsdb/tests/python/sam.py +++ b/source4/dsdb/tests/python/sam.py @@ -3451,7 +3451,7 @@ class SamTests(samba.tests.TestCase): m = Message() m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn) - m["description"] = MessageElement(["desc1","desc2"], FLAG_MOD_REPLACE, + m["description"] = MessageElement(["desc1", "desc2"], FLAG_MOD_REPLACE, "description") try: ldb.modify(m) @@ -3462,7 +3462,7 @@ class SamTests(samba.tests.TestCase): m = Message() m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn) - m["description"] = MessageElement(["desc1","desc2"], FLAG_MOD_DELETE, + m["description"] = MessageElement(["desc1", "desc2"], FLAG_MOD_DELETE, "description") ldb.modify(m) @@ -3518,7 +3518,7 @@ class SamTests(samba.tests.TestCase): m = Message() m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn) - m["description"] = MessageElement(["desc1","desc2"], FLAG_MOD_DELETE, + m["description"] = MessageElement(["desc1", "desc2"], FLAG_MOD_DELETE, "description") try: ldb.modify(m) @@ -3539,7 +3539,7 @@ class SamTests(samba.tests.TestCase): m = Message() m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn) - m["description"] = MessageElement(["desc1","desc2"], FLAG_MOD_REPLACE, + m["description"] = MessageElement(["desc1", "desc2"], FLAG_MOD_REPLACE, "description") try: ldb.modify(m) @@ -3673,11 +3673,11 @@ class SamTests(samba.tests.TestCase): # a list of some well-known sids # objects in Builtin are aready covered by objectclass protected_list = [ - ["CN=Domain Admins","CN=Users,"], - ["CN=Schema Admins","CN=Users,"], - ["CN=Enterprise Admins","CN=Users,"], - ["CN=Administrator","CN=Users,"], - ["CN=Domain Controllers","CN=Users,"], + ["CN=Domain Admins", "CN=Users,"], + ["CN=Schema Admins", "CN=Users,"], + ["CN=Enterprise Admins", "CN=Users,"], + ["CN=Administrator", "CN=Users,"], + ["CN=Domain Controllers", "CN=Users,"], ] @@ -3720,7 +3720,7 @@ class SamTests(samba.tests.TestCase): "logonCount": MessageElement(["0"]), "cn": MessageElement([user_name]), "countryCode": MessageElement(["0"]), - "objectClass": MessageElement(["top","person","organizationalPerson","user"]), + "objectClass": MessageElement(["top", "person", "organizationalPerson", "user"]), "instanceType": MessageElement(["4"]), "distinguishedName": MessageElement([user_dn]), "sAMAccountType": MessageElement(["805306368"]), diff --git a/source4/dsdb/tests/python/sec_descriptor.py b/source4/dsdb/tests/python/sec_descriptor.py index b35529bd9b5..7b9f6083f82 100755 --- a/source4/dsdb/tests/python/sec_descriptor.py +++ b/source4/dsdb/tests/python/sec_descriptor.py @@ -67,7 +67,7 @@ class DescriptorTests(samba.tests.TestCase): def create_schema_class(self, _ldb, desc=None): while True: - class_id = random.randint(0,65535) + class_id = random.randint(0, 65535) class_name = "descriptor-test-class%s" % class_id class_dn = "CN=%s,%s" % (class_name, self.schema_dn) try: @@ -212,10 +212,10 @@ class OwnerGroupDescriptorTests(DescriptorTests): ["testuser1", "testuser5", "testuser6", "testuser8"], add_members_operation=True) self.ldb_admin.add_remove_group_members("Domain Admins", - ["testuser2","testuser5","testuser6","testuser7"], + ["testuser2", "testuser5", "testuser6", "testuser7"], add_members_operation=True) self.ldb_admin.add_remove_group_members("Schema Admins", - ["testuser3","testuser6","testuser7","testuser8"], + ["testuser3", "testuser6", "testuser7", "testuser8"], add_members_operation=True) self.results = { @@ -2082,7 +2082,7 @@ class SdAutoInheritTests(DescriptorTests): sd_sddl = "O:BAG:BAD:P(A;CI;0x000f01ff;;;AU)" sd = security.descriptor.from_sddl(sd_sddl, self.domain_sid) - self.ldb_admin.create_ou(self.ou_dn,sd=sd) + self.ldb_admin.create_ou(self.ou_dn, sd=sd) self.ldb_admin.create_ou(self.sub_dn) ou_res0 = self.sd_utils.ldb.search(self.ou_dn, SCOPE_BASE, diff --git a/source4/dsdb/tests/python/urgent_replication.py b/source4/dsdb/tests/python/urgent_replication.py index 191df0d2996..5d8282ba9ad 100755 --- a/source4/dsdb/tests/python/urgent_replication.py +++ b/source4/dsdb/tests/python/urgent_replication.py @@ -54,9 +54,9 @@ class UrgentReplicationTests(samba.tests.TestCase): """Test if the urgent replication is not activated when handling a non urgent object.""" self.ldb.add({ "dn": "cn=nonurgenttest,cn=users," + self.base_dn, - "objectclass":"user", - "samaccountname":"nonurgenttest", - "description":"nonurgenttest description"}) + "objectclass": "user", + "samaccountname": "nonurgenttest", + "description": "nonurgenttest description"}) # urgent replication should not be enabled when creating res = self.ldb.load_partition_usn(self.base_dn) @@ -81,10 +81,10 @@ class UrgentReplicationTests(samba.tests.TestCase): self.ldb.add({ "dn": "cn=test server,cn=Servers,cn=Default-First-Site-Name,cn=Sites,%s" % self.ldb.get_config_basedn(), - "objectclass":"server", - "cn":"test server", - "name":"test server", - "systemFlags":"50000000"}, ["relax:0"]) + "objectclass": "server", + "cn": "test server", + "name": "test server", + "systemFlags": "50000000"}, ["relax:0"]) self.ldb.add_ldif( """dn: cn=NTDS Settings test,cn=test server,cn=Servers,cn=Default-First-Site-Name,cn=Sites,cn=Configuration,%s""" % (self.base_dn) + """ @@ -156,7 +156,7 @@ cn: test attributeSchema instanceType: 4 isSingleValued: FALSE showInAdvancedViewOnly: FALSE -attributeID: 1.3.6.1.4.1.7165.4.6.1.4.""" + str(random.randint(1,100000)) + """ +attributeID: 1.3.6.1.4.1.7165.4.6.1.4.""" + str(random.randint(1, 100000)) + """ attributeSyntax: 2.5.5.12 adminDisplayName: test attributeSchema adminDescription: test attributeSchema @@ -188,7 +188,7 @@ objectClass: classSchema cn: test classSchema instanceType: 4 subClassOf: top -governsId: 1.3.6.1.4.1.7165.4.6.2.4.""" + str(random.randint(1,100000)) + """ +governsId: 1.3.6.1.4.1.7165.4.6.2.4.""" + str(random.randint(1, 100000)) + """ rDNAttID: cn showInAdvancedViewOnly: TRUE adminDisplayName: test classSchema @@ -225,10 +225,10 @@ defaultHidingValue: TRUE""") self.ldb.add({ "dn": "cn=test secret,cn=System," + self.base_dn, - "objectClass":"secret", - "cn":"test secret", - "name":"test secret", - "currentValue":"xxxxxxx"}) + "objectClass": "secret", + "cn": "test secret", + "name": "test secret", + "currentValue": "xxxxxxx"}) # urgent replication should be enabled when creating res = self.ldb.load_partition_usn(self.base_dn) @@ -284,12 +284,12 @@ rIDAvailablePool: 133001-1073741823""", ["relax:0"]) self.ldb.add({ "dn": "cn=user UrgAttr test,cn=users," + self.base_dn, - "objectclass":"user", - "samaccountname":"user UrgAttr test", - "userAccountControl":str(dsdb.UF_NORMAL_ACCOUNT), - "lockoutTime":"0", - "pwdLastSet":"0", - "description":"urgent attributes test description"}) + "objectclass": "user", + "samaccountname": "user UrgAttr test", + "userAccountControl": str(dsdb.UF_NORMAL_ACCOUNT), + "lockoutTime": "0", + "pwdLastSet": "0", + "description": "urgent attributes test description"}) # urgent replication should NOT be enabled when creating res = self.ldb.load_partition_usn(self.base_dn) diff --git a/source4/dsdb/tests/python/user_account_control.py b/source4/dsdb/tests/python/user_account_control.py index c60e0854344..6a53e5bef6b 100755 --- a/source4/dsdb/tests/python/user_account_control.py +++ b/source4/dsdb/tests/python/user_account_control.py @@ -34,7 +34,7 @@ from ldb import SCOPE_SUBTREE, SCOPE_BASE, LdbError from ldb import Message, MessageElement, Dn from ldb import FLAG_MOD_ADD, FLAG_MOD_REPLACE, FLAG_MOD_DELETE from samba.dsdb import UF_SCRIPT, UF_ACCOUNTDISABLE, UF_00000004, UF_HOMEDIR_REQUIRED, \ - UF_LOCKOUT,UF_PASSWD_NOTREQD, UF_PASSWD_CANT_CHANGE, UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED,\ + UF_LOCKOUT, UF_PASSWD_NOTREQD, UF_PASSWD_CANT_CHANGE, UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED,\ UF_TEMP_DUPLICATE_ACCOUNT, UF_NORMAL_ACCOUNT, UF_00000400, UF_INTERDOMAIN_TRUST_ACCOUNT, \ UF_WORKSTATION_TRUST_ACCOUNT, UF_SERVER_TRUST_ACCOUNT, UF_00004000, \ UF_00008000, UF_DONT_EXPIRE_PASSWD, UF_MNS_LOGON_ACCOUNT, UF_SMARTCARD_REQUIRED, \ @@ -70,7 +70,7 @@ creds = credopts.get_credentials(lp) creds.set_gensec_features(creds.get_gensec_features() | gensec.FEATURE_SEAL) bits = [UF_SCRIPT, UF_ACCOUNTDISABLE, UF_00000004, UF_HOMEDIR_REQUIRED, - UF_LOCKOUT,UF_PASSWD_NOTREQD, UF_PASSWD_CANT_CHANGE, + UF_LOCKOUT, UF_PASSWD_NOTREQD, UF_PASSWD_CANT_CHANGE, UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED, UF_TEMP_DUPLICATE_ACCOUNT, UF_NORMAL_ACCOUNT, UF_00000400, UF_INTERDOMAIN_TRUST_ACCOUNT, |