# Turn "[foo,bar]" into a list ("foo", "bar") to test
# lambda x: x removes anything that evaluates to False,
# including empty strings, so we handle "" as well
- binding_list = filter(lambda x: x, re.compile('[\[,\]]').split(binding))
+ binding_list = list(filter(lambda x: x, re.compile('[\[,\]]').split(binding)))
# Handle explicit smb2, smb1 or auto negotiation
if "smb2" in binding_list:
return []
self.connection = None
- return filter(isRemote, self.context["messages"])
+ return list(filter(isRemote, self.context["messages"]))
# Discard any previously queued messages.
def discardMessages(self):
lines = f.readlines()
config_hash = dict((x[0], ' '.join(x[1:]))
for x in map(lambda line: line.strip().split(' ')[1:],
- filter(lambda line: (line[0:7] == '#define') and (len(line.split(' ')) > 2), lines)))
+ list(filter(lambda line: (line[0:7] == '#define') and (len(line.split(' ')) > 2), lines))))
finally:
f.close()
lines = f.readlines()
config_hash = dict((x[0], ' '.join(x[1:]))
for x in map(lambda line: line.strip().split(' ')[1:],
- filter(lambda line: (line[0:7] == '#define') and (len(line.split(' ')) > 2), lines)))
+ list(filter(lambda line: (line[0:7] == '#define') and (len(line.split(' ')) > 2), lines))))
finally:
f.close()
# Make sure all tests get run
rpc_tests = smbtorture4_testsuites("rpc.")
-auto_rpc_tests = filter(lambda t: t not in all_rpc_tests, rpc_tests)
+auto_rpc_tests = list(filter(lambda t: t not in all_rpc_tests, rpc_tests))
for bindoptions in ["seal,padcheck"] + validate_list + ["bigendian"]:
for transport in ["ncalrpc", "ncacn_np", "ncacn_ip_tcp"]:
plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/ipc\$ -U$USERNAME%$PASSWORD')
# Tests for the NET API (net.api.become.dc tested below against all the roles)
-net_tests = filter(lambda x: "net.api.become.dc" not in x, smbtorture4_testsuites("net."))
+net_tests = list(filter(lambda x: "net.api.become.dc" not in x, smbtorture4_testsuites("net.")))
for t in net_tests:
plansmbtorture4testsuite(t, "ad_dc_ntvfs", '$SERVER[%s] -U$USERNAME%%$PASSWORD -W$DOMAIN' % validate)