From: Joe Guo Date: Mon, 30 Jul 2018 06:19:49 +0000 (+1200) Subject: PEP8: fix E265: block comment should start with '# ' X-Git-Url: http://git.samba.org/samba.git/?a=commitdiff_plain;h=7a07d4223028ed34cca20d2fcdf4f1bca1856c8b;p=amitay%2Fsamba.git PEP8: fix E265: block comment should start with '# ' Signed-off-by: Joe Guo Reviewed-by: Andrew Bartlett Reviewed-by: Douglas Bagnall --- diff --git a/python/samba/__init__.py b/python/samba/__init__.py index a79b1fdf473..f6fb58461a7 100644 --- a/python/samba/__init__.py +++ b/python/samba/__init__.py @@ -99,7 +99,7 @@ class Ldb(_Ldb): # TODO set debug def msg(l, text): print(text) - #self.set_debug(msg) + # self.set_debug(msg) self.set_utf8_casefold() diff --git a/python/samba/graph.py b/python/samba/graph.py index 7ca86bf82e5..2f3bc9c67eb 100644 --- a/python/samba/graph.py +++ b/python/samba/graph.py @@ -395,7 +395,7 @@ COLOUR_SETS = { 'xterm-256color': { 'alternate rows': (colour.xterm_256_colour(39), colour.xterm_256_colour(45)), - #'alternate rows': (colour.xterm_256_colour(246), + # 'alternate rows': (colour.xterm_256_colour(246), # colour.xterm_256_colour(247)), 'disconnected': colour.xterm_256_colour(124, bg=True), 'connected': colour.xterm_256_colour(112), @@ -412,7 +412,7 @@ COLOUR_SETS = { 'xterm-256color-heatmap': { 'alternate rows': (colour.xterm_256_colour(171), colour.xterm_256_colour(207)), - #'alternate rows': (colour.xterm_256_colour(246), + # 'alternate rows': (colour.xterm_256_colour(246), # colour.xterm_256_colour(247)), 'disconnected': colour.xterm_256_colour(124, bg=True), 'connected': colour.xterm_256_colour(112, bg=True), @@ -441,9 +441,9 @@ CHARSETS = { 'vertical': '│', 'horizontal': '─', 'corner': '╭', - #'diagonal': '╲', + # 'diagonal': '╲', 'diagonal': '·', - #'missing': '🕱', + # 'missing': '🕱', 'missing': '-', 'right_arrow': '←', }, diff --git a/python/samba/kcc/__init__.py b/python/samba/kcc/__init__.py index 8f214f2822d..8bb9a3904bb 100644 --- a/python/samba/kcc/__init__.py +++ b/python/samba/kcc/__init__.py @@ -1609,7 +1609,7 @@ class KCC(object): # here, but using vertex seems to make more sense. That is, # the docs want this: # - #bh = self.get_bridgehead(local_vertex.site, vertex.part, transport, + # bh = self.get_bridgehead(local_vertex.site, vertex.part, transport, # local_vertex.is_black(), detect_failed) # # TODO WHY????? diff --git a/python/samba/kcc/debug.py b/python/samba/kcc/debug.py index 4fab33a5089..24c70d0de3a 100644 --- a/python/samba/kcc/debug.py +++ b/python/samba/kcc/debug.py @@ -29,7 +29,7 @@ DEBUG = logger.debug WARN = logger.warning -#colours for prettier logs +# colours for prettier logs from samba.colour import C_NORMAL, REV_RED from samba.colour import DARK_RED, RED from samba.colour import DARK_GREEN, GREEN diff --git a/python/samba/kcc/graph.py b/python/samba/kcc/graph.py index d87530d40c3..327b471201f 100644 --- a/python/samba/kcc/graph.py +++ b/python/samba/kcc/graph.py @@ -130,7 +130,7 @@ def combine_repl_info(info_a, info_b): info_c.interval = max(info_a.interval, info_b.interval) info_c.options = info_a.options & info_b.options - #schedule of None defaults to "always" + # schedule of None defaults to "always" if info_a.schedule is None: info_a.schedule = [0xFF] * 84 if info_b.schedule is None: @@ -262,7 +262,7 @@ def get_spanning_tree_edges(graph, my_site, label=None, verify=False, if verify or dot_file_dir is not None: graph_edges = [[x.site.site_dnstr for x in e.vertices] for e in edge_list] - #add the reverse edge if not directed. + # add the reverse edge if not directed. graph_edges.extend([x.site.site_dnstr for x in reversed(e.vertices)] for e in edge_list if not e.directed) @@ -578,7 +578,7 @@ def kruskal(graph, edges): # Sorted based on internal comparison function of internal edge edges.sort() - #XXX expected_num_tree_edges is never used + # XXX expected_num_tree_edges is never used expected_num_tree_edges = 0 # TODO this value makes little sense count_edges = 0 @@ -734,7 +734,7 @@ class Vertex(object): # SET v.Color to COLOR.RED # ELSEIF s contains one or more partial replicas of the NC # SET v.Color to COLOR.BLACK - #ELSE + # ELSE # SET v.Color to COLOR.WHITE # set to minimum (no replica) diff --git a/python/samba/kcc/kcc_utils.py b/python/samba/kcc/kcc_utils.py index c58d5d23217..b19cc109c51 100644 --- a/python/samba/kcc/kcc_utils.py +++ b/python/samba/kcc/kcc_utils.py @@ -1645,7 +1645,7 @@ class Site(object): i_idx = j_idx t_time = 0 - #XXX doc says current time < c.timeLastSyncSuccess - f + # XXX doc says current time < c.timeLastSyncSuccess - f # which is true only if f is negative or clocks are wrong. # f is not negative in the default case (2 hours). elif self.nt_now - cursor.last_sync_success > f: diff --git a/python/samba/netcmd/drs.py b/python/samba/netcmd/drs.py index 96660e678ef..7f4ca3fc120 100644 --- a/python/samba/netcmd/drs.py +++ b/python/samba/netcmd/drs.py @@ -726,7 +726,7 @@ class cmd_drs_options(Command): dsa_opts |= self.option_map[flag] else: dsa_opts &= ~self.option_map[flag] - #save new options + # save new options m = ldb.Message() m.dn = ldb.Dn(self.samdb, ntds_dn) m["options"] = ldb.MessageElement(str(dsa_opts), ldb.FLAG_MOD_REPLACE, "options") diff --git a/python/samba/netcmd/dsacl.py b/python/samba/netcmd/dsacl.py index 4ca15cdc99d..f5ee9141799 100644 --- a/python/samba/netcmd/dsacl.py +++ b/python/samba/netcmd/dsacl.py @@ -115,7 +115,7 @@ class cmd_dsacl_set(Command): """Add new ace explicitly.""" desc = self.read_descriptor(samdb, object_dn) desc_sddl = desc.as_sddl(self.get_domain_sid(samdb)) - #TODO add bindings for descriptor manipulation and get rid of this + # TODO add bindings for descriptor manipulation and get rid of this desc_aces = re.findall("\(.*?\)", desc_sddl) for ace in desc_aces: if ("ID" in ace): diff --git a/python/samba/netcmd/fsmo.py b/python/samba/netcmd/fsmo.py index 3dab02407dc..5f67b30dedb 100644 --- a/python/samba/netcmd/fsmo.py +++ b/python/samba/netcmd/fsmo.py @@ -269,7 +269,7 @@ You must provide an Admin user and password."""), m.dn = ldb.Dn(samdb, self.schema_dn) else: raise CommandError("Invalid FSMO role.") - #first try to transfer to avoid problem if the owner is still active + # first try to transfer to avoid problem if the owner is still active seize = False master_owner = get_fsmo_roleowner(samdb, m.dn, role) # if there is a different owner @@ -282,7 +282,7 @@ You must provide an Admin user and password."""), try: transfer_role(self.outf, role, samdb) except: - #transfer failed, use the big axe... + # transfer failed, use the big axe... seize = True self.message("Transfer unsuccessful, seizing...") else: @@ -352,7 +352,7 @@ You must provide an Admin user and password."""), m.dn = ldb.Dn(samdb, self.forestdns_dn) else: raise CommandError("Invalid FSMO role.") - #first try to transfer to avoid problem if the owner is still active + # first try to transfer to avoid problem if the owner is still active seize = False master_owner = get_fsmo_roleowner(samdb, m.dn, role) if master_owner is not None: @@ -365,7 +365,7 @@ You must provide an Admin user and password."""), transfer_dns_role(self.outf, sambaopts, credopts, role, samdb) except: - #transfer failed, use the big axe... + # transfer failed, use the big axe... seize = True self.message("Transfer unsuccessful, seizing...") else: diff --git a/python/samba/netcmd/visualize.py b/python/samba/netcmd/visualize.py index 2072d90e955..93c0929326e 100644 --- a/python/samba/netcmd/visualize.py +++ b/python/samba/netcmd/visualize.py @@ -501,7 +501,7 @@ class cmd_ntdsconn(GraphCommand): expression="(objectClass=nTDSConnection)", attrs=['fromServer'], # XXX can't be critical for ldif test - #controls=["search_options:1:2"], + # controls=["search_options:1:2"], controls=["search_options:0:2"], ) diff --git a/python/samba/provision/__init__.py b/python/samba/provision/__init__.py index 7012445b385..0d80200ef95 100644 --- a/python/samba/provision/__init__.py +++ b/python/samba/provision/__init__.py @@ -739,7 +739,7 @@ def make_smbconf(smbconf, hostname, domain, realm, targetdir, if lp is None: lp = samba.param.LoadParm() - #Load non-existent file + # Load non-existent file if os.path.exists(smbconf): lp.load(smbconf) diff --git a/python/samba/provision/backend.py b/python/samba/provision/backend.py index e2e372e8b59..579308899e5 100644 --- a/python/samba/provision/backend.py +++ b/python/samba/provision/backend.py @@ -795,7 +795,7 @@ class FDSBackend(LDAPBackend): # easily kill it self.slapd_provision_command.append("-d0") - #the command for the final run is the normal script + # the command for the final run is the normal script self.slapd_command = \ [os.path.join(self.ldapdir, "slapd-" + self.ldap_instance, "start-slapd")] diff --git a/python/samba/provision/sambadns.py b/python/samba/provision/sambadns.py index e364b37a1f1..3afe94cb9b4 100644 --- a/python/samba/provision/sambadns.py +++ b/python/samba/provision/sambadns.py @@ -383,7 +383,7 @@ def add_rootservers(samdb, domaindn, prefix): for rserver in rootservers: record = [ndr_pack(ARecord(rootservers[rserver], serial=0, ttl=0, rank=dnsp.DNS_RANK_ROOT_HINT))] # Add AAAA record as well (How does W2K* add IPv6 records?) - #if rserver in rootservers_v6: + # if rserver in rootservers_v6: # record.append(ndr_pack(AAAARecord(rootservers_v6[rserver], serial=0, ttl=0))) msg = ldb.Message(ldb.Dn(samdb, "DC=%s,%s" % (rserver, container_dn))) msg["objectClass"] = ["top", "dnsNode"] @@ -1065,7 +1065,7 @@ def fill_dns_data_partitions(samdb, domainsid, site, domaindn, forestdn, :param autofill: Create DNS records (using fixed template) """ - ##### Set up DC=DomainDnsZones, + # Set up DC=DomainDnsZones, # Add rootserver records if add_root: add_rootservers(samdb, domaindn, "DC=DomainDnsZones") @@ -1080,7 +1080,7 @@ def fill_dns_data_partitions(samdb, domainsid, site, domaindn, forestdn, dnsdomain, hostname, hostip, hostip6) if fill_level != FILL_SUBDOMAIN: - ##### Set up DC=ForestDnsZones, + # Set up DC=ForestDnsZones, # Add _msdcs record add_msdcs_record(samdb, forestdn, "DC=ForestDnsZones", dnsforest) diff --git a/python/samba/tests/dcerpc/testrpc.py b/python/samba/tests/dcerpc/testrpc.py index f8191ba2dbe..1ebe34e6247 100644 --- a/python/samba/tests/dcerpc/testrpc.py +++ b/python/samba/tests/dcerpc/testrpc.py @@ -95,10 +95,10 @@ class RpcTests(object): continue value = getattr(interface, n) if isinstance(value, str): - #print "%s=\"%s\"" % (n, value) + # print "%s=\"%s\"" % (n, value) pass elif isinstance(value, int) or isinstance(value, long): - #print "%s=%d" % (n, value) + # print "%s=%d" % (n, value) pass elif isinstance(value, type): try: diff --git a/python/samba/tests/kcc/graph_utils.py b/python/samba/tests/kcc/graph_utils.py index b027838e78f..2ba7f440664 100644 --- a/python/samba/tests/kcc/graph_utils.py +++ b/python/samba/tests/kcc/graph_utils.py @@ -130,7 +130,7 @@ class UndirectedGraphTests(samba.tests.TestCase): self.assertIsNone(fn(*self.complete_graph)) def test_graph_connected_under_vertex_failures(self): - #XXX no tests to distinguish this from the edge_failures case + # XXX no tests to distinguish this from the edge_failures case fn = verify_graph_connected_under_vertex_failures self.assertGraphError(fn, *self.line) diff --git a/python/samba/tests/kcc/ldif_import_export.py b/python/samba/tests/kcc/ldif_import_export.py index 1350f9b5e96..47eb3c3ffbc 100644 --- a/python/samba/tests/kcc/ldif_import_export.py +++ b/python/samba/tests/kcc/ldif_import_export.py @@ -235,7 +235,7 @@ class KCCMultisiteLdifTests(samba.tests.TestCaseInTempDir): r = subprocess.call([dot, '-Tcanon', ffn]) self.assertEqual(r, 0) - #even if dot is not there, at least check the file is non-empty + # even if dot is not there, at least check the file is non-empty size = os.stat(ffn).st_size self.assertNotEqual(size, 0) files.append(ffn) diff --git a/python/samba/tests/posixacl.py b/python/samba/tests/posixacl.py index 5926c11b158..68dbaa63543 100644 --- a/python/samba/tests/posixacl.py +++ b/python/samba/tests/posixacl.py @@ -104,7 +104,7 @@ class PosixAclMappingTests(TestCaseInTempDir): backend_obj.wrap_setxattr(dbname, self.tempf, "system.fake_access_acl", b"") - #however, as this is direct DB access, we do not notice it + # however, as this is direct DB access, we do not notice it facl = getntacl(self.lp, self.tempf, direct_db_access=True) anysid = security.dom_sid(security.SID_NT_SELF) self.assertEquals(acl, facl.as_sddl(anysid)) @@ -119,7 +119,7 @@ class PosixAclMappingTests(TestCaseInTempDir): backend_obj.wrap_setxattr(dbname, self.tempf, "system.fake_access_acl", b"") - #the hash would break, and we return an ACL based only on the mode, except we set the ACL using the 'ntvfs' mode that doesn't include a hash + # the hash would break, and we return an ACL based only on the mode, except we set the ACL using the 'ntvfs' mode that doesn't include a hash facl = getntacl(self.lp, self.tempf) anysid = security.dom_sid(security.SID_NT_SELF) self.assertEquals(acl, facl.as_sddl(anysid)) @@ -136,7 +136,7 @@ class PosixAclMappingTests(TestCaseInTempDir): backend_obj.wrap_setxattr(dbname, self.tempf, "system.fake_access_acl", b"") - #the hash will break, and we return an ACL based only on the mode + # the hash will break, and we return an ACL based only on the mode facl = getntacl(self.lp, self.tempf, direct_db_access=False) anysid = security.dom_sid(security.SID_NT_SELF) self.assertEquals(simple_acl_from_posix, facl.as_sddl(anysid)) diff --git a/python/samba/tests/samba3sam.py b/python/samba/tests/samba3sam.py index 1221435fcbc..8ea6cad060f 100644 --- a/python/samba/tests/samba3sam.py +++ b/python/samba/tests/samba3sam.py @@ -234,7 +234,7 @@ class Samba3SamTestCase(MapBaseTestCase): # Checking for existence of record (local || remote) msg = self.ldb.search(expression="(|(unixName=bin)(sambaUnicodePwd=geheim))", attrs=['unixName', 'cn', 'dn', 'sambaUnicodePwd']) - #print "got %d replies" % len(msg) + # print "got %d replies" % len(msg) self.assertEquals(len(msg), 1) # TODO: should check with more records self.assertEquals(str(msg[0]["cn"]), "Niemand") self.assertEquals(str(msg[0]["unixName"]), "bin") @@ -484,7 +484,7 @@ objectSid: S-1-5-21-4231626423-2410014848-2360679739-1052 # TODO: # Using the SID directly in the parse tree leads to conversion # errors, letting the search fail with no results. - #res = self.ldb.search("(objectSid=S-1-5-21-4231626423-2410014848-2360679739-1052)", scope=SCOPE_DEFAULT, attrs) + # res = self.ldb.search("(objectSid=S-1-5-21-4231626423-2410014848-2360679739-1052)", scope=SCOPE_DEFAULT, attrs) res = self.ldb.search(expression="(objectSid=*)", base=None, scope=SCOPE_DEFAULT, attrs=["dnsHostName", "lastLogon", "objectSid"]) self.assertEquals(len(res), 4) res = sorted(res, key=attrgetter('dn')) @@ -514,9 +514,9 @@ objectSid: S-1-5-21-4231626423-2410014848-2360679739-1052 # Note that Xs "objectSid" seems to be fine in the previous search for # "objectSid"... - #res = ldb.search(expression="(primaryGroupID=*)", NULL, ldb. SCOPE_DEFAULT, attrs) - #print len(res) + " results found" - #for i in range(len(res)): + # res = ldb.search(expression="(primaryGroupID=*)", NULL, ldb. SCOPE_DEFAULT, attrs) + # print len(res) + " results found" + # for i in range(len(res)): # for (obj in res[i]) { # print obj + ": " + res[i][obj] # } diff --git a/source3/script/tests/test_wbinfo_sids2xids_int.py b/source3/script/tests/test_wbinfo_sids2xids_int.py index fe488300d4c..bc3710d716f 100755 --- a/source3/script/tests/test_wbinfo_sids2xids_int.py +++ b/source3/script/tests/test_wbinfo_sids2xids_int.py @@ -32,8 +32,8 @@ domsid = subprocess.Popen([wbinfo, "-n", domain + "/"], stdout=subprocess.PIPE).communicate()[0] domsid = domsid.split(' ')[0] -#print domain -#print domsid +# print domain +# print domsid sids = [domsid + '-512', 'S-1-5-32-545', domsid + '-513', 'S-1-1-0', 'S-1-3-1', 'S-1-5-1'] diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py index 09711ce76a6..066d0beaf5e 100755 --- a/source3/selftest/tests.py +++ b/source3/selftest/tests.py @@ -335,7 +335,7 @@ for env in ["fileserver"]: plantestsuite("samba3.blackbox.net_usershare", "fileserver:local", [os.path.join(samba3srcdir, "script/tests/test_net_usershare.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', smbclient3]) -#TODO encrypted against member, with member creds, and with DC creds +# TODO encrypted against member, with member creds, and with DC creds plantestsuite("samba3.blackbox.net.misc", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/test_net_misc.sh"), scriptdir, "$SMB_CONF_PATH", net, configuration]) @@ -379,7 +379,7 @@ if with_pthreadpool and have_ldwrap: plantestsuite("samba3.async_req", "nt4_dc", [os.path.join(samba3srcdir, "script/tests/test_async_req.sh")]) -#smbtorture4 tests +# smbtorture4 tests base = ["base.attr", "base.charset", "base.chkpath", "base.createx_access", "base.defer_open", "base.delaywrite", "base.delete", "base.deny1", "base.deny2", "base.deny3", "base.denydos", "base.dir1", "base.dir2", diff --git a/source4/dsdb/tests/python/acl.py b/source4/dsdb/tests/python/acl.py index bea78a341e0..71020efb26d 100755 --- a/source4/dsdb/tests/python/acl.py +++ b/source4/dsdb/tests/python/acl.py @@ -77,7 +77,7 @@ class AclTests(samba.tests.TestCase): self.configuration_dn = self.ldb_admin.get_config_basedn().get_linearized() self.sd_utils = sd_utils.SDUtils(self.ldb_admin) self.addCleanup(self.delete_admin_connection) - #used for anonymous login + # used for anonymous login self.creds_tmp = Credentials() self.creds_tmp.set_username("") self.creds_tmp.set_password("") @@ -116,7 +116,7 @@ class AclTests(samba.tests.TestCase): del self.sd_utils del self.ldb_admin -#tests on ldap add operations +# tests on ldap add operations class AclAddTests(AclTests): def setUp(self): @@ -269,7 +269,7 @@ class AclAddTests(AclTests): else: self.fail() -#tests on ldap modify operations +# tests on ldap modify operations class AclModifyTests(AclTests): def setUp(self): @@ -545,7 +545,7 @@ dn: CN=test_modify_group2,CN=Users,""" + self.base_dn + """ changetype: modify add: Member Member: """ + self.get_user_dn(self.user_with_sm) -#the user has no rights granted, this should fail +# the user has no rights granted, this should fail try: self.ldb_user2.modify_ldif(ldif) except LdbError as e11: @@ -555,7 +555,7 @@ Member: """ + self.get_user_dn(self.user_with_sm) # This 'modify' operation should always throw ERR_INSUFFICIENT_ACCESS_RIGHTS self.fail() -#grant self-membership, should be able to add himself +# grant self-membership, should be able to add himself user_sid = self.sd_utils.get_object_sid(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) @@ -563,7 +563,7 @@ Member: """ + self.get_user_dn(self.user_with_sm) 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 +# but not other users ldif = """ dn: CN=test_modify_group2,CN=Users,""" + self.base_dn + """ changetype: modify @@ -586,7 +586,7 @@ add: Member Member: """ + self.get_user_dn(self.user_with_sm) + """ Member: CN=test_modify_user2,CN=Users,""" + self.base_dn -#grant self-membership, should be able to add himself but not others at the same time +# grant self-membership, should be able to add himself but not others at the same time user_sid = self.sd_utils.get_object_sid(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) @@ -600,7 +600,7 @@ Member: CN=test_modify_user2,CN=Users,""" + self.base_dn def test_modify_u7(self): """13 User with WP modifying Member""" -#a second user is given write property permission +# a second user is given write property permission user_sid = self.sd_utils.get_object_sid(self.get_user_dn(self.user_with_wp)) mod = "(A;;WP;;;%s)" % str(user_sid) self.sd_utils.dacl_add_ace("CN=test_modify_group2,CN=Users," + self.base_dn, mod) @@ -646,7 +646,7 @@ Member: CN=test_modify_user2,CN=Users,""" + self.base_dn else: self.fail() -#enable these when we have search implemented +# enable these when we have search implemented class AclSearchTests(AclTests): def setUp(self): @@ -726,8 +726,8 @@ class AclSearchTests(AclTests): anonymous = SamDB(url=ldaphost, credentials=self.creds_tmp, lp=lp) res = anonymous.search("", expression="(objectClass=*)", scope=SCOPE_BASE) self.assertEquals(len(res), 1) - #verify some of the attributes - #don't care about values + # verify some of the attributes + # don't care about values self.assertTrue("ldapServiceName" in res[0]) self.assertTrue("namingContexts" in res[0]) self.assertTrue("isSynchronized" in res[0]) @@ -796,7 +796,7 @@ class AclSearchTests(AclTests): self.ldb_admin.create_ou("OU=ou5,OU=ou3,OU=ou2,OU=ou1," + self.base_dn, sd=tmp_desc) self.ldb_admin.create_ou("OU=ou6,OU=ou4,OU=ou2,OU=ou1," + self.base_dn, sd=tmp_desc) - #regular users must see only ou1 and ou2 + # regular users must see only ou1 and ou2 res = self.ldb_user3.search("OU=ou1," + self.base_dn, expression="(objectClass=*)", scope=SCOPE_SUBTREE) self.assertEquals(len(res), 2) @@ -806,7 +806,7 @@ class AclSearchTests(AclTests): 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 + # 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) @@ -831,11 +831,11 @@ class AclSearchTests(AclTests): self.sd_utils.dacl_add_ace("OU=ou2,OU=ou1," + self.base_dn, mod) res = self.ldb_user3.search("OU=ou1," + self.base_dn, expression="(objectClass=*)", scope=SCOPE_SUBTREE) - #this user should see all ous + # this user should see all ous 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 + # these users should see ou1, 2, 5 and 6 but not 3 and 4 res = self.ldb_user.search("OU=ou1," + self.base_dn, expression="(objectClass=*)", scope=SCOPE_SUBTREE) ok_list = [Dn(self.ldb_admin, "OU=ou2,OU=ou1," + self.base_dn), @@ -890,7 +890,7 @@ class AclSearchTests(AclTests): 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)] - #should not see ou3 and ou4, but should see ou5 and ou6 + # should not see ou3 and ou4, but should see ou5 and ou6 res = self.ldb_user.search("OU=ou1," + self.base_dn, expression="(objectClass=*)", scope=SCOPE_SUBTREE) self.assertEquals(len(res), 4) @@ -953,7 +953,7 @@ class AclSearchTests(AclTests): res_list = list(res[0].keys()) self.assertEquals(res_list, ok_list) - #give read property on ou and assert user can only see dn and ou + # give read property on ou and assert user can only see dn and ou mod = "(OA;;RP;bf9679f0-0de6-11d0-a285-00aa003049e2;;%s)" % (str(self.user_sid)) self.sd_utils.dacl_add_ace("OU=ou1," + self.base_dn, mod) self.sd_utils.dacl_add_ace("OU=ou2,OU=ou1," + self.base_dn, mod) @@ -964,7 +964,7 @@ class AclSearchTests(AclTests): res_list = list(res[0].keys()) self.assertEquals(sorted(res_list), sorted(ok_list)) - #give read property on Public Information and assert user can see ou and other members + # give read property on Public Information and assert user can see ou and other members mod = "(OA;;RP;e48d0154-bcf8-11d1-8702-00c04fb96050;;%s)" % (str(self.user_sid)) self.sd_utils.dacl_add_ace("OU=ou1," + self.base_dn, mod) self.sd_utils.dacl_add_ace("OU=ou2,OU=ou1," + self.base_dn, mod) @@ -987,10 +987,10 @@ class AclSearchTests(AclTests): res = self.ldb_user.search("OU=ou1," + self.base_dn, expression="(ou=ou3)", scope=SCOPE_SUBTREE) - #nothing should be returned as ou is not accessible + # nothing should be returned as ou is not accessible self.assertEquals(len(res), 0) - #give read property on ou and assert user can only see dn and ou + # give read property on ou and assert user can only see dn and ou mod = "(OA;;RP;bf9679f0-0de6-11d0-a285-00aa003049e2;;%s)" % (str(self.user_sid)) self.sd_utils.dacl_add_ace("OU=ou3,OU=ou2,OU=ou1," + self.base_dn, mod) res = self.ldb_user.search("OU=ou1," + self.base_dn, expression="(ou=ou3)", @@ -1000,7 +1000,7 @@ class AclSearchTests(AclTests): res_list = list(res[0].keys()) self.assertEquals(sorted(res_list), sorted(ok_list)) - #give read property on Public Information and assert user can see ou and other members + # give read property on Public Information and assert user can see ou and other members mod = "(OA;;RP;e48d0154-bcf8-11d1-8702-00c04fb96050;;%s)" % (str(self.user_sid)) self.sd_utils.dacl_add_ace("OU=ou2,OU=ou1," + self.base_dn, mod) res = self.ldb_user.search("OU=ou1," + self.base_dn, expression="(ou=ou2)", @@ -1078,7 +1078,8 @@ class AclSearchTests(AclTests): self.assert_search_on_attr(str(ou1_dn), self.ldb_admin, attr, expected_list=self.full_list) -#tests on ldap delete operations + +# tests on ldap delete operations class AclDeleteTests(AclTests): def setUp(self): @@ -1148,7 +1149,7 @@ class AclDeleteTests(AclTests): else: self.fail() -#tests on ldap rename operations +# tests on ldap rename operations class AclRenameTests(AclTests): def setUp(self): @@ -1391,12 +1392,12 @@ class AclRenameTests(AclTests): self.assertEquals(num, ERR_INSUFFICIENT_ACCESS_RIGHTS) else: self.fail() - #add an allow ace so we can delete this ou + # add an allow ace so we can delete this ou mod = "(A;;DC;;;DA)" self.sd_utils.dacl_add_ace(ou1_dn, mod) -#tests on Control Access Rights +# tests on Control Access Rights class AclCARTests(AclTests): def setUp(self): @@ -1432,7 +1433,7 @@ class AclCARTests(AclTests): def test_change_password1(self): """Try a password change operation without any CARs given""" - #users have change password by default - remove for negative testing + # users have change password by default - remove for negative testing desc = self.sd_utils.read_sd_on_dn(self.get_user_dn(self.user_with_wp)) sddl = desc.as_sddl(self.domain_sid) sddl = sddl.replace("(OA;;CR;ab721a53-1e2f-11d0-9819-00aa0040529b;;WD)", "") @@ -1562,11 +1563,11 @@ userPassword: thatsAcomplPASS2 def test_change_password7(self): """Try a password change operation without any CARs given""" - #users have change password by default - remove for negative testing + # users have change password by default - remove for negative testing desc = self.sd_utils.read_sd_on_dn(self.get_user_dn(self.user_with_wp)) sddl = desc.as_sddl(self.domain_sid) self.sd_utils.modify_sd_on_dn(self.get_user_dn(self.user_with_wp), sddl) - #first change our own password + # first change our own password self.ldb_user2.modify_ldif(""" dn: """ + self.get_user_dn(self.user_with_pc) + """ changetype: modify @@ -1575,7 +1576,7 @@ unicodePwd:: """ + base64.b64encode("\"samba123@\"".encode('utf-16-le')).decode( add: unicodePwd unicodePwd:: """ + base64.b64encode("\"thatsAcomplPASS1\"".encode('utf-16-le')).decode('utf8') + """ """) - #then someone else's + # then someone else's self.ldb_user2.modify_ldif(""" dn: """ + self.get_user_dn(self.user_with_wp) + """ changetype: modify @@ -1701,11 +1702,11 @@ class AclExtendedTests(AclTests): def setUp(self): super(AclExtendedTests, self).setUp() - #regular user, will be the creator + # regular user, will be the creator self.u1 = "ext_u1" - #regular user + # regular user self.u2 = "ext_u2" - #admin user + # admin user self.u3 = "ext_u3" self.ldb_admin.newuser(self.u1, self.user_pass) self.ldb_admin.newuser(self.u2, self.user_pass) @@ -1731,31 +1732,31 @@ class AclExtendedTests(AclTests): del self.ldb_user3 def test_ntSecurityDescriptor(self): - #create empty ou + # create empty ou self.ldb_admin.create_ou("ou=ext_ou1," + self.base_dn) - #give u1 Create children access + # give u1 Create children access mod = "(A;;CC;;;%s)" % str(self.user_sid1) self.sd_utils.dacl_add_ace("OU=ext_ou1," + self.base_dn, mod) mod = "(A;;LC;;;%s)" % str(self.user_sid2) self.sd_utils.dacl_add_ace("OU=ext_ou1," + self.base_dn, mod) - #create a group under that, grant RP to u2 + # create a group under that, grant RP to u2 self.ldb_user1.newgroup("ext_group1", groupou="OU=ext_ou1", grouptype=samba.dsdb.GTYPE_DISTRIBUTION_DOMAIN_LOCAL_GROUP) mod = "(A;;RP;;;%s)" % str(self.user_sid2) self.sd_utils.dacl_add_ace("CN=ext_group1,OU=ext_ou1," + self.base_dn, mod) - #u2 must not read the descriptor + # u2 must not read the descriptor res = self.ldb_user2.search("CN=ext_group1,OU=ext_ou1," + self.base_dn, SCOPE_BASE, None, ["nTSecurityDescriptor"]) self.assertNotEqual(len(res), 0) self.assertFalse("nTSecurityDescriptor" in res[0].keys()) - #grant RC to u2 - still no access + # grant RC to u2 - still no access mod = "(A;;RC;;;%s)" % str(self.user_sid2) self.sd_utils.dacl_add_ace("CN=ext_group1,OU=ext_ou1," + self.base_dn, mod) res = self.ldb_user2.search("CN=ext_group1,OU=ext_ou1," + self.base_dn, SCOPE_BASE, None, ["nTSecurityDescriptor"]) self.assertNotEqual(len(res), 0) self.assertFalse("nTSecurityDescriptor" in res[0].keys()) - #u3 is member of administrators group, should be able to read sd + # 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) @@ -2040,7 +2041,7 @@ class AclSPNTests(AclTests): self.replace_spn(self.ldb_user1, ctx.acct_dn, "ldap/%s._msdcs.%s" % (ctx.ntds_guid, ctx.dnsdomain)) - #the following spns do not match the restrictions and should fail + # the following spns do not match the restrictions and should fail try: self.replace_spn(self.ldb_user1, ctx.acct_dn, "ldap/%s.%s/ForestDnsZones.%s" % (ctx.myname, ctx.dnsdomain, ctx.dnsdomain)) @@ -2109,7 +2110,7 @@ class AclSPNTests(AclTests): (self.computername, self.dcctx.dnsdomain)) self.replace_spn(self.ldb_admin, self.computerdn, "nosuchservice/%s/%s" % ("abcd", "abcd")) - #user has neither WP nor Validated-SPN, access denied expected + # user has neither WP nor Validated-SPN, access denied expected try: self.replace_spn(self.ldb_user1, self.computerdn, "HOST/%s/%s" % (self.computername, netbiosdomain)) except LdbError as e45: @@ -2118,8 +2119,8 @@ class AclSPNTests(AclTests): mod = "(OA;;SW;f3a64788-5306-11d1-a9c5-0000f80367c1;;%s)" % str(self.user_sid1) self.sd_utils.dacl_add_ace(self.computerdn, mod) - #grant Validated-SPN and check which values are accepted - #see 3.1.1.5.3.1.1.4 servicePrincipalName for reference + # grant Validated-SPN and check which values are accepted + # see 3.1.1.5.3.1.1.4 servicePrincipalName for reference # for regular computer objects we shouldalways get constraint violation diff --git a/source4/dsdb/tests/python/dirsync.py b/source4/dsdb/tests/python/dirsync.py index 97332760122..0f49fd7e630 100755 --- a/source4/dsdb/tests/python/dirsync.py +++ b/source4/dsdb/tests/python/dirsync.py @@ -83,7 +83,7 @@ class DirsyncBaseTests(samba.tests.TestCase): self.user_pass = samba.generate_random_password(12, 16) self.configuration_dn = self.ldb_admin.get_config_basedn().get_linearized() self.sd_utils = sd_utils.SDUtils(self.ldb_admin) - #used for anonymous login + # used for anonymous login print("baseDN: %s" % self.base_dn) def get_user_dn(self, name): @@ -103,7 +103,7 @@ class DirsyncBaseTests(samba.tests.TestCase): return ldb_target -#tests on ldap add operations +# tests on ldap add operations class SimpleDirsyncTests(DirsyncBaseTests): def setUp(self): @@ -141,7 +141,7 @@ class SimpleDirsyncTests(DirsyncBaseTests): except Exception: pass - #def test_dirsync_errors(self): + # def test_dirsync_errors(self): def test_dirsync_supported(self): """Test the basic of the dirsync is supported""" diff --git a/source4/dsdb/tests/python/ldap.py b/source4/dsdb/tests/python/ldap.py index 95c721e7499..8dec06f1acf 100755 --- a/source4/dsdb/tests/python/ldap.py +++ b/source4/dsdb/tests/python/ldap.py @@ -1093,7 +1093,7 @@ class BasicTests(samba.tests.TestCase): delete_force(self.ldb, "cn=ldaptestgroup,cn=users," + self.base_dn) - #only write is allowed with NC_HEAD for originating updates + # only write is allowed with NC_HEAD for originating updates try: self.ldb.add({ "dn": "cn=ldaptestuser2,cn=users," + self.base_dn, diff --git a/source4/dsdb/tests/python/sec_descriptor.py b/source4/dsdb/tests/python/sec_descriptor.py index 858f9337e18..a0b5ccc9412 100755 --- a/source4/dsdb/tests/python/sec_descriptor.py +++ b/source4/dsdb/tests/python/sec_descriptor.py @@ -161,7 +161,7 @@ showInAdvancedViewOnly: TRUE ################################################################################################ - ## Tests for DOMAIN + # Tests for DOMAIN # Default descriptor tests ##################################################################### @@ -190,7 +190,7 @@ class OwnerGroupDescriptorTests(DescriptorTests): def setUp(self): super(OwnerGroupDescriptorTests, self).setUp() self.deleteAll() - ### Create users + # Create users # User 1 - Enterprise Admins self.ldb_admin.newuser("testuser1", "samba123@") # User 2 - Domain Admins @@ -444,7 +444,7 @@ class OwnerGroupDescriptorTests(DescriptorTests): desc_sddl = self.sd_utils.get_sd_as_sddl(object_dn) res = re.search("(O:.*G:.*?)D:", desc_sddl).group(1) self.assertEqual(self.results[self.DS_BEHAVIOR][self._testMethodName[5:]] % str(user_sid), res) - #this fails, research why + # this fails, research why #self.check_modify_inheritance(_ldb, object_dn) def test_104(self): @@ -681,7 +681,7 @@ class OwnerGroupDescriptorTests(DescriptorTests): self.ldb_admin.create_ou(object_dn) desc_sddl = self.sd_utils.get_sd_as_sddl(object_dn) - ## Tests for SCHEMA + # Tests for SCHEMA # Defalt descriptor tests ################################################################## @@ -736,7 +736,7 @@ class OwnerGroupDescriptorTests(DescriptorTests): self.check_user_belongs(self.get_users_domain_dn(user_name), []) # Open Ldb connection with the tested user _ldb = self.get_ldb_connection(user_name, "samba123@") - #Change Schema partition descriptor + # Change Schema partition descriptor 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) @@ -752,7 +752,7 @@ class OwnerGroupDescriptorTests(DescriptorTests): self.check_user_belongs(self.get_users_domain_dn(user_name), ["Enterprise Admins", "Domain Admins"]) # Open Ldb connection with the tested user _ldb = self.get_ldb_connection(user_name, "samba123@") - #Change Schema partition descriptor + # Change Schema partition descriptor mod = "(A;CI;WDCC;;;AU)" self.sd_utils.dacl_add_ace(self.schema_dn, mod) # Create example Schema class @@ -935,7 +935,7 @@ class OwnerGroupDescriptorTests(DescriptorTests): res = re.search("(O:.*G:.*?)D:", desc_sddl).group(1) self.assertEqual("O:DAG:DA", res) - ## Tests for CONFIGURATION + # Tests for CONFIGURATION # Defalt descriptor tests ################################################################## @@ -1959,7 +1959,7 @@ class RightsAttributesTests(DescriptorTests): def setUp(self): super(RightsAttributesTests, self).setUp() self.deleteAll() - ### Create users + # Create users # User 1 self.ldb_admin.newuser("testuser_attr", "samba123@") # User 2, Domain Admins @@ -1974,36 +1974,36 @@ class RightsAttributesTests(DescriptorTests): self.ldb_admin.create_ou(object_dn) print(self.get_users_domain_dn("testuser_attr")) user_sid = self.sd_utils.get_object_sid(self.get_users_domain_dn("testuser_attr")) - #give testuser1 read access so attributes can be retrieved + # give testuser1 read access so attributes can be retrieved mod = "(A;CI;RP;;;%s)" % str(user_sid) self.sd_utils.dacl_add_ace(object_dn, mod) _ldb = self.get_ldb_connection("testuser_attr", "samba123@") res = _ldb.search(base=object_dn, expression="", scope=SCOPE_BASE, attrs=["sDRightsEffective"]) - #user whould have no rights at all + # user whould have no rights at all self.assertEquals(len(res), 1) self.assertEquals(res[0]["sDRightsEffective"][0], "0") - #give the user Write DACL and see what happens + # give the user Write DACL and see what happens mod = "(A;CI;WD;;;%s)" % str(user_sid) self.sd_utils.dacl_add_ace(object_dn, mod) res = _ldb.search(base=object_dn, expression="", scope=SCOPE_BASE, attrs=["sDRightsEffective"]) - #user whould have DACL_SECURITY_INFORMATION + # user whould have DACL_SECURITY_INFORMATION self.assertEquals(len(res), 1) self.assertEquals(res[0]["sDRightsEffective"][0], ("%d") % SECINFO_DACL) - #give the user Write Owners and see what happens + # give the user Write Owners and see what happens mod = "(A;CI;WO;;;%s)" % str(user_sid) self.sd_utils.dacl_add_ace(object_dn, mod) res = _ldb.search(base=object_dn, expression="", scope=SCOPE_BASE, attrs=["sDRightsEffective"]) - #user whould have DACL_SECURITY_INFORMATION, OWNER_SECURITY_INFORMATION, GROUP_SECURITY_INFORMATION + # user whould have DACL_SECURITY_INFORMATION, OWNER_SECURITY_INFORMATION, GROUP_SECURITY_INFORMATION self.assertEquals(len(res), 1) self.assertEquals(res[0]["sDRightsEffective"][0], ("%d") % (SECINFO_DACL | SECINFO_GROUP | SECINFO_OWNER)) - #no way to grant security privilege bu adding ACE's so we use a memeber of Domain Admins + # no way to grant security privilege bu adding ACE's so we use a memeber of Domain Admins _ldb = self.get_ldb_connection("testuser_attr2", "samba123@") res = _ldb.search(base=object_dn, expression="", scope=SCOPE_BASE, attrs=["sDRightsEffective"]) - #user whould have DACL_SECURITY_INFORMATION, OWNER_SECURITY_INFORMATION, GROUP_SECURITY_INFORMATION + # user whould have DACL_SECURITY_INFORMATION, OWNER_SECURITY_INFORMATION, GROUP_SECURITY_INFORMATION self.assertEquals(len(res), 1) self.assertEquals(res[0]["sDRightsEffective"][0], \ ("%d") % (SECINFO_DACL | SECINFO_GROUP | SECINFO_OWNER | SECINFO_SACL)) @@ -2013,16 +2013,16 @@ class RightsAttributesTests(DescriptorTests): 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("testuser_attr")) - #give testuser1 read access so attributes can be retrieved + # give testuser1 read access so attributes can be retrieved mod = "(A;CI;RP;;;%s)" % str(user_sid) self.sd_utils.dacl_add_ace(object_dn, mod) _ldb = self.get_ldb_connection("testuser_attr", "samba123@") res = _ldb.search(base=object_dn, expression="", scope=SCOPE_BASE, attrs=["allowedChildClassesEffective"]) - #there should be no allowed child classes + # there should be no allowed child classes self.assertEquals(len(res), 1) self.assertFalse("allowedChildClassesEffective" in res[0].keys()) - #give the user the right to create children of type user + # give the user the right to create children of type user mod = "(OA;CI;CC;bf967aba-0de6-11d0-a285-00aa003049e2;;%s)" % str(user_sid) self.sd_utils.dacl_add_ace(object_dn, mod) res = _ldb.search(base=object_dn, expression="", scope=SCOPE_BASE, @@ -2037,16 +2037,16 @@ class RightsAttributesTests(DescriptorTests): 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("testuser_attr")) - #give testuser1 read access so attributes can be retrieved + # give testuser1 read access so attributes can be retrieved mod = "(A;CI;RP;;;%s)" % str(user_sid) self.sd_utils.dacl_add_ace(object_dn, mod) _ldb = self.get_ldb_connection("testuser_attr", "samba123@") res = _ldb.search(base=object_dn, expression="", scope=SCOPE_BASE, attrs=["allowedAttributesEffective"]) - #there should be no allowed attributes + # there should be no allowed attributes self.assertEquals(len(res), 1) self.assertFalse("allowedAttributesEffective" in res[0].keys()) - #give the user the right to write displayName and managedBy + # give the user the right to write displayName and managedBy mod2 = "(OA;CI;WP;bf967953-0de6-11d0-a285-00aa003049e2;;%s)" % str(user_sid) mod = "(OA;CI;WP;0296c120-40da-11d1-a9c0-0000f80367c1;;%s)" % str(user_sid) # also rights to modify an read only attribute, fromEntry diff --git a/source4/dsdb/tests/python/sites.py b/source4/dsdb/tests/python/sites.py index 17d3c960bdb..4c2bb5e9cad 100755 --- a/source4/dsdb/tests/python/sites.py +++ b/source4/dsdb/tests/python/sites.py @@ -81,7 +81,7 @@ class SitesBaseTests(samba.tests.TestCase): return "CN=%s,CN=Users,%s" % (name, self.base_dn) -#tests on sites +# tests on sites class SimpleSitesTests(SitesBaseTests): def test_create_and_delete(self): diff --git a/source4/dsdb/tests/python/tombstone_reanimation.py b/source4/dsdb/tests/python/tombstone_reanimation.py index 9922f7cc568..39960f2d12d 100755 --- a/source4/dsdb/tests/python/tombstone_reanimation.py +++ b/source4/dsdb/tests/python/tombstone_reanimation.py @@ -338,14 +338,14 @@ class BaseRestoreObjectTestCase(RestoredObjectAttributesBaseTestCase): except LdbError as e4: (num, _) = e4.args self.assertEquals(num, ERR_OPERATIONS_ERROR) - #try to undelete from config to base dn + # try to undelete from config to base dn try: self.restore_deleted_object(self.samdb, objDeleted2.dn, c4) self.fail() except LdbError as e5: (num, _) = e5.args self.assertEquals(num, ERR_OPERATIONS_ERROR) - #assert undeletion will work in same nc + # assert undeletion will work in same nc self.restore_deleted_object(self.samdb, objDeleted1.dn, c4) self.restore_deleted_object(self.samdb, objDeleted2.dn, c3) diff --git a/source4/dsdb/tests/python/vlv.py b/source4/dsdb/tests/python/vlv.py index 82616876e20..73b59abaab8 100644 --- a/source4/dsdb/tests/python/vlv.py +++ b/source4/dsdb/tests/python/vlv.py @@ -521,7 +521,7 @@ class VLVTests(samba.tests.TestCase): start = max(before - 1, 1) end = max(start + 4, original_n - after + 2) for offset in range(start, end): - #if iteration > 2076: + # if iteration > 2076: # return cookie = get_cookie(controls, original_n) vlv_search = encode_vlv_control(before=before, diff --git a/source4/scripting/devel/repl_cleartext_pwd.py b/source4/scripting/devel/repl_cleartext_pwd.py index 1c5100b629c..c6c76e6db13 100755 --- a/source4/scripting/devel/repl_cleartext_pwd.py +++ b/source4/scripting/devel/repl_cleartext_pwd.py @@ -144,8 +144,8 @@ if __name__ == "__main__": store_utdv = ndr_unpack(drsblobs.replUpToDateVectorBlob, store_utdv_blob) assert store_dn == dn - #print "%s" % ndr_print(store_hwm) - #print "%s" % ndr_print(store_utdv) + # print "%s" % ndr_print(store_hwm) + # print "%s" % ndr_print(store_utdv) except Exception: store_dn = dn store_hwm = drsuapi.DsReplicaHighWaterMark() @@ -248,7 +248,7 @@ if __name__ == "__main__": obj_item = obj_item.next_object continue - #print '%s' % obj.identifier.dn + # print '%s' % obj.identifier.dn is_deleted = False for i in range(0, obj.attribute_ctr.num_attributes): @@ -308,7 +308,7 @@ if __name__ == "__main__": spl = ndr_unpack(drsblobs.supplementalCredentialsBlob, attr_val) - #print '%s' % ndr_print(spl) + # print '%s' % ndr_print(spl) cleartext_hex = None @@ -344,7 +344,7 @@ if __name__ == "__main__": krb5_old_raw = binascii.a2b_hex(krb5_old_hex) krb5_old = ndr_unpack(drsblobs.package_PrimaryKerberosBlob, krb5_old_raw, allow_remaining=True) - #print '%s' % ndr_print(krb5_old) + # print '%s' % ndr_print(krb5_old) krb5_new_hex = None @@ -358,7 +358,7 @@ if __name__ == "__main__": krb5_new_raw = binascii.a2b_hex(krb5_new_hex) krb5_new = ndr_unpack(drsblobs.package_PrimaryKerberosBlob, krb5_new_raw, allow_remaining=True) - #print '%s' % ndr_print(krb5_new) + # print '%s' % ndr_print(krb5_new) obj_item = obj_item.next_object @@ -374,8 +374,8 @@ if __name__ == "__main__": store_utdv_ctr.cursors = ctr.uptodateness_vector.cursors store_utdv.ctr = store_utdv_ctr - #print "%s" % ndr_print(store_hwm) - #print "%s" % ndr_print(store_utdv) + # print "%s" % ndr_print(store_hwm) + # print "%s" % ndr_print(store_utdv) store_hwm_blob = ndr_pack(store_hwm) store_utdv_blob = ndr_pack(store_utdv) diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py index 165a3f79457..8418c246d97 100755 --- a/source4/selftest/tests.py +++ b/source4/selftest/tests.py @@ -177,7 +177,7 @@ for bindoptions in ["seal,padcheck"] + validate_list + ["bigendian"]: plansmbtorture4testsuite(t, env, ["%s:$SERVER[%s]" % (transport, bindoptions), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.%s on %s with %s" % (t, transport, bindoptions)) plansmbtorture4testsuite('rpc.samba3-sharesec', env, ["%s:$SERVER[%s]" % (transport, bindoptions), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', '--option=torture:share=tmp'], "samba4.rpc.samba3.sharesec on %s with %s" % (transport, bindoptions)) -#Plugin S4 DC tests (confirms named pipe auth forwarding). This can be expanded once kerberos is supported in the plugin DC +# Plugin S4 DC tests (confirms named pipe auth forwarding). This can be expanded once kerberos is supported in the plugin DC # for bindoptions in ["seal,padcheck"] + validate_list + ["bigendian"]: for t in ncacn_np_tests: @@ -244,7 +244,7 @@ for t in gpo: transports = ["ncacn_np", "ncacn_ip_tcp"] -#Kerberos varies between functional levels, so it is important to check this on all of them +# Kerberos varies between functional levels, so it is important to check this on all of them for env in ["ad_dc_ntvfs", "fl2000dc", "fl2003dc", "fl2008r2dc", "ad_dc"]: transport = "ncacn_np" plansmbtorture4testsuite('rpc.pac', env, ["%s:$SERVER[]" % (transport, ), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.pac on %s" % (transport,)) @@ -313,7 +313,7 @@ ntvfsargs = ["--option=torture:sharedelay=100000", "--option=torture:oplocktimeo smb2_s3only = ["smb2.change_notify_disabled", "smb2.dosmode", "smb2.credits", "smb2.kernel-oplocks"] smb2 = [x for x in smbtorture4_testsuites("smb2.") if x not in smb2_s3only] -#The QFILEINFO-IPC test needs to be on ipc$ +# The QFILEINFO-IPC test needs to be on ipc$ raw = filter(lambda x: "raw.qfileinfo.ipc" not in x, smbtorture4_testsuites("raw.")) base = smbtorture4_testsuites("base.") @@ -345,7 +345,7 @@ plansmbtorture4testsuite('echo.udp', 'ad_dc_ntvfs:local', '//$SERVER/whatever') # Local tests for t in smbtorture4_testsuites("local."): - #The local.resolve test needs a name to look up using real system (not emulated) name routines + # The local.resolve test needs a name to look up using real system (not emulated) name routines plansmbtorture4testsuite(t, "none", "ncalrpc:localhost") # Confirm these tests with the system iconv too @@ -384,7 +384,7 @@ for t in smbtorture4_testsuites("dns_internal."): # Local tests for t in smbtorture4_testsuites("dlz_bind9."): - #The dlz_bind9 tests needs to look at the DNS database + # The dlz_bind9 tests needs to look at the DNS database plansmbtorture4testsuite(t, "chgdcpass:local", ["ncalrpc:$SERVER", '-U$USERNAME%$PASSWORD']) planpythontestsuite("nt4_dc", "samba.tests.libsmb_samba_internal", py3_compatible=True); diff --git a/source4/torture/drs/python/cracknames.py b/source4/torture/drs/python/cracknames.py index 7df12ad14dd..f29e29b29c4 100644 --- a/source4/torture/drs/python/cracknames.py +++ b/source4/torture/drs/python/cracknames.py @@ -60,9 +60,9 @@ class DrsCracknamesTestCase(drs_base.DrsBaseTestCase): drsuapi.DRSUAPI_DS_NAME_FORMAT_CANONICAL_EX, drsuapi.DRSUAPI_DS_NAME_FORMAT_SERVICE_PRINCIPAL, # We currently don't support this - #drsuapi.DRSUAPI_DS_NAME_FORMAT_SID_OR_SID_HISTORY, + # drsuapi.DRSUAPI_DS_NAME_FORMAT_SID_OR_SID_HISTORY, # This format is not supported by Windows (or us) - #drsuapi.DRSUAPI_DS_NAME_FORMAT_DNS_DOMAIN, + # drsuapi.DRSUAPI_DS_NAME_FORMAT_DNS_DOMAIN, } def tearDown(self): diff --git a/source4/torture/drs/python/getnc_exop.py b/source4/torture/drs/python/getnc_exop.py index 111264b36bc..d72159540de 100644 --- a/source4/torture/drs/python/getnc_exop.py +++ b/source4/torture/drs/python/getnc_exop.py @@ -439,7 +439,7 @@ class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase): expected_links=[ou2_managedBy_dc3, dc3_managedBy_ou1]) # Can fail against Windows due to equal precedence of dc3, cn3 - #self._check_replication([self.ou,ou1,ou2,dc3,cn3], + # self._check_replication([self.ou,ou1,ou2,dc3,cn3], # drsuapi.DRSUAPI_DRS_WRIT_REP| # drsuapi.DRSUAPI_DRS_GET_ANC, # expected_links=[ou2_managedBy_dc3,dc3_managedBy_ou1]) @@ -481,7 +481,7 @@ class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase): expected_links=[ou2_managedBy_dc3, dc3_managedBy_ou1, dc3_managedBy_ou2]) # Can fail against Windows due to equal precedence of dc3, cn3 - #self._check_replication([self.ou,ou1,ou2,dc3,cn3], + # self._check_replication([self.ou,ou1,ou2,dc3,cn3], # drsuapi.DRSUAPI_DRS_WRIT_REP| # drsuapi.DRSUAPI_DRS_GET_ANC, # expected_links=[ou2_managedBy_dc3,dc3_managedBy_ou1,dc3_managedBy_ou2]) diff --git a/wintest/wintest.py b/wintest/wintest.py index d421369086a..3c7ac553c5b 100644 --- a/wintest/wintest.py +++ b/wintest/wintest.py @@ -515,7 +515,7 @@ options { child.close() i = child.exitstatus if wait_for_fail: - #wait for timeout or fail + # wait for timeout or fail if i == None or i > 0: return else: