diff options
author | Joe Guo <joeg@catalyst.net.nz> | 2018-07-30 18:16:43 +1200 |
---|---|---|
committer | Douglas Bagnall <dbagnall@samba.org> | 2018-08-24 07:49:27 +0200 |
commit | a9551edaeebdb2e8c209a843bae7088e60946e96 (patch) | |
tree | f27c3090e881ab00c9af974143d826a989d4d770 /source4 | |
parent | 944d70435e4859a626b875c18535c1adb7c3e66f (diff) | |
download | samba-a9551edaeebdb2e8c209a843bae7088e60946e96.tar.gz |
PEP8: fix E201: whitespace after '('
Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Diffstat (limited to 'source4')
-rwxr-xr-x | source4/dsdb/samdb/ldb_modules/tests/possibleinferiors.py | 2 | ||||
-rwxr-xr-x | source4/dsdb/tests/python/acl.py | 40 | ||||
-rwxr-xr-x | source4/dsdb/tests/python/deletetest.py | 2 | ||||
-rwxr-xr-x | source4/dsdb/tests/python/ldap.py | 14 | ||||
-rwxr-xr-x | source4/dsdb/tests/python/sam.py | 4 | ||||
-rwxr-xr-x | source4/dsdb/tests/python/sec_descriptor.py | 28 | ||||
-rwxr-xr-x | source4/dsdb/tests/python/token_group.py | 4 | ||||
-rwxr-xr-x | source4/scripting/devel/speedtest.py | 18 | ||||
-rwxr-xr-x | source4/selftest/tests.py | 8 | ||||
-rw-r--r-- | source4/torture/drs/python/repl_rodc.py | 6 |
10 files changed, 63 insertions, 63 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/tests/possibleinferiors.py b/source4/dsdb/samdb/ldb_modules/tests/possibleinferiors.py index dd2f839c63a..ed740f47a12 100755 --- a/source4/dsdb/samdb/ldb_modules/tests/possibleinferiors.py +++ b/source4/dsdb/samdb/ldb_modules/tests/possibleinferiors.py @@ -175,7 +175,7 @@ def pull_classinfo(db): classinfo[name]["objectClassCategory"] = int(r["objectClassCategory"][0]) else: classinfo[name]["objectClassCategory"] = 0 - for a in [ "possSuperiors", "systemPossSuperiors", + for a in ["possSuperiors", "systemPossSuperiors", "auxiliaryClass", "systemAuxiliaryClass", "subClassOf" ]: classinfo[name][a] = [] diff --git a/source4/dsdb/tests/python/acl.py b/source4/dsdb/tests/python/acl.py index 8b239adefb4..9ad8b0c620e 100755 --- a/source4/dsdb/tests/python/acl.py +++ b/source4/dsdb/tests/python/acl.py @@ -283,7 +283,7 @@ class AclModifyTests(AclTests): self.ldb_user = self.get_ldb_connection(self.user_with_wp, self.user_pass) self.ldb_user2 = self.get_ldb_connection(self.user_with_sm, self.user_pass) self.ldb_user3 = self.get_ldb_connection(self.user_with_group_sm, self.user_pass) - self.user_sid = self.sd_utils.get_object_sid( self.get_user_dn(self.user_with_wp)) + self.user_sid = self.sd_utils.get_object_sid(self.get_user_dn(self.user_with_wp)) self.ldb_admin.newgroup("test_modify_group2", grouptype=samba.dsdb.GTYPE_DISTRIBUTION_DOMAIN_LOCAL_GROUP) self.ldb_admin.newgroup("test_modify_group3", grouptype=samba.dsdb.GTYPE_DISTRIBUTION_DOMAIN_LOCAL_GROUP) self.ldb_admin.newuser("test_modify_user2", self.user_pass) @@ -560,7 +560,7 @@ Member: """ + self.get_user_dn(self.user_with_sm) mod = "(OA;;SW;bf9679c0-0de6-11d0-a285-00aa003049e2;;%s)" % str(user_sid) self.sd_utils.dacl_add_ace("CN=test_modify_group2,CN=Users," + self.base_dn, mod) self.ldb_user2.modify_ldif(ldif) - res = self.ldb_admin.search( self.base_dn, expression="(distinguishedName=%s)" \ + res = self.ldb_admin.search(self.base_dn, expression="(distinguishedName=%s)" \ % ("CN=test_modify_group2,CN=Users," + self.base_dn), attrs=["Member"]) self.assertEqual(res[0]["Member"][0], self.get_user_dn(self.user_with_sm)) #but not other users @@ -610,7 +610,7 @@ changetype: modify add: Member Member: """ + self.get_user_dn(self.user_with_wp) self.ldb_user.modify_ldif(ldif) - res = self.ldb_admin.search( self.base_dn, expression="(distinguishedName=%s)" \ + res = self.ldb_admin.search(self.base_dn, expression="(distinguishedName=%s)" \ % ("CN=test_modify_group2,CN=Users," + self.base_dn), attrs=["Member"]) self.assertEqual(res[0]["Member"][0], self.get_user_dn(self.user_with_wp)) ldif = """ @@ -624,7 +624,7 @@ changetype: modify add: Member Member: CN=test_modify_user2,CN=Users,""" + self.base_dn self.ldb_user.modify_ldif(ldif) - res = self.ldb_admin.search( self.base_dn, expression="(distinguishedName=%s)" \ + res = self.ldb_admin.search(self.base_dn, expression="(distinguishedName=%s)" \ % ("CN=test_modify_group2,CN=Users," + self.base_dn), attrs=["Member"]) self.assertEqual(res[0]["Member"][0], "CN=test_modify_user2,CN=Users," + self.base_dn) @@ -803,20 +803,20 @@ class AclSearchTests(AclTests): ok_list = [Dn(self.ldb_admin, "OU=ou2,OU=ou1," + self.base_dn), Dn(self.ldb_admin, "OU=ou1," + self.base_dn)] - res_list = [ x["dn"] for x in res if x["dn"] in ok_list ] + res_list = [x["dn"] for x in res if x["dn"] in ok_list ] self.assertEquals(sorted(res_list), sorted(ok_list)) #these users should see all ous res = self.ldb_user.search("OU=ou1," + self.base_dn, expression="(objectClass=*)", scope=SCOPE_SUBTREE) self.assertEquals(len(res), 6) - res_list = [ x["dn"] for x in res if x["dn"] in self.full_list ] + res_list = [x["dn"] for x in res if x["dn"] in self.full_list ] self.assertEquals(sorted(res_list), sorted(self.full_list)) res = self.ldb_user2.search("OU=ou1," + self.base_dn, expression="(objectClass=*)", scope=SCOPE_SUBTREE) self.assertEquals(len(res), 6) - res_list = [ x["dn"] for x in res if x["dn"] in self.full_list ] + res_list = [x["dn"] for x in res if x["dn"] in self.full_list ] self.assertEquals(sorted(res_list), sorted(self.full_list)) def test_search2(self): @@ -832,7 +832,7 @@ class AclSearchTests(AclTests): res = self.ldb_user3.search("OU=ou1," + self.base_dn, expression="(objectClass=*)", scope=SCOPE_SUBTREE) #this user should see all ous - res_list = [ x["dn"] for x in res if x["dn"] in self.full_list ] + res_list = [x["dn"] for x in res if x["dn"] in self.full_list ] self.assertEquals(sorted(res_list), sorted(self.full_list)) #these users should see ou1, 2, 5 and 6 but not 3 and 4 @@ -842,13 +842,13 @@ class AclSearchTests(AclTests): Dn(self.ldb_admin, "OU=ou1," + self.base_dn), Dn(self.ldb_admin, "OU=ou5,OU=ou3,OU=ou2,OU=ou1," + self.base_dn), Dn(self.ldb_admin, "OU=ou6,OU=ou4,OU=ou2,OU=ou1," + self.base_dn)] - res_list = [ x["dn"] for x in res if x["dn"] in ok_list ] + res_list = [x["dn"] for x in res if x["dn"] in ok_list ] self.assertEquals(sorted(res_list), sorted(ok_list)) res = self.ldb_user2.search("OU=ou1," + self.base_dn, expression="(objectClass=*)", scope=SCOPE_SUBTREE) self.assertEquals(len(res), 4) - res_list = [ x["dn"] for x in res if x["dn"] in ok_list ] + res_list = [x["dn"] for x in res if x["dn"] in ok_list ] self.assertEquals(sorted(res_list), sorted(ok_list)) def test_search3(self): @@ -882,7 +882,7 @@ class AclSearchTests(AclTests): res = self.ldb_user3.search("OU=ou1," + self.base_dn, expression="(objectClass=*)", scope=SCOPE_SUBTREE) - res_list = [ x["dn"] for x in res if x["dn"] in ok_list ] + res_list = [x["dn"] for x in res if x["dn"] in ok_list ] self.assertEquals(sorted(res_list), sorted(ok_list)) ok_list = [Dn(self.ldb_admin, "OU=ou2,OU=ou1," + self.base_dn), @@ -894,13 +894,13 @@ class AclSearchTests(AclTests): res = self.ldb_user.search("OU=ou1," + self.base_dn, expression="(objectClass=*)", scope=SCOPE_SUBTREE) self.assertEquals(len(res), 4) - res_list = [ x["dn"] for x in res if x["dn"] in ok_list ] + res_list = [x["dn"] for x in res if x["dn"] in ok_list ] self.assertEquals(sorted(res_list), sorted(ok_list)) res = self.ldb_user2.search("OU=ou1," + self.base_dn, expression="(objectClass=*)", scope=SCOPE_SUBTREE) self.assertEquals(len(res), 4) - res_list = [ x["dn"] for x in res if x["dn"] in ok_list ] + res_list = [x["dn"] for x in res if x["dn"] in ok_list ] self.assertEquals(sorted(res_list), sorted(ok_list)) def test_search4(self): @@ -921,13 +921,13 @@ class AclSearchTests(AclTests): res = self.ldb_user3.search("OU=ou1," + self.base_dn, expression="(objectClass=*)", scope=SCOPE_SUBTREE) self.assertEquals(len(res), 2) - res_list = [ x["dn"] for x in res if x["dn"] in ok_list ] + res_list = [x["dn"] for x in res if x["dn"] in ok_list ] self.assertEquals(sorted(res_list), sorted(ok_list)) res = self.ldb_user.search("OU=ou1," + self.base_dn, expression="(objectClass=*)", scope=SCOPE_SUBTREE) self.assertEquals(len(res), 2) - res_list = [ x["dn"] for x in res if x["dn"] in ok_list ] + res_list = [x["dn"] for x in res if x["dn"] in ok_list ] self.assertEquals(sorted(res_list), sorted(ok_list)) def test_search5(self): @@ -1959,11 +1959,11 @@ class AclSPNTests(AclTests): # same as for join_RODC, but do not set any SPNs def create_rodc(self, ctx): - ctx.nc_list = [ ctx.base_dn, ctx.config_dn, ctx.schema_dn ] - ctx.full_nc_list = [ ctx.base_dn, ctx.config_dn, ctx.schema_dn ] + ctx.nc_list = [ctx.base_dn, ctx.config_dn, ctx.schema_dn ] + ctx.full_nc_list = [ctx.base_dn, ctx.config_dn, ctx.schema_dn ] ctx.krbtgt_dn = "CN=krbtgt_%s,CN=Users,%s" % (ctx.myname, ctx.base_dn) - ctx.never_reveal_sid = [ "<SID=%s-%s>" % (ctx.domsid, security.DOMAIN_RID_RODC_DENY), + ctx.never_reveal_sid = ["<SID=%s-%s>" % (ctx.domsid, security.DOMAIN_RID_RODC_DENY), "<SID=%s>" % security.SID_BUILTIN_ADMINISTRATORS, "<SID=%s>" % security.SID_BUILTIN_SERVER_OPERATORS, "<SID=%s>" % security.SID_BUILTIN_BACKUP_OPERATORS, @@ -1990,8 +1990,8 @@ class AclSPNTests(AclTests): ctx.join_add_objects() def create_dc(self, ctx): - ctx.nc_list = [ ctx.base_dn, ctx.config_dn, ctx.schema_dn ] - ctx.full_nc_list = [ ctx.base_dn, ctx.config_dn, ctx.schema_dn ] + ctx.nc_list = [ctx.base_dn, ctx.config_dn, ctx.schema_dn ] + ctx.full_nc_list = [ctx.base_dn, ctx.config_dn, ctx.schema_dn ] ctx.userAccountControl = samba.dsdb.UF_SERVER_TRUST_ACCOUNT | samba.dsdb.UF_TRUSTED_FOR_DELEGATION ctx.secure_channel_type = misc.SEC_CHAN_BDC ctx.replica_flags = (drsuapi.DRSUAPI_DRS_WRIT_REP | diff --git a/source4/dsdb/tests/python/deletetest.py b/source4/dsdb/tests/python/deletetest.py index 5fdfa600ace..cfdddc2a447 100755 --- a/source4/dsdb/tests/python/deletetest.py +++ b/source4/dsdb/tests/python/deletetest.py @@ -316,7 +316,7 @@ class BasicTreeDeleteTests(BasicDeleteTests): "objectclass": "group", "description": "test group", "samaccountname": grp_name, - "member": [ self.usr1, self.usr2 ], + "member": [self.usr1, self.usr2 ], "isDeleted": "FALSE" }) self.ldb.add({ diff --git a/source4/dsdb/tests/python/ldap.py b/source4/dsdb/tests/python/ldap.py index 1456d6b9923..a50b9141141 100755 --- a/source4/dsdb/tests/python/ldap.py +++ b/source4/dsdb/tests/python/ldap.py @@ -2828,7 +2828,7 @@ objectClass: posixAccount"""% (self.base_dn)) # delete_force(self.ldb, user_dn) try: - self.ldb.add({ "dn": user_dn, + self.ldb.add({"dn": user_dn, "objectClass": "user", "sAMAccountName": user_name, "nTSecurityDescriptor": [] }) @@ -2850,8 +2850,8 @@ sAMAccountName: """ + user_name + """ nTSecurityDescriptor: """ + sddl) res = self.ldb.search(base=user_dn, attrs=["nTSecurityDescriptor"]) desc = res[0]["nTSecurityDescriptor"][0] - desc = ndr_unpack( security.descriptor, desc ) - desc_sddl = desc.as_sddl( self.domain_sid ) + desc = ndr_unpack(security.descriptor, desc ) + desc_sddl = desc.as_sddl(self.domain_sid ) self.assertEqual(desc_sddl, sddl) finally: delete_force(self.ldb, user_dn) @@ -2886,7 +2886,7 @@ nTSecurityDescriptor:: """ + desc_base64) try: sddl = "O:DUG:DUD:AI(A;;RPWP;;;AU)S:PAI" desc = security.descriptor.from_sddl(sddl, security.dom_sid('S-1-5-21')) - desc_base64 = base64.b64encode( ndr_pack(desc) ).decode('utf8') + desc_base64 = base64.b64encode(ndr_pack(desc) ).decode('utf8') self.ldb.add_ldif(""" dn: """ + user_dn + """ objectclass: user @@ -2909,7 +2909,7 @@ nTSecurityDescriptor:: """ + desc_base64) # Test an empty security descriptor (naturally this shouldn't work) # delete_force(self.ldb, user_dn) - self.ldb.add({ "dn": user_dn, + self.ldb.add({"dn": user_dn, "objectClass": "user", "sAMAccountName": user_name }) @@ -3127,7 +3127,7 @@ nTSecurityDescriptor:: """ + desc_base64 user_dn = "CN=%s,CN=Users,%s" % (user_name, self.base_dn) delete_force(self.ldb, user_dn) - self.ldb.add({ "dn": user_dn, + self.ldb.add({"dn": user_dn, "objectClass": "user", "sAMAccountName": user_name }) @@ -3137,7 +3137,7 @@ nTSecurityDescriptor:: """ + desc_base64 # 370101000000Z => 20370101000000.0Z # 20370102000000.*Z => 20370102000000.0Z # - ext = [ "Z", ".0Z", ".Z", ".000Z", ".RandomIgnoredCharacters...987654321Z" ] + ext = ["Z", ".0Z", ".Z", ".000Z", ".RandomIgnoredCharacters...987654321Z" ] for i in range(0, len(ext)): v_raw = "203701%02d000000" % (i + 1) if ext[i] == "Z": diff --git a/source4/dsdb/tests/python/sam.py b/source4/dsdb/tests/python/sam.py index e6c93c5c7e6..aa0c16534b6 100755 --- a/source4/dsdb/tests/python/sam.py +++ b/source4/dsdb/tests/python/sam.py @@ -3320,7 +3320,7 @@ class SamTests(samba.tests.TestCase): "objectclass": "computer", "dNSHostName": "testname.testdom", "sAMAccountName": "testname$", - "servicePrincipalName": [ "HOST/testname.testdom", "HOST/testname" ] + "servicePrincipalName": ["HOST/testname.testdom", "HOST/testname" ] }) m = Message() @@ -3348,7 +3348,7 @@ class SamTests(samba.tests.TestCase): "objectclass": "computer", "dNSHostName": "testname.testdom", "sAMAccountName": "testname$", - "servicePrincipalName": [ "HOST/testname.testdom", "HOST/testname" ] + "servicePrincipalName": ["HOST/testname.testdom", "HOST/testname" ] }) m = Message() diff --git a/source4/dsdb/tests/python/sec_descriptor.py b/source4/dsdb/tests/python/sec_descriptor.py index 48b4919efa5..ad82fce5d67 100755 --- a/source4/dsdb/tests/python/sec_descriptor.py +++ b/source4/dsdb/tests/python/sec_descriptor.py @@ -350,7 +350,7 @@ class OwnerGroupDescriptorTests(DescriptorTests): # User is not a member of any additional groups but default res = self.ldb_admin.search(user_dn, attrs=["*"]) res = [x.upper() for x in res[0].keys()] - self.assertFalse( "MEMBEROF" in res) + self.assertFalse("MEMBEROF" in res) def check_modify_inheritance(self, _ldb, object_dn, owner_group=""): # Modify @@ -409,7 +409,7 @@ class OwnerGroupDescriptorTests(DescriptorTests): object_dn = "OU=test_domain_ou1," + self.base_dn delete_force(self.ldb_admin, object_dn) self.ldb_admin.create_ou(object_dn) - user_sid = self.sd_utils.get_object_sid( self.get_users_domain_dn(user_name) ) + user_sid = self.sd_utils.get_object_sid(self.get_users_domain_dn(user_name) ) mod = "(A;CI;WPWDCC;;;%s)" % str(user_sid) self.sd_utils.dacl_add_ace(object_dn, mod) # Create additional object into the first one @@ -433,7 +433,7 @@ class OwnerGroupDescriptorTests(DescriptorTests): object_dn = "OU=test_domain_ou1," + self.base_dn delete_force(self.ldb_admin, object_dn) self.ldb_admin.create_ou(object_dn) - user_sid = self.sd_utils.get_object_sid( self.get_users_domain_dn(user_name) ) + user_sid = self.sd_utils.get_object_sid(self.get_users_domain_dn(user_name) ) mod = "(A;CI;WPWDCC;;;%s)" % str(user_sid) self.sd_utils.dacl_add_ace(object_dn, mod) # Create additional object into the first one @@ -553,7 +553,7 @@ class OwnerGroupDescriptorTests(DescriptorTests): object_dn = "OU=test_domain_ou1," + self.base_dn delete_force(self.ldb_admin, object_dn) self.ldb_admin.create_ou(object_dn) - user_sid = self.sd_utils.get_object_sid( self.get_users_domain_dn(user_name) ) + user_sid = self.sd_utils.get_object_sid(self.get_users_domain_dn(user_name) ) mod = "(A;CI;WOWDCC;;;%s)" % str(user_sid) self.sd_utils.dacl_add_ace(object_dn, mod) # Create a custom security descriptor @@ -580,7 +580,7 @@ class OwnerGroupDescriptorTests(DescriptorTests): object_dn = "OU=test_domain_ou1," + self.base_dn delete_force(self.ldb_admin, object_dn) self.ldb_admin.create_ou(object_dn) - user_sid = self.sd_utils.get_object_sid( self.get_users_domain_dn(user_name) ) + user_sid = self.sd_utils.get_object_sid(self.get_users_domain_dn(user_name) ) mod = "(A;CI;WOWDCC;;;%s)" % str(user_sid) self.sd_utils.dacl_add_ace(object_dn, mod) # Create a custom security descriptor @@ -670,7 +670,7 @@ class OwnerGroupDescriptorTests(DescriptorTests): object_dn = "OU=test_domain_ou1," + self.base_dn delete_force(self.ldb_admin, object_dn) self.ldb_admin.create_ou(object_dn) - user_sid = self.sd_utils.get_object_sid( self.get_users_domain_dn(user_name) ) + user_sid = self.sd_utils.get_object_sid(self.get_users_domain_dn(user_name) ) mod = "(D;CI;WP;;;S-1-3-0)" #mod = "" self.sd_utils.dacl_add_ace(object_dn, mod) @@ -691,7 +691,7 @@ class OwnerGroupDescriptorTests(DescriptorTests): # Open Ldb connection with the tested user _ldb = self.get_ldb_connection(user_name, "samba123@") # Change Schema partition descriptor - user_sid = self.sd_utils.get_object_sid( self.get_users_domain_dn(user_name) ) + user_sid = self.sd_utils.get_object_sid(self.get_users_domain_dn(user_name) ) mod = "(A;;WDCC;;;AU)" self.sd_utils.dacl_add_ace(self.schema_dn, mod) # Create example Schema class @@ -737,7 +737,7 @@ class OwnerGroupDescriptorTests(DescriptorTests): # Open Ldb connection with the tested user _ldb = self.get_ldb_connection(user_name, "samba123@") #Change Schema partition descriptor - user_sid = self.sd_utils.get_object_sid( self.get_users_domain_dn(user_name) ) + user_sid = self.sd_utils.get_object_sid(self.get_users_domain_dn(user_name) ) mod = "(A;CI;WDCC;;;AU)" self.sd_utils.dacl_add_ace(self.schema_dn, mod) # Create example Schema class @@ -848,7 +848,7 @@ class OwnerGroupDescriptorTests(DescriptorTests): _ldb = self.get_ldb_connection(user_name, "samba123@") # Create a custom security descriptor # NB! Problematic owner part won't accept DA only <User Sid> !!! - user_sid = self.sd_utils.get_object_sid( self.get_users_domain_dn(user_name) ) + user_sid = self.sd_utils.get_object_sid(self.get_users_domain_dn(user_name) ) desc_sddl = "O:%sG:DAD:(A;;RP;;;DU)" % str(user_sid) # Create example Schema class class_dn = self.create_schema_class(_ldb, desc_sddl) @@ -863,7 +863,7 @@ class OwnerGroupDescriptorTests(DescriptorTests): _ldb = self.get_ldb_connection(user_name, "samba123@") # Create a custom security descriptor # NB! Problematic owner part won't accept DA only <User Sid> !!! - user_sid = self.sd_utils.get_object_sid( self.get_users_domain_dn(user_name) ) + user_sid = self.sd_utils.get_object_sid(self.get_users_domain_dn(user_name) ) desc_sddl = "O:%sG:DAD:(A;;RP;;;DU)" % str(user_sid) # Create example Schema class class_dn = self.create_schema_class(_ldb, desc_sddl) @@ -978,7 +978,7 @@ class OwnerGroupDescriptorTests(DescriptorTests): object_dn = "CN=test-container1,CN=DisplaySpecifiers," + self.configuration_dn delete_force(self.ldb_admin, object_dn) self.create_configuration_container(self.ldb_admin, object_dn, ) - user_sid = self.sd_utils.get_object_sid( self.get_users_domain_dn(user_name) ) + user_sid = self.sd_utils.get_object_sid(self.get_users_domain_dn(user_name) ) mod = "(A;;WDCC;;;AU)" self.sd_utils.dacl_add_ace(object_dn, mod) # Create child object with user's credentials @@ -999,7 +999,7 @@ class OwnerGroupDescriptorTests(DescriptorTests): object_dn = "CN=test-container1,CN=DisplaySpecifiers," + self.configuration_dn delete_force(self.ldb_admin, object_dn) self.create_configuration_container(self.ldb_admin, object_dn, ) - user_sid = self.sd_utils.get_object_sid( self.get_users_domain_dn(user_name) ) + user_sid = self.sd_utils.get_object_sid(self.get_users_domain_dn(user_name) ) mod = "(A;CI;WDCC;;;AU)" self.sd_utils.dacl_add_ace(object_dn, mod) # Create child object with user's credentials @@ -1114,7 +1114,7 @@ class OwnerGroupDescriptorTests(DescriptorTests): object_dn = "CN=test-container1,CN=DisplaySpecifiers," + self.configuration_dn delete_force(self.ldb_admin, object_dn) self.create_configuration_container(self.ldb_admin, object_dn, ) - user_sid = self.sd_utils.get_object_sid( self.get_users_domain_dn(user_name) ) + user_sid = self.sd_utils.get_object_sid(self.get_users_domain_dn(user_name) ) mod = "(A;;CC;;;AU)" self.sd_utils.dacl_add_ace(object_dn, mod) # Create child object with user's credentials @@ -1137,7 +1137,7 @@ class OwnerGroupDescriptorTests(DescriptorTests): object_dn = "CN=test-container1,CN=DisplaySpecifiers," + self.configuration_dn delete_force(self.ldb_admin, object_dn) self.create_configuration_container(self.ldb_admin, object_dn, ) - user_sid = self.sd_utils.get_object_sid( self.get_users_domain_dn(user_name) ) + user_sid = self.sd_utils.get_object_sid(self.get_users_domain_dn(user_name) ) mod = "(A;;CC;;;AU)" self.sd_utils.dacl_add_ace(object_dn, mod) # Create child object with user's credentials diff --git a/source4/dsdb/tests/python/token_group.py b/source4/dsdb/tests/python/token_group.py index f01fd00ab04..f0ef51a5c0b 100755 --- a/source4/dsdb/tests/python/token_group.py +++ b/source4/dsdb/tests/python/token_group.py @@ -69,7 +69,7 @@ class StaticTokenTest(samba.tests.TestCase): self.user_sid_dn = "<SID=%s>" % str(ndr_unpack(samba.dcerpc.security.dom_sid, res[0]["tokenGroups"][0])) - session_info_flags = ( AUTH_SESSION_INFO_DEFAULT_GROUPS | + session_info_flags = (AUTH_SESSION_INFO_DEFAULT_GROUPS | AUTH_SESSION_INFO_AUTHENTICATED | AUTH_SESSION_INFO_SIMPLE_PRIVILEGES) if creds.get_kerberos_state() == DONT_USE_KERBEROS: @@ -280,7 +280,7 @@ class DynamicTokenTest(samba.tests.TestCase): self.test_user_dn = res[0].dn - session_info_flags = ( AUTH_SESSION_INFO_DEFAULT_GROUPS | + session_info_flags = (AUTH_SESSION_INFO_DEFAULT_GROUPS | AUTH_SESSION_INFO_AUTHENTICATED | AUTH_SESSION_INFO_SIMPLE_PRIVILEGES) diff --git a/source4/scripting/devel/speedtest.py b/source4/scripting/devel/speedtest.py index f9abccfa238..2821aa71424 100755 --- a/source4/scripting/devel/speedtest.py +++ b/source4/scripting/devel/speedtest.py @@ -132,17 +132,17 @@ class SpeedTestAddDel(SpeedTest): for x in [1, 2, 3]: start = time.time() self.create_bundle(num) - res_add = Decimal( str(time.time() - start) ) + res_add = Decimal(str(time.time() - start) ) avg_add += res_add - print(" Attempt %s ADD: %.3fs" % ( x, float(res_add) )) + print(" Attempt %s ADD: %.3fs" % (x, float(res_add) )) # start = time.time() self.remove_bundle(num) - res_del = Decimal( str(time.time() - start) ) + res_del = Decimal(str(time.time() - start) ) avg_del += res_del - print(" Attempt %s DEL: %.3fs" % ( x, float(res_del) )) - print("Average ADD: %.3fs" % float( Decimal(avg_add) / Decimal("3.0") )) - print("Average DEL: %.3fs" % float( Decimal(avg_del) / Decimal("3.0") )) + print(" Attempt %s DEL: %.3fs" % (x, float(res_del) )) + print("Average ADD: %.3fs" % float(Decimal(avg_add) / Decimal("3.0") )) + print("Average DEL: %.3fs" % float(Decimal(avg_del) / Decimal("3.0") )) print("") def test_00000(self): @@ -191,10 +191,10 @@ class AclSearchSpeedTest(SpeedTest): for x in [1, 2, 3]: start = time.time() res = _ldb.search(base=self.base_dn, expression="(objectClass=*)", scope=SCOPE_SUBTREE) - res_search = Decimal( str(time.time() - start) ) + res_search = Decimal(str(time.time() - start) ) avg_search += res_search - print(" Attempt %s SEARCH: %.3fs" % ( x, float(res_search) )) - print("Average Search: %.3fs" % float( Decimal(avg_search) / Decimal("3.0") )) + print(" Attempt %s SEARCH: %.3fs" % (x, float(res_search) )) + print("Average Search: %.3fs" % float(Decimal(avg_search) / Decimal("3.0") )) self.remove_bundle(num) def get_user_dn(self, name): diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py index b0aa401e7ca..6ab0d820222 100755 --- a/source4/selftest/tests.py +++ b/source4/selftest/tests.py @@ -275,7 +275,7 @@ for env in ["fl2000dc", "fl2008r2dc"]: plansmbtorture4testsuite("net.api.become.dc", env, '$SERVER[%s] -U$USERNAME%%$PASSWORD -W$DOMAIN' % validate) for bindoptions in ["sign", "seal"]: - plansmbtorture4testsuite('rpc.backupkey', "ad_dc_ntvfs", ["ncacn_np:$SERVER[%s]" % ( bindoptions), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.backupkey with %s" % (bindoptions)) + plansmbtorture4testsuite('rpc.backupkey', "ad_dc_ntvfs", ["ncacn_np:$SERVER[%s]" % (bindoptions), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.backupkey with %s" % (bindoptions)) for transport in transports: for bindoptions in ["sign", "seal"]: @@ -1093,13 +1093,13 @@ for env in [ planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.kcc.kcc_utils") -for env in [ "simpleserver", "fileserver", "nt4_dc", "ad_dc", "ad_dc_ntvfs", - "ad_member", "offlinebackupdc", "restoredc", "renamedc", "labdc" ]: +for env in ["simpleserver", "fileserver", "nt4_dc", "ad_dc", "ad_dc_ntvfs", + "ad_member", "offlinebackupdc", "restoredc", "renamedc", "labdc"]: planoldpythontestsuite(env, "netlogonsvc", extra_path=[os.path.join(srcdir(), 'python/samba/tests')], name="samba.tests.netlogonsvc.python(%s)" % env) -for env in [ "ktest", "ad_member", "ad_dc_no_ntlm" ]: +for env in ["ktest", "ad_member", "ad_dc_no_ntlm" ]: planoldpythontestsuite(env, "ntlmdisabled", extra_path=[os.path.join(srcdir(), 'python/samba/tests')], name="samba.tests.ntlmdisabled.python(%s)" % env) diff --git a/source4/torture/drs/python/repl_rodc.py b/source4/torture/drs/python/repl_rodc.py index 7c0e30bf1f8..6c6a9d29812 100644 --- a/source4/torture/drs/python/repl_rodc.py +++ b/source4/torture/drs/python/repl_rodc.py @@ -661,11 +661,11 @@ class DrsRodcTestCase(drs_base.DrsBaseTestCase): def _create_rodc(self, ctx): - ctx.nc_list = [ ctx.base_dn, ctx.config_dn, ctx.schema_dn ] - ctx.full_nc_list = [ ctx.base_dn, ctx.config_dn, ctx.schema_dn ] + ctx.nc_list = [ctx.base_dn, ctx.config_dn, ctx.schema_dn ] + ctx.full_nc_list = [ctx.base_dn, ctx.config_dn, ctx.schema_dn ] ctx.krbtgt_dn = "CN=krbtgt_%s,CN=Users,%s" % (ctx.myname, ctx.base_dn) - ctx.never_reveal_sid = [ "<SID=%s-%s>" % (ctx.domsid, security.DOMAIN_RID_RODC_DENY), + ctx.never_reveal_sid = ["<SID=%s-%s>" % (ctx.domsid, security.DOMAIN_RID_RODC_DENY), "<SID=%s>" % security.SID_BUILTIN_ADMINISTRATORS, "<SID=%s>" % security.SID_BUILTIN_SERVER_OPERATORS, "<SID=%s>" % security.SID_BUILTIN_BACKUP_OPERATORS, |