summaryrefslogtreecommitdiff
path: root/python/samba/tests
diff options
context:
space:
mode:
Diffstat (limited to 'python/samba/tests')
-rw-r--r--python/samba/tests/auth_log.py10
-rw-r--r--python/samba/tests/core.py12
-rw-r--r--python/samba/tests/dcerpc/bare.py24
-rwxr-xr-xpython/samba/tests/dcerpc/raw_protocol.py346
-rw-r--r--python/samba/tests/dcerpc/raw_testcase.py12
-rw-r--r--python/samba/tests/dcerpc/registry.py6
-rw-r--r--python/samba/tests/dcerpc/srvsvc.py4
-rw-r--r--python/samba/tests/dns.py56
-rw-r--r--python/samba/tests/docs.py85
-rw-r--r--python/samba/tests/dsdb.py8
-rw-r--r--python/samba/tests/get_opt.py2
-rw-r--r--python/samba/tests/gpo.py22
-rw-r--r--python/samba/tests/kcc/ldif_import_export.py2
-rw-r--r--python/samba/tests/netcmd.py6
-rw-r--r--python/samba/tests/policy.py4
-rw-r--r--python/samba/tests/posixacl.py6
-rw-r--r--python/samba/tests/provision.py8
-rw-r--r--python/samba/tests/s3idmapdb.py2
-rw-r--r--python/samba/tests/samba3sam.py82
-rw-r--r--python/samba/tests/samba_tool/computer.py14
-rw-r--r--python/samba/tests/samba_tool/forest.py18
-rw-r--r--python/samba/tests/samba_tool/fsmo.py4
-rw-r--r--python/samba/tests/samba_tool/group.py8
-rw-r--r--python/samba/tests/samba_tool/ou.py8
-rw-r--r--python/samba/tests/samba_tool/rodc.py2
-rw-r--r--python/samba/tests/samba_tool/schema.py62
-rw-r--r--python/samba/tests/samba_tool/user.py44
-rw-r--r--python/samba/tests/samba_tool/user_check_password_script.py2
-rw-r--r--python/samba/tests/samba_tool/user_virtualCryptSHA.py2
-rw-r--r--python/samba/tests/samba_tool/user_wdigest.py2
-rw-r--r--python/samba/tests/security.py6
-rw-r--r--python/samba/tests/smb.py12
-rw-r--r--python/samba/tests/source.py14
-rwxr-xr-xpython/samba/tests/subunitrun.py6
-rw-r--r--python/samba/tests/upgrade.py2
-rw-r--r--python/samba/tests/upgradeprovision.py2
-rw-r--r--python/samba/tests/upgradeprovisionneeddc.py28
-rw-r--r--python/samba/tests/xattr.py18
38 files changed, 490 insertions, 461 deletions
diff --git a/python/samba/tests/auth_log.py b/python/samba/tests/auth_log.py
index 4704b925de5..b8e55528775 100644
--- a/python/samba/tests/auth_log.py
+++ b/python/samba/tests/auth_log.py
@@ -93,7 +93,7 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
self.assertEquals("Authentication", msg["type"])
self.assertEquals("NT_STATUS_OK", msg["Authentication"]["status"])
self._assert_ncacn_np_serviceDescription(binding,
- msg["Authentication"]["serviceDescription"])
+ msg["Authentication"]["serviceDescription"])
self.assertEquals(authTypes[1],
msg["Authentication"]["authDescription"])
@@ -101,7 +101,7 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
msg = messages[1]
self.assertEquals("Authorization", msg["type"])
self._assert_ncacn_np_serviceDescription(binding,
- msg["Authorization"]["serviceDescription"])
+ msg["Authorization"]["serviceDescription"])
self.assertEquals(authTypes[2], msg["Authorization"]["authType"])
self.assertEquals("SMB", msg["Authorization"]["transportProtection"])
self.assertTrue(self.is_guid(msg["Authorization"]["sessionId"]))
@@ -161,7 +161,7 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
msg = messages[2]
self.assertEquals("Authorization", msg["type"])
self._assert_ncacn_np_serviceDescription(binding,
- msg["Authorization"]["serviceDescription"])
+ msg["Authorization"]["serviceDescription"])
self.assertEquals(authTypes[3], msg["Authorization"]["authType"])
self.assertEquals("SMB", msg["Authorization"]["transportProtection"])
self.assertTrue(self.is_guid(msg["Authorization"]["sessionId"]))
@@ -486,7 +486,7 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
creds = self.insta_creds(template=self.get_credentials())
creds.set_bind_dn("%s\\%s" % (creds.get_domain(),
- creds.get_username()))
+ creds.get_username()))
self.samdb = SamDB(url="ldaps://%s" % os.environ["SERVER"],
lp=self.get_loadparm(),
@@ -517,7 +517,7 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
creds = self.insta_creds(template=self.get_credentials())
creds.set_password("badPassword")
creds.set_bind_dn("%s\\%s" % (creds.get_domain(),
- creds.get_username()))
+ creds.get_username()))
thrown = False
try:
diff --git a/python/samba/tests/core.py b/python/samba/tests/core.py
index 504d458b7f8..4abb05420d2 100644
--- a/python/samba/tests/core.py
+++ b/python/samba/tests/core.py
@@ -30,24 +30,24 @@ class SubstituteVarTestCase(TestCase):
def test_nothing(self):
self.assertEquals("foo bar",
- samba.substitute_var("foo bar", {"bar": "bla"}))
+ samba.substitute_var("foo bar", {"bar": "bla"}))
def test_replace(self):
self.assertEquals("foo bla",
- samba.substitute_var("foo ${bar}", {"bar": "bla"}))
+ samba.substitute_var("foo ${bar}", {"bar": "bla"}))
def test_broken(self):
self.assertEquals("foo ${bdkjfhsdkfh sdkfh ",
- samba.substitute_var("foo ${bdkjfhsdkfh sdkfh ", {"bar": "bla"}))
+ samba.substitute_var("foo ${bdkjfhsdkfh sdkfh ", {"bar": "bla"}))
def test_unknown_var(self):
self.assertEquals("foo ${bla} gsff",
- samba.substitute_var("foo ${bla} gsff", {"bar": "bla"}))
+ samba.substitute_var("foo ${bla} gsff", {"bar": "bla"}))
def test_check_all_substituted(self):
samba.check_all_substituted("nothing to see here")
self.assertRaises(Exception, samba.check_all_substituted,
- "Not subsituted: ${FOOBAR}")
+ "Not subsituted: ${FOOBAR}")
class ArcfourTestCase(TestCase):
@@ -73,7 +73,7 @@ class LdbExtensionTests(TestCaseInTempDir):
try:
l.add({"dn": "foo=dc", "bar": "bla"})
self.assertEquals(b"bla",
- l.searchone(basedn=ldb.Dn(l, "foo=dc"), attribute="bar"))
+ l.searchone(basedn=ldb.Dn(l, "foo=dc"), attribute="bar"))
finally:
del l
os.unlink(path)
diff --git a/python/samba/tests/dcerpc/bare.py b/python/samba/tests/dcerpc/bare.py
index 380164cff10..00968f15f0e 100644
--- a/python/samba/tests/dcerpc/bare.py
+++ b/python/samba/tests/dcerpc/bare.py
@@ -28,33 +28,33 @@ class BareTestCase(samba.tests.TestCase):
def test_bare(self):
# Connect to the echo pipe
x = ClientConnection("ncalrpc:localhost[DEFAULT]",
- ("60a15ec5-4de8-11d7-a637-005056a20182", 1),
- lp_ctx=samba.tests.env_loadparm())
+ ("60a15ec5-4de8-11d7-a637-005056a20182", 1),
+ lp_ctx=samba.tests.env_loadparm())
self.assertEquals(b"\x01\x00\x00\x00", x.request(0, chr(0) * 4))
def test_two_contexts(self):
x = ClientConnection("ncalrpc:localhost[DEFAULT]",
- ("12345778-1234-abcd-ef00-0123456789ac", 1),
- lp_ctx=samba.tests.env_loadparm())
+ ("12345778-1234-abcd-ef00-0123456789ac", 1),
+ lp_ctx=samba.tests.env_loadparm())
y = ClientConnection("ncalrpc:localhost",
- ("60a15ec5-4de8-11d7-a637-005056a20182", 1),
- basis_connection=x, lp_ctx=samba.tests.env_loadparm())
+ ("60a15ec5-4de8-11d7-a637-005056a20182", 1),
+ basis_connection=x, lp_ctx=samba.tests.env_loadparm())
self.assertEquals(24, len(x.request(0, chr(0) * 8)))
self.assertEquals(b"\x01\x00\x00\x00", y.request(0, chr(0) * 4))
def test_bare_tcp(self):
# Connect to the echo pipe
x = ClientConnection("ncacn_ip_tcp:%s" % os.environ["SERVER"],
- ("60a15ec5-4de8-11d7-a637-005056a20182", 1),
- lp_ctx=samba.tests.env_loadparm())
+ ("60a15ec5-4de8-11d7-a637-005056a20182", 1),
+ lp_ctx=samba.tests.env_loadparm())
self.assertEquals(b"\x01\x00\x00\x00", x.request(0, chr(0) * 4))
def test_two_contexts_tcp(self):
x = ClientConnection("ncacn_ip_tcp:%s" % os.environ["SERVER"],
- ("12345778-1234-abcd-ef00-0123456789ac", 1),
- lp_ctx=samba.tests.env_loadparm())
+ ("12345778-1234-abcd-ef00-0123456789ac", 1),
+ lp_ctx=samba.tests.env_loadparm())
y = ClientConnection("ncacn_ip_tcp:%s" % os.environ["SERVER"],
- ("60a15ec5-4de8-11d7-a637-005056a20182", 1),
- basis_connection=x, lp_ctx=samba.tests.env_loadparm())
+ ("60a15ec5-4de8-11d7-a637-005056a20182", 1),
+ basis_connection=x, lp_ctx=samba.tests.env_loadparm())
self.assertEquals(24, len(x.request(0, chr(0) * 8)))
self.assertEquals(b"\x01\x00\x00\x00", y.request(0, chr(0) * 4))
diff --git a/python/samba/tests/dcerpc/raw_protocol.py b/python/samba/tests/dcerpc/raw_protocol.py
index 404dde0040b..2a1a87be492 100755
--- a/python/samba/tests/dcerpc/raw_protocol.py
+++ b/python/samba/tests/dcerpc/raw_protocol.py
@@ -68,9 +68,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
# self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -113,9 +113,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
# self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -135,9 +135,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
# self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -366,7 +366,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.verify_pdu(rep, dcerpc.DCERPC_PKT_BIND_NAK, req.call_id,
auth_length=0)
self.assertEquals(rep.u.reject_reason,
- dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
self.assertEquals(rep.u.num_versions, 1)
self.assertEquals(rep.u.versions[0].rpc_vers, req.rpc_vers)
self.assertEquals(rep.u.versions[0].rpc_vers_minor, req.rpc_vers_minor)
@@ -381,7 +381,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.verify_pdu(rep, dcerpc.DCERPC_PKT_BIND_NAK, req.call_id,
auth_length=0)
self.assertEquals(rep.u.reject_reason,
- dcerpc.DCERPC_BIND_NAK_REASON_PROTOCOL_VERSION_NOT_SUPPORTED)
+ dcerpc.DCERPC_BIND_NAK_REASON_PROTOCOL_VERSION_NOT_SUPPORTED)
self.assertEquals(rep.u.num_versions, 1)
self.assertEquals(rep.u.versions[0].rpc_vers, req.rpc_vers)
self.assertEquals(rep.u.versions[0].rpc_vers_minor, req.rpc_vers_minor)
@@ -412,9 +412,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -432,7 +432,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.verify_pdu(rep, dcerpc.DCERPC_PKT_BIND_NAK, req.call_id,
auth_length=0)
self.assertEquals(rep.u.reject_reason,
- dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
self.assertEquals(rep.u.num_versions, 1)
self.assertEquals(rep.u.versions[0].rpc_vers, req.rpc_vers)
self.assertEquals(rep.u.versions[0].rpc_vers_minor, req.rpc_vers_minor)
@@ -452,7 +452,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.verify_pdu(rep, dcerpc.DCERPC_PKT_BIND_NAK, req.call_id,
auth_length=0)
self.assertEquals(rep.u.reject_reason,
- dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
self.assertEquals(rep.u.num_versions, 1)
self.assertEquals(rep.u.versions[0].rpc_vers, req.rpc_vers)
self.assertEquals(rep.u.versions[0].rpc_vers_minor, req.rpc_vers_minor)
@@ -488,9 +488,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -541,9 +541,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -561,9 +561,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -611,9 +611,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION)
+ dcerpc.DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED)
+ dcerpc.DCERPC_BIND_ACK_REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, zero_syntax)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -631,9 +631,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION)
+ dcerpc.DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED)
+ dcerpc.DCERPC_BIND_ACK_REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, zero_syntax)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -669,9 +669,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION)
+ dcerpc.DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED)
+ dcerpc.DCERPC_BIND_ACK_REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, zero_syntax)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -693,7 +693,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.verify_pdu(rep, dcerpc.DCERPC_PKT_BIND_NAK, req.call_id,
auth_length=0)
self.assertEquals(rep.u.reject_reason,
- dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
self.assertEquals(rep.u.num_versions, 1)
self.assertEquals(rep.u.versions[0].rpc_vers, req.rpc_vers)
self.assertEquals(rep.u.versions[0].rpc_vers_minor, req.rpc_vers_minor)
@@ -731,9 +731,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -792,9 +792,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -854,9 +854,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -883,9 +883,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION)
+ dcerpc.DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_TRANSFER_SYNTAXES_NOT_SUPPORTED)
+ dcerpc.DCERPC_BIND_ACK_REASON_TRANSFER_SYNTAXES_NOT_SUPPORTED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, zero_syntax)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -932,9 +932,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION)
+ dcerpc.DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED)
+ dcerpc.DCERPC_BIND_ACK_REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, zero_syntax)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -958,9 +958,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -997,9 +997,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -1036,9 +1036,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -1082,14 +1082,14 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 2)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertEquals(rep.u.ctx_list[1].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION)
+ dcerpc.DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION)
self.assertEquals(rep.u.ctx_list[1].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_TRANSFER_SYNTAXES_NOT_SUPPORTED)
+ dcerpc.DCERPC_BIND_ACK_REASON_TRANSFER_SYNTAXES_NOT_SUPPORTED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[1].syntax, zero_syntax)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -1119,14 +1119,14 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 2)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertEquals(rep.u.ctx_list[1].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION)
+ dcerpc.DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION)
self.assertEquals(rep.u.ctx_list[1].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_TRANSFER_SYNTAXES_NOT_SUPPORTED)
+ dcerpc.DCERPC_BIND_ACK_REASON_TRANSFER_SYNTAXES_NOT_SUPPORTED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[1].syntax, zero_syntax)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -1169,14 +1169,14 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 2)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertEquals(rep.u.ctx_list[1].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION)
+ dcerpc.DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION)
self.assertEquals(rep.u.ctx_list[1].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_TRANSFER_SYNTAXES_NOT_SUPPORTED)
+ dcerpc.DCERPC_BIND_ACK_REASON_TRANSFER_SYNTAXES_NOT_SUPPORTED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[1].syntax, zero_syntax)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -1233,14 +1233,14 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 2)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertEquals(rep.u.ctx_list[1].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION)
+ dcerpc.DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION)
self.assertEquals(rep.u.ctx_list[1].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_TRANSFER_SYNTAXES_NOT_SUPPORTED)
+ dcerpc.DCERPC_BIND_ACK_REASON_TRANSFER_SYNTAXES_NOT_SUPPORTED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[1].syntax, zero_syntax)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -1270,14 +1270,14 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 2)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertEquals(rep.u.ctx_list[1].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION)
+ dcerpc.DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION)
self.assertEquals(rep.u.ctx_list[1].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_TRANSFER_SYNTAXES_NOT_SUPPORTED)
+ dcerpc.DCERPC_BIND_ACK_REASON_TRANSFER_SYNTAXES_NOT_SUPPORTED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[1].syntax, zero_syntax)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -1321,7 +1321,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_NEGOTIATE_ACK)
+ dcerpc.DCERPC_BIND_ACK_RESULT_NEGOTIATE_ACK)
self.assertEquals(rep.u.ctx_list[0].reason, features)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, zero_syntax)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -1358,7 +1358,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_NEGOTIATE_ACK)
+ dcerpc.DCERPC_BIND_ACK_RESULT_NEGOTIATE_ACK)
self.assertEquals(rep.u.ctx_list[0].reason, features1)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, zero_syntax)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -1393,9 +1393,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION)
+ dcerpc.DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED)
+ dcerpc.DCERPC_BIND_ACK_REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, zero_syntax)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -1428,7 +1428,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.verify_pdu(rep, dcerpc.DCERPC_PKT_BIND_NAK, req.call_id,
auth_length=0)
self.assertEquals(rep.u.reject_reason,
- dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
self.assertEquals(rep.u.num_versions, 1)
self.assertEquals(rep.u.versions[0].rpc_vers, req.rpc_vers)
self.assertEquals(rep.u.versions[0].rpc_vers_minor, req.rpc_vers_minor)
@@ -1467,7 +1467,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_NEGOTIATE_ACK)
+ dcerpc.DCERPC_BIND_ACK_RESULT_NEGOTIATE_ACK)
self.assertEquals(rep.u.ctx_list[0].reason, features)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, zero_syntax)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -1503,13 +1503,13 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_NEGOTIATE_ACK)
+ dcerpc.DCERPC_BIND_ACK_RESULT_NEGOTIATE_ACK)
self.assertEquals(rep.u.ctx_list[0].reason, features1)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, zero_syntax)
self.assertEquals(rep.u.auth_info, '\0' * 0)
def _test_auth_type_level_bind_nak(self, auth_type, auth_level, creds=None,
- reason=dcerpc.DCERPC_BIND_NAK_REASON_INVALID_AUTH_TYPE):
+ reason=dcerpc.DCERPC_BIND_NAK_REASON_INVALID_AUTH_TYPE):
ndr32 = base.transfer_syntax_ndr()
tsf1_list = [ndr32]
@@ -1525,10 +1525,10 @@ class TestDCERPC_BIND(RawDCERPCTest):
if creds is not None:
# We always start with DCERPC_AUTH_LEVEL_INTEGRITY
auth_context = self.get_auth_context_creds(creds,
- auth_type=auth_type,
- auth_level=auth_level,
- auth_context_id=auth_context_id,
- g_auth_level=dcerpc.DCERPC_AUTH_LEVEL_INTEGRITY)
+ auth_type=auth_type,
+ auth_level=auth_level,
+ auth_context_id=auth_context_id,
+ g_auth_level=dcerpc.DCERPC_AUTH_LEVEL_INTEGRITY)
from_server = ""
(finished, to_server) = auth_context["gensec"].update(from_server)
self.assertFalse(finished)
@@ -1566,11 +1566,11 @@ class TestDCERPC_BIND(RawDCERPCTest):
def _test_auth_none_level_bind(self, auth_level,
reason=dcerpc.DCERPC_BIND_NAK_REASON_INVALID_AUTH_TYPE):
return self._test_auth_type_level_bind_nak(auth_type=dcerpc.DCERPC_AUTH_LEVEL_NONE,
- auth_level=auth_level, reason=reason)
+ auth_level=auth_level, reason=reason)
def test_auth_none_none_bind(self):
return self._test_auth_none_level_bind(dcerpc.DCERPC_AUTH_LEVEL_NONE,
- reason=dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
+ reason=dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
def test_auth_none_connect_bind(self):
return self._test_auth_none_level_bind(dcerpc.DCERPC_AUTH_LEVEL_CONNECT)
@@ -1589,15 +1589,15 @@ class TestDCERPC_BIND(RawDCERPCTest):
def test_auth_none_0_bind(self):
return self._test_auth_none_level_bind(0,
- reason=dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
+ reason=dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
def test_auth_none_7_bind(self):
return self._test_auth_none_level_bind(7,
- reason=dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
+ reason=dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
def test_auth_none_255_bind(self):
return self._test_auth_none_level_bind(255,
- reason=dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
+ reason=dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
def _test_auth_none_level_request(self, auth_level):
ndr32 = base.transfer_syntax_ndr()
@@ -1628,9 +1628,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertEquals(len(rep.u.auth_info), 0)
@@ -1717,9 +1717,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -1748,9 +1748,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -1875,9 +1875,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertEquals(rep.u.auth_info, '\0' * 0)
@@ -2525,10 +2525,10 @@ class TestDCERPC_BIND(RawDCERPCTest):
ctx = self.prepare_presentation(abstract, ndr32)
req1 = self.generate_request(call_id = 1,
- pfc_flags=dcerpc.DCERPC_PFC_FLAG_FIRST,
- context_id=ctx.context_id,
- opnum=0,
- stub="")
+ pfc_flags=dcerpc.DCERPC_PFC_FLAG_FIRST,
+ context_id=ctx.context_id,
+ opnum=0,
+ stub="")
self.send_pdu(req1)
rep = self.recv_pdu(timeout=0.1)
self.assertIsNone(rep)
@@ -2542,9 +2542,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
# And now try a new request
req2 = self.generate_request(call_id = 2,
- context_id=ctx.context_id,
- opnum=0,
- stub="")
+ context_id=ctx.context_id,
+ opnum=0,
+ stub="")
self.send_pdu(req2)
rep = self.recv_pdu()
self.verify_pdu(rep, dcerpc.DCERPC_PKT_FAULT, req1.call_id,
@@ -2573,10 +2573,10 @@ class TestDCERPC_BIND(RawDCERPCTest):
pfc_flags=pfc_flags)
req1 = self.generate_request(call_id = 1,
- pfc_flags=dcerpc.DCERPC_PFC_FLAG_FIRST,
- context_id=ctx.context_id,
- opnum=0,
- stub="")
+ pfc_flags=dcerpc.DCERPC_PFC_FLAG_FIRST,
+ context_id=ctx.context_id,
+ opnum=0,
+ stub="")
self.send_pdu(req1)
rep = self.recv_pdu(timeout=0.1)
self.assertIsNone(rep)
@@ -2590,9 +2590,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
# And now try a new request
req2 = self.generate_request(call_id = 2,
- context_id=ctx.context_id-1,
- opnum=0,
- stub="")
+ context_id=ctx.context_id-1,
+ opnum=0,
+ stub="")
self.send_pdu(req2)
rep = self.recv_pdu()
self.verify_pdu(rep, dcerpc.DCERPC_PKT_FAULT, req2.call_id,
@@ -2654,9 +2654,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertNotEquals(len(rep.u.auth_info), 0)
a = self.parse_auth(rep.u.auth_info)
@@ -2687,9 +2687,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertNotEquals(len(rep.u.auth_info), 0)
a = self.parse_auth(rep.u.auth_info)
@@ -2804,9 +2804,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertNotEquals(len(rep.u.auth_info), 0)
a = self.parse_auth(rep.u.auth_info)
@@ -2837,9 +2837,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertNotEquals(len(rep.u.auth_info), 0)
a = self.parse_auth(rep.u.auth_info)
@@ -2921,9 +2921,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertNotEquals(len(rep.u.auth_info), 0)
a = self.parse_auth(rep.u.auth_info)
@@ -3004,9 +3004,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertNotEquals(len(rep.u.auth_info), 0)
a = self.parse_auth(rep.u.auth_info)
@@ -3094,9 +3094,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertNotEquals(len(rep.u.auth_info), 0)
a = self.parse_auth(rep.u.auth_info)
@@ -3125,9 +3125,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertNotEquals(len(rep.u.auth_info), 0)
a = self.parse_auth(rep.u.auth_info)
@@ -3255,9 +3255,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertNotEquals(len(rep.u.auth_info), 0)
a = self.parse_auth(rep.u.auth_info)
@@ -3286,9 +3286,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertNotEquals(len(rep.u.auth_info), 0)
a = self.parse_auth(rep.u.auth_info)
@@ -3411,9 +3411,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertNotEquals(len(rep.u.auth_info), 0)
a = self.parse_auth(rep.u.auth_info)
@@ -3496,9 +3496,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertNotEquals(len(rep.u.auth_info), 0)
a = self.parse_auth(rep.u.auth_info)
@@ -3583,9 +3583,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertNotEquals(len(rep.u.auth_info), 0)
a = self.parse_auth(rep.u.auth_info)
@@ -3664,9 +3664,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertNotEquals(len(rep.u.auth_info), 0)
a = self.parse_auth(rep.u.auth_info)
@@ -3752,9 +3752,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertNotEquals(len(rep.u.auth_info), 0)
a = self.parse_auth(rep.u.auth_info)
@@ -3840,9 +3840,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertNotEquals(len(rep.u.auth_info), 0)
a = self.parse_auth(rep.u.auth_info)
@@ -3938,9 +3938,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertNotEquals(len(rep.u.auth_info), 0)
a = self.parse_auth(rep.u.auth_info)
@@ -3984,9 +3984,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertNotEquals(len(rep.u.auth_info), 0)
a = self.parse_auth(rep.u.auth_info)
@@ -4084,7 +4084,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.verify_pdu(rep, dcerpc.DCERPC_PKT_BIND_NAK, req.call_id,
auth_length=0)
self.assertEquals(rep.u.reject_reason,
- dcerpc.DCERPC_BIND_NAK_REASON_PROTOCOL_VERSION_NOT_SUPPORTED)
+ dcerpc.DCERPC_BIND_NAK_REASON_PROTOCOL_VERSION_NOT_SUPPORTED)
self.assertEquals(rep.u.num_versions, 1)
self.assertEquals(rep.u.versions[0].rpc_vers, req.rpc_vers)
self.assertEquals(rep.u.versions[0].rpc_vers_minor, req.rpc_vers_minor)
@@ -4155,9 +4155,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertNotEquals(len(rep.u.auth_info), 0)
a = self.parse_auth(rep.u.auth_info)
@@ -4268,9 +4268,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertNotEquals(len(rep.u.auth_info), 0)
a = self.parse_auth(rep.u.auth_info)
@@ -4386,9 +4386,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
#self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
self.assertNotEquals(len(rep.u.auth_info), 0)
a = self.parse_auth(rep.u.auth_info)
@@ -4443,7 +4443,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
return auth_context["gensec"]
def _test_spnego_level_bind_nak(self, auth_level,
- reason=dcerpc.DCERPC_BIND_NAK_REASON_INVALID_CHECKSUM):
+ reason=dcerpc.DCERPC_BIND_NAK_REASON_INVALID_CHECKSUM):
c = self.get_user_creds()
return self._test_auth_type_level_bind_nak(auth_type=dcerpc.DCERPC_AUTH_TYPE_SPNEGO,
auth_level=auth_level, creds=c, reason=reason)
@@ -4540,91 +4540,91 @@ class TestDCERPC_BIND(RawDCERPCTest):
def test_spnego_none_bind(self):
return self._test_spnego_level_bind_nak(dcerpc.DCERPC_AUTH_LEVEL_NONE,
- reason=dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
+ reason=dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
def test_spnego_call_bind(self):
return self._test_spnego_level_bind_nak(dcerpc.DCERPC_AUTH_LEVEL_CALL,
- reason=dcerpc.DCERPC_BIND_NAK_REASON_INVALID_CHECKSUM)
+ reason=dcerpc.DCERPC_BIND_NAK_REASON_INVALID_CHECKSUM)
def test_spnego_0_bind(self):
return self._test_spnego_level_bind_nak(0,
- reason=dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
+ reason=dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
def test_spnego_7_bind(self):
return self._test_spnego_level_bind_nak(7,
- reason=dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
+ reason=dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
def test_spnego_255_bind(self):
return self._test_spnego_level_bind_nak(255,
- reason=dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
+ reason=dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
def test_spnego_connect_bind_none(self):
return self._test_spnego_level_bind(auth_level=dcerpc.DCERPC_AUTH_LEVEL_CONNECT,
- g_auth_level=dcerpc.DCERPC_AUTH_LEVEL_CONNECT)
+ g_auth_level=dcerpc.DCERPC_AUTH_LEVEL_CONNECT)
def test_spnego_connect_bind_sign(self):
return self._test_spnego_level_bind(auth_level=dcerpc.DCERPC_AUTH_LEVEL_CONNECT,
- g_auth_level=dcerpc.DCERPC_AUTH_LEVEL_INTEGRITY)
+ g_auth_level=dcerpc.DCERPC_AUTH_LEVEL_INTEGRITY)
def test_spnego_connect_bind_seal(self):
return self._test_spnego_level_bind(auth_level=dcerpc.DCERPC_AUTH_LEVEL_CONNECT,
- g_auth_level=dcerpc.DCERPC_AUTH_LEVEL_PRIVACY)
+ g_auth_level=dcerpc.DCERPC_AUTH_LEVEL_PRIVACY)
def test_spnego_packet_bind_none(self):
# DCERPC_AUTH_LEVEL_PACKET is handled as alias of
# DCERPC_AUTH_LEVEL_INTEGRITY
return self._test_spnego_level_bind(auth_level=dcerpc.DCERPC_AUTH_LEVEL_PACKET,
- g_auth_level=dcerpc.DCERPC_AUTH_LEVEL_CONNECT,
- request_fault=dcerpc.DCERPC_FAULT_SEC_PKG_ERROR)
+ g_auth_level=dcerpc.DCERPC_AUTH_LEVEL_CONNECT,
+ request_fault=dcerpc.DCERPC_FAULT_SEC_PKG_ERROR)
def test_spnego_packet_bind_sign(self):
# DCERPC_AUTH_LEVEL_PACKET is handled as alias of
# DCERPC_AUTH_LEVEL_INTEGRITY
return self._test_spnego_level_bind(auth_level=dcerpc.DCERPC_AUTH_LEVEL_PACKET,
- g_auth_level=dcerpc.DCERPC_AUTH_LEVEL_INTEGRITY,
- request_fault=dcerpc.DCERPC_NCA_S_OP_RNG_ERROR,
- response_fault_flags=dcerpc.DCERPC_PFC_FLAG_DID_NOT_EXECUTE)
+ g_auth_level=dcerpc.DCERPC_AUTH_LEVEL_INTEGRITY,
+ request_fault=dcerpc.DCERPC_NCA_S_OP_RNG_ERROR,
+ response_fault_flags=dcerpc.DCERPC_PFC_FLAG_DID_NOT_EXECUTE)
def test_spnego_packet_bind_sign(self):
# DCERPC_AUTH_LEVEL_PACKET is handled as alias of
# DCERPC_AUTH_LEVEL_INTEGRITY
return self._test_spnego_level_bind(auth_level=dcerpc.DCERPC_AUTH_LEVEL_PACKET,
- g_auth_level=dcerpc.DCERPC_AUTH_LEVEL_PRIVACY,
- request_fault=dcerpc.DCERPC_NCA_S_OP_RNG_ERROR,
- response_fault_flags=dcerpc.DCERPC_PFC_FLAG_DID_NOT_EXECUTE)
+ g_auth_level=dcerpc.DCERPC_AUTH_LEVEL_PRIVACY,
+ request_fault=dcerpc.DCERPC_NCA_S_OP_RNG_ERROR,
+ response_fault_flags=dcerpc.DCERPC_PFC_FLAG_DID_NOT_EXECUTE)
def test_spnego_integrity_bind_none(self):
return self._test_spnego_level_bind(auth_level=dcerpc.DCERPC_AUTH_LEVEL_INTEGRITY,
- g_auth_level=dcerpc.DCERPC_AUTH_LEVEL_CONNECT,
- request_fault=dcerpc.DCERPC_FAULT_SEC_PKG_ERROR)
+ g_auth_level=dcerpc.DCERPC_AUTH_LEVEL_CONNECT,
+ request_fault=dcerpc.DCERPC_FAULT_SEC_PKG_ERROR)
def test_spnego_integrity_bind_sign(self):
return self._test_spnego_level_bind(auth_level=dcerpc.DCERPC_AUTH_LEVEL_INTEGRITY,
- g_auth_level=dcerpc.DCERPC_AUTH_LEVEL_INTEGRITY,
- request_fault=dcerpc.DCERPC_NCA_S_OP_RNG_ERROR,
- response_fault_flags=dcerpc.DCERPC_PFC_FLAG_DID_NOT_EXECUTE)
+ g_auth_level=dcerpc.DCERPC_AUTH_LEVEL_INTEGRITY,
+ request_fault=dcerpc.DCERPC_NCA_S_OP_RNG_ERROR,
+ response_fault_flags=dcerpc.DCERPC_PFC_FLAG_DID_NOT_EXECUTE)
def test_spnego_integrity_bind_seal(self):
return self._test_spnego_level_bind(auth_level=dcerpc.DCERPC_AUTH_LEVEL_INTEGRITY,
- g_auth_level=dcerpc.DCERPC_AUTH_LEVEL_PRIVACY,
- request_fault=dcerpc.DCERPC_NCA_S_OP_RNG_ERROR,
- response_fault_flags=dcerpc.DCERPC_PFC_FLAG_DID_NOT_EXECUTE)
+ g_auth_level=dcerpc.DCERPC_AUTH_LEVEL_PRIVACY,
+ request_fault=dcerpc.DCERPC_NCA_S_OP_RNG_ERROR,
+ response_fault_flags=dcerpc.DCERPC_PFC_FLAG_DID_NOT_EXECUTE)
def test_spnego_privacy_bind_none(self):
# This fails...
return self._test_spnego_level_bind(auth_level=dcerpc.DCERPC_AUTH_LEVEL_PRIVACY,
- g_auth_level=dcerpc.DCERPC_AUTH_LEVEL_CONNECT,
- alter_fault=dcerpc.DCERPC_FAULT_SEC_PKG_ERROR)
+ g_auth_level=dcerpc.DCERPC_AUTH_LEVEL_CONNECT,
+ alter_fault=dcerpc.DCERPC_FAULT_SEC_PKG_ERROR)
def test_spnego_privacy_bind_sign(self):
# This fails...
return self._test_spnego_level_bind(auth_level=dcerpc.DCERPC_AUTH_LEVEL_PRIVACY,
- g_auth_level=dcerpc.DCERPC_AUTH_LEVEL_INTEGRITY,
- alter_fault=dcerpc.DCERPC_FAULT_SEC_PKG_ERROR)
+ g_auth_level=dcerpc.DCERPC_AUTH_LEVEL_INTEGRITY,
+ alter_fault=dcerpc.DCERPC_FAULT_SEC_PKG_ERROR)
def test_spnego_privacy_bind_seal(self):
return self._test_spnego_level_bind(auth_level=dcerpc.DCERPC_AUTH_LEVEL_PRIVACY,
- g_auth_level=dcerpc.DCERPC_AUTH_LEVEL_PRIVACY)
+ g_auth_level=dcerpc.DCERPC_AUTH_LEVEL_PRIVACY)
diff --git a/python/samba/tests/dcerpc/raw_testcase.py b/python/samba/tests/dcerpc/raw_testcase.py
index 78aba08ef46..260abdcc487 100644
--- a/python/samba/tests/dcerpc/raw_testcase.py
+++ b/python/samba/tests/dcerpc/raw_testcase.py
@@ -189,9 +189,9 @@ class RawDCERPCTest(TestCase):
# self.assertEquals(rep.u._pad1, '\0' * port_pad)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- samba.dcerpc.dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ samba.dcerpc.dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- samba.dcerpc.dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ samba.dcerpc.dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ctx.transfer_syntaxes[0])
ack = rep
if auth_context is None:
@@ -242,9 +242,9 @@ class RawDCERPCTest(TestCase):
# self.assertEquals(rep.u._pad1, '\0' * 2)
self.assertEquals(rep.u.num_results, 1)
self.assertEquals(rep.u.ctx_list[0].result,
- samba.dcerpc.dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
+ samba.dcerpc.dcerpc.DCERPC_BIND_ACK_RESULT_ACCEPTANCE)
self.assertEquals(rep.u.ctx_list[0].reason,
- samba.dcerpc.dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
+ samba.dcerpc.dcerpc.DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ctx.transfer_syntaxes[0])
self.assertNotEquals(rep.auth_length, 0)
self.assertGreater(len(rep.u.auth_info), samba.dcerpc.dcerpc.DCERPC_AUTH_TRAILER_LENGTH)
@@ -687,10 +687,10 @@ class RawDCERPCTest(TestCase):
self.assertEqual(p.pfc_flags, pfc_flags)
self.assertEqual(p.drep, drep)
self.assertGreaterEqual(p.frag_length,
- samba.dcerpc.dcerpc.DCERPC_NCACN_PAYLOAD_OFFSET)
+ samba.dcerpc.dcerpc.DCERPC_NCACN_PAYLOAD_OFFSET)
if len(ai) > samba.dcerpc.dcerpc.DCERPC_AUTH_TRAILER_LENGTH:
self.assertEqual(p.auth_length,
- len(ai) - samba.dcerpc.dcerpc.DCERPC_AUTH_TRAILER_LENGTH)
+ len(ai) - samba.dcerpc.dcerpc.DCERPC_AUTH_TRAILER_LENGTH)
elif auth_length is not None:
self.assertEqual(p.auth_length, auth_length)
else:
diff --git a/python/samba/tests/dcerpc/registry.py b/python/samba/tests/dcerpc/registry.py
index c7bcbfd530a..95de0d0703f 100644
--- a/python/samba/tests/dcerpc/registry.py
+++ b/python/samba/tests/dcerpc/registry.py
@@ -30,11 +30,11 @@ class WinregTests(RpcInterfaceTestCase):
def get_hklm(self):
return self.conn.OpenHKLM(None,
- winreg.KEY_QUERY_VALUE | winreg.KEY_ENUMERATE_SUB_KEYS)
+ winreg.KEY_QUERY_VALUE | winreg.KEY_ENUMERATE_SUB_KEYS)
def test_hklm(self):
handle = self.conn.OpenHKLM(None,
- winreg.KEY_QUERY_VALUE | winreg.KEY_ENUMERATE_SUB_KEYS)
+ winreg.KEY_QUERY_VALUE | winreg.KEY_ENUMERATE_SUB_KEYS)
self.conn.CloseKey(handle)
def test_getversion(self):
@@ -45,7 +45,7 @@ class WinregTests(RpcInterfaceTestCase):
def test_getkeyinfo(self):
handle = self.conn.OpenHKLM(None,
- winreg.KEY_QUERY_VALUE | winreg.KEY_ENUMERATE_SUB_KEYS)
+ winreg.KEY_QUERY_VALUE | winreg.KEY_ENUMERATE_SUB_KEYS)
x = self.conn.QueryInfoKey(handle, winreg.String())
self.assertEquals(9, len(x)) # should return a 9-tuple
self.conn.CloseKey(handle)
diff --git a/python/samba/tests/dcerpc/srvsvc.py b/python/samba/tests/dcerpc/srvsvc.py
index 407a9d52a73..a3e60757483 100644
--- a/python/samba/tests/dcerpc/srvsvc.py
+++ b/python/samba/tests/dcerpc/srvsvc.py
@@ -57,12 +57,12 @@ class SrvsvcTests(RpcInterfaceTestCase):
name = share.name
share.comment = "now sucessfully modified "
parm_error = self.pipe.NetShareSetInfo(self.server_unc, name,
- 502, share, parm_error)
+ 502, share, parm_error)
def test_NetShareDel(self):
self.skipTest("Dangerous test")
share = self.getDummyShareObject()
parm_error = 0x00000000
self.expectFailure("NetShareAdd doesn't work properly from Python",
- self.conn.NetShareAdd, self.server_unc, 502, share, parm_error)
+ self.conn.NetShareAdd, self.server_unc, 502, share, parm_error)
self.conn.NetShareDel(self.server_unc, share.name, 0)
diff --git a/python/samba/tests/dns.py b/python/samba/tests/dns.py
index 0878054e565..78768ce3ef0 100644
--- a/python/samba/tests/dns.py
+++ b/python/samba/tests/dns.py
@@ -1044,8 +1044,8 @@ class TestZones(DNSTest):
def ldap_get_zone_settings(self):
records = self.samdb.search(base=self.zone_dn, scope=ldb.SCOPE_BASE,
- expression="(&(objectClass=dnsZone)" +
- "(name={}))".format(self.zone),
+ expression="(&(objectClass=dnsZone)" +
+ "(name={}))".format(self.zone),
attrs=["dNSProperty"])
self.assertEqual(len(records), 1)
props = [ndr_unpack(dnsp.DnsProperty, r)
@@ -1525,11 +1525,11 @@ class TestRPCRoundtrip(DNSTest):
self.check_query_txt(prefix, txt)
self.assertIsNotNone(
dns_record_match(self.rpc_conn,
- self.server_ip,
- self.get_dns_domain(),
- "%s.%s" % (prefix, self.get_dns_domain()),
- dnsp.DNS_TYPE_TXT,
- '"\\"This is a test\\"" "" ""'))
+ self.server_ip,
+ self.get_dns_domain(),
+ "%s.%s" % (prefix, self.get_dns_domain()),
+ dnsp.DNS_TYPE_TXT,
+ '"\\"This is a test\\"" "" ""'))
prefix, txt = 'pad2textrec', ['"This is a test"', '', '', 'more text']
p = self.make_txt_update(prefix, txt)
@@ -1670,9 +1670,9 @@ class TestRPCRoundtrip(DNSTest):
self.assert_dns_rcode_equals(response, dns.DNS_RCODE_OK)
self.check_query_txt(prefix, ['NULL'])
self.assertIsNotNone(dns_record_match(self.rpc_conn, self.server_ip,
- self.get_dns_domain(),
- "%s.%s" % (prefix, self.get_dns_domain()),
- dnsp.DNS_TYPE_TXT, '"NULL"'))
+ self.get_dns_domain(),
+ "%s.%s" % (prefix, self.get_dns_domain()),
+ dnsp.DNS_TYPE_TXT, '"NULL"'))
prefix, txt = 'nulltextrec2', ['NULL\x00BYTE', 'NULL\x00BYTE']
p = self.make_txt_update(prefix, txt)
@@ -1681,9 +1681,9 @@ class TestRPCRoundtrip(DNSTest):
self.assert_dns_rcode_equals(response, dns.DNS_RCODE_OK)
self.check_query_txt(prefix, ['NULL', 'NULL'])
self.assertIsNotNone(dns_record_match(self.rpc_conn, self.server_ip,
- self.get_dns_domain(),
- "%s.%s" % (prefix, self.get_dns_domain()),
- dnsp.DNS_TYPE_TXT, '"NULL" "NULL"'))
+ self.get_dns_domain(),
+ "%s.%s" % (prefix, self.get_dns_domain()),
+ dnsp.DNS_TYPE_TXT, '"NULL" "NULL"'))
def test_update_add_null_char_rpc_to_dns(self):
prefix = 'rpcnulltextrec'
@@ -1726,9 +1726,9 @@ class TestRPCRoundtrip(DNSTest):
self.assert_dns_rcode_equals(response, dns.DNS_RCODE_OK)
self.check_query_txt(prefix, txt)
self.assertIsNotNone(dns_record_match(self.rpc_conn, self.server_ip,
- self.get_dns_domain(),
- "%s.%s" % (prefix, self.get_dns_domain()),
- dnsp.DNS_TYPE_TXT, '"HIGH\xFFBYTE"'))
+ self.get_dns_domain(),
+ "%s.%s" % (prefix, self.get_dns_domain()),
+ dnsp.DNS_TYPE_TXT, '"HIGH\xFFBYTE"'))
def test_update_add_hex_rpc_to_dns(self):
prefix, txt = 'hextextrec', ['HIGH\xFFBYTE']
@@ -1772,9 +1772,9 @@ class TestRPCRoundtrip(DNSTest):
self.assert_dns_rcode_equals(response, dns.DNS_RCODE_OK)
self.check_query_txt(prefix, txt)
self.assertIsNotNone(dns_record_match(self.rpc_conn, self.server_ip,
- self.get_dns_domain(),
- "%s.%s" % (prefix, self.get_dns_domain()),
- dnsp.DNS_TYPE_TXT, '"Th\\\\=is=is a test"'))
+ self.get_dns_domain(),
+ "%s.%s" % (prefix, self.get_dns_domain()),
+ dnsp.DNS_TYPE_TXT, '"Th\\\\=is=is a test"'))
# This test fails against Windows as it eliminates slashes in RPC
# One typical use for a slash is in records like 'var=value' to
@@ -1823,10 +1823,10 @@ class TestRPCRoundtrip(DNSTest):
self.assert_dns_rcode_equals(response, dns.DNS_RCODE_OK)
self.check_query_txt(prefix, txt)
self.assertIsNotNone(dns_record_match(self.rpc_conn, self.server_ip,
- self.get_dns_domain(),
- "%s.%s" % (prefix, self.get_dns_domain()),
- dnsp.DNS_TYPE_TXT, '"\\"This is a test\\""' +
- ' "\\"and this is a test, too\\""'))
+ self.get_dns_domain(),
+ "%s.%s" % (prefix, self.get_dns_domain()),
+ dnsp.DNS_TYPE_TXT, '"\\"This is a test\\""' +
+ ' "\\"and this is a test, too\\""'))
def test_update_add_two_rpc_to_dns(self):
prefix, txt = 'textrec2', ['"This is a test"',
@@ -1835,8 +1835,8 @@ class TestRPCRoundtrip(DNSTest):
name = "%s.%s" % (prefix, self.get_dns_domain())
rec = data_to_dns_record(dnsp.DNS_TYPE_TXT,
- '"\\"This is a test\\""' +
- ' "\\"and this is a test, too\\""')
+ '"\\"This is a test\\""' +
+ ' "\\"and this is a test, too\\""')
add_rec_buf = dnsserver.DNS_RPC_RECORD_BUF()
add_rec_buf.rec = rec
try:
@@ -1873,9 +1873,9 @@ class TestRPCRoundtrip(DNSTest):
self.assert_dns_rcode_equals(response, dns.DNS_RCODE_OK)
self.check_query_txt(prefix, txt)
self.assertIsNotNone(dns_record_match(self.rpc_conn, self.server_ip,
- self.get_dns_domain(),
- "%s.%s" % (prefix, self.get_dns_domain()),
- dnsp.DNS_TYPE_TXT, ''))
+ self.get_dns_domain(),
+ "%s.%s" % (prefix, self.get_dns_domain()),
+ dnsp.DNS_TYPE_TXT, ''))
def test_update_add_empty_rpc_to_dns(self):
prefix, txt = 'rpcemptytextrec', []
diff --git a/python/samba/tests/docs.py b/python/samba/tests/docs.py
index 86cb06c3adf..e02ed8b7a4b 100644
--- a/python/samba/tests/docs.py
+++ b/python/samba/tests/docs.py
@@ -158,21 +158,21 @@ class SmbDotConfTests(TestCase):
# registry shares appears to need sudo
self._set_arbitrary(['bin/testparm'],
- exceptions = ['client lanman auth',
- 'client plaintext auth',
- 'registry shares',
- 'smb ports',
- 'rpc server dynamic port range',
- 'name resolve order'])
+ exceptions = ['client lanman auth',
+ 'client plaintext auth',
+ 'registry shares',
+ 'smb ports',
+ 'rpc server dynamic port range',
+ 'name resolve order'])
self._test_empty(['bin/testparm'])
def test_default_s4(self):
self._test_default(['bin/samba-tool', 'testparm'])
self._set_defaults(['bin/samba-tool', 'testparm'])
self._set_arbitrary(['bin/samba-tool', 'testparm'],
- exceptions = ['smb ports',
- 'rpc server dynamic port range',
- 'name resolve order'])
+ exceptions = ['smb ports',
+ 'rpc server dynamic port range',
+ 'name resolve order'])
self._test_empty(['bin/samba-tool', 'testparm'])
def _test_default(self, program):
@@ -194,9 +194,15 @@ class SmbDotConfTests(TestCase):
section = "test"
else:
self.fail("%s has no valid context" % param)
- p = subprocess.Popen(program + ["-s", self.smbconf,
- "--section-name", section, "--parameter-name", param],
- stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=self.topdir).communicate()
+ p = subprocess.Popen(program + ["-s",
+ self.smbconf,
+ "--section-name",
+ section,
+ "--parameter-name",
+ param],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ cwd=self.topdir).communicate()
result = p[0].decode().upper().strip()
if result != default.upper():
if not (result == "" and default == '""'):
@@ -205,7 +211,7 @@ class SmbDotConfTests(TestCase):
if len(failset) > 0:
self.fail(self._format_message(failset,
- "Parameters that do not have matching defaults:"))
+ "Parameters that do not have matching defaults:"))
def _set_defaults(self, program):
failset = set()
@@ -224,10 +230,17 @@ class SmbDotConfTests(TestCase):
section = "test"
else:
self.fail("%s has no valid context" % param)
- p = subprocess.Popen(program + ["-s", self.smbconf,
- "--section-name", section, "--parameter-name", param,
- "--option", "%s = %s" % (param, default)],
- stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=self.topdir).communicate()
+ p = subprocess.Popen(program + ["-s",
+ self.smbconf,
+ "--section-name",
+ section,
+ "--parameter-name",
+ param,
+ "--option",
+ "%s = %s" % (param, default)],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ cwd=self.topdir).communicate()
result = p[0].decode().upper().strip()
if result != default.upper():
if not (result == "" and default == '""'):
@@ -236,7 +249,7 @@ class SmbDotConfTests(TestCase):
if len(failset) > 0:
self.fail(self._format_message(failset,
- "Parameters that do not have matching defaults:"))
+ "Parameters that do not have matching defaults:"))
def _set_arbitrary(self, program, exceptions=None):
arbitrary = {'string': 'string', 'boolean': 'yes', 'integer': '5',
@@ -283,10 +296,17 @@ class SmbDotConfTests(TestCase):
if value_to_use is None:
self.fail("%s has an invalid type" % param)
- p = subprocess.Popen(program + ["-s", self.smbconf,
- "--section-name", section, "--parameter-name", param,
- "--option", "%s = %s" % (param, value_to_use)],
- stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=self.topdir).communicate()
+ p = subprocess.Popen(program + ["-s",
+ self.smbconf,
+ "--section-name",
+ section,
+ "--parameter-name",
+ param,
+ "--option",
+ "%s = %s" % (param, value_to_use)],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ cwd=self.topdir).communicate()
result = p[0].decode().upper().strip()
if result != value_to_use.upper():
# currently no way to distinguish command lists
@@ -315,9 +335,14 @@ class SmbDotConfTests(TestCase):
finally:
g.close()
- p = subprocess.Popen(program + ["-s", tempconf, "--suppress-prompt",
- "--option", "%s = %s" % (param, value_to_use)],
- stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=self.topdir).communicate()
+ p = subprocess.Popen(program + ["-s",
+ tempconf,
+ "--suppress-prompt",
+ "--option",
+ "%s = %s" % (param, value_to_use)],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ cwd=self.topdir).communicate()
os.unlink(tempconf)
@@ -348,11 +373,15 @@ class SmbDotConfTests(TestCase):
if len(failset) > 0:
self.fail(self._format_message(failset,
- "Parameters that were unexpectedly not set:"))
+ "Parameters that were unexpectedly not set:"))
def _test_empty(self, program):
- p = subprocess.Popen(program + ["-s", self.blankconf, "--suppress-prompt"],
- stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=self.topdir).communicate()
+ p = subprocess.Popen(program + ["-s",
+ self.blankconf,
+ "--suppress-prompt"],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ cwd=self.topdir).communicate()
output = ""
for line in p[0].decode().splitlines():
diff --git a/python/samba/tests/dsdb.py b/python/samba/tests/dsdb.py
index 1cf4eef56c3..4110e8d209a 100644
--- a/python/samba/tests/dsdb.py
+++ b/python/samba/tests/dsdb.py
@@ -575,8 +575,8 @@ class DsdbTests(TestCase):
msg = ldb.Message()
msg.dn = kept_dn
msg["manager"] = ldb.MessageElement("<SID=%s>" % removed_sid,
- ldb.FLAG_MOD_ADD,
- "manager")
+ ldb.FLAG_MOD_ADD,
+ "manager")
try:
self.samdb.modify(msg)
self.fail("No exception should get LDB_ERR_CONSTRAINT_VIOLATION")
@@ -589,8 +589,8 @@ class DsdbTests(TestCase):
msg = ldb.Message()
msg.dn = kept_dn
msg["manager"] = ldb.MessageElement("<GUID=%s>" % removed_guid,
- ldb.FLAG_MOD_ADD,
- "manager")
+ ldb.FLAG_MOD_ADD,
+ "manager")
try:
self.samdb.modify(msg)
self.fail("No exception should get LDB_ERR_CONSTRAINT_VIOLATION")
diff --git a/python/samba/tests/get_opt.py b/python/samba/tests/get_opt.py
index b272a423147..ca55c8d08b1 100644
--- a/python/samba/tests/get_opt.py
+++ b/python/samba/tests/get_opt.py
@@ -52,4 +52,4 @@ class KerberosOptionTests(samba.tests.TestCase):
def test_parse_invalid(self):
self.assertRaises(optparse.OptionValueError,
- parse_kerberos_arg, "blah?", "--kerberos")
+ parse_kerberos_arg, "blah?", "--kerberos")
diff --git a/python/samba/tests/gpo.py b/python/samba/tests/gpo.py
index 27f52af9bcc..ed5f8702b99 100644
--- a/python/samba/tests/gpo.py
+++ b/python/samba/tests/gpo.py
@@ -48,11 +48,11 @@ class GPOTests(tests.TestCase):
ds_paths = [None, 'CN=%s,%s' % (guid, dspath)]
for i in range(0, len(gpos)):
self.assertEquals(gpos[i].name, names[i],
- 'The gpo name did not match expected name %s' % gpos[i].name)
+ 'The gpo name did not match expected name %s' % gpos[i].name)
self.assertEquals(gpos[i].file_sys_path, file_sys_paths[i],
- 'file_sys_path did not match expected %s' % gpos[i].file_sys_path)
+ 'file_sys_path did not match expected %s' % gpos[i].file_sys_path)
self.assertEquals(gpos[i].ds_path, ds_paths[i],
- 'ds_path did not match expected %s' % gpos[i].ds_path)
+ 'ds_path did not match expected %s' % gpos[i].ds_path)
def test_gpo_ads_does_not_segfault(self):
@@ -72,12 +72,12 @@ class GPOTests(tests.TestCase):
with open(os.path.join(gpo_path, 'GPT.INI'), 'w') as gpt:
gpt.write(gpt_data % 42)
self.assertEquals(gpo.gpo_get_sysvol_gpt_version(gpo_path)[1], 42,
- 'gpo_get_sysvol_gpt_version() did not return the expected version')
+ 'gpo_get_sysvol_gpt_version() did not return the expected version')
with open(os.path.join(gpo_path, 'GPT.INI'), 'w') as gpt:
gpt.write(gpt_data % old_vers)
self.assertEquals(gpo.gpo_get_sysvol_gpt_version(gpo_path)[1], old_vers,
- 'gpo_get_sysvol_gpt_version() did not return the expected version')
+ 'gpo_get_sysvol_gpt_version() did not return the expected version')
def test_check_refresh_gpo_list(self):
cache = self.lp.cache_path('gpo_cache')
@@ -110,7 +110,7 @@ class GPOTests(tests.TestCase):
'{31B2F340-016D-11D2-945F-00C04FB984F9}/GPT.INI'
result = check_safe_path(before)
self.assertEquals(result, after, 'check_safe_path() didn\'t' \
- ' correctly convert \\ to /')
+ ' correctly convert \\ to /')
def test_gpt_ext_register(self):
this_path = os.path.dirname(os.path.realpath(__file__))
@@ -123,14 +123,14 @@ class GPOTests(tests.TestCase):
self.assertTrue(ret, 'Failed to register a gp ext')
gp_exts = list_gp_extensions(self.lp.configfile)
self.assertTrue(ext_guid in gp_exts.keys(),
- 'Failed to list gp exts')
+ 'Failed to list gp exts')
self.assertEquals(gp_exts[ext_guid]['DllName'], ext_path,
- 'Failed to list gp exts')
+ 'Failed to list gp exts')
unregister_gp_extension(ext_guid)
gp_exts = list_gp_extensions(self.lp.configfile)
self.assertTrue(ext_guid not in gp_exts.keys(),
- 'Failed to unregister gp exts')
+ 'Failed to unregister gp exts')
self.assertTrue(check_guid(ext_guid), 'Failed to parse valid guid')
self.assertFalse(check_guid('AAAAAABBBBBBBCCC'), 'Parsed invalid guid')
@@ -143,9 +143,9 @@ class GPOTests(tests.TestCase):
lp, parser = parse_gpext_conf(self.lp.configfile)
self.assertTrue('test_section' in parser.sections(),
- 'test_section not found in gpext.conf')
+ 'test_section not found in gpext.conf')
self.assertEquals(parser.get('test_section', 'test_var'), ext_guid,
- 'Failed to find test variable in gpext.conf')
+ 'Failed to find test variable in gpext.conf')
parser.remove_section('test_section')
atomic_write_conf(lp, parser)
diff --git a/python/samba/tests/kcc/ldif_import_export.py b/python/samba/tests/kcc/ldif_import_export.py
index 5ea748ff3f0..1350f9b5e96 100644
--- a/python/samba/tests/kcc/ldif_import_export.py
+++ b/python/samba/tests/kcc/ldif_import_export.py
@@ -45,7 +45,7 @@ MULTISITE_LDIF = os.path.join(os.environ['SRCDIR_ABS'],
# UNCONNECTED_LDIF is a single site, unconnected 5DC database that was
# created using samba-tool domain join in testenv.
UNCONNECTED_LDIF = os.path.join(os.environ['SRCDIR_ABS'],
- "testdata/unconnected-intrasite.ldif")
+ "testdata/unconnected-intrasite.ldif")
MULTISITE_LDIF_DSAS = (
("CN=WIN08,CN=Servers,CN=Site-4,CN=Sites,CN=Configuration,DC=ad,DC=samba,DC=example,DC=com",
diff --git a/python/samba/tests/netcmd.py b/python/samba/tests/netcmd.py
index 2867c031a17..3f1c6425d1a 100644
--- a/python/samba/tests/netcmd.py
+++ b/python/samba/tests/netcmd.py
@@ -42,14 +42,14 @@ class NetCmdTestCase(samba.tests.TestCase):
yield path, cmd
subcmds = getattr(cmd, "subcommands", {})
todo.extend([(path + " " + k, v) for (k, v) in
- subcmds.items()])
+ subcmds.items()])
class TestParmTests(NetCmdTestCase):
def test_no_client_ip(self):
out, err = self.run_netcmd(cmd_testparm, ["--client-name=foo"],
- retcode=-1)
+ retcode=-1)
self.assertEquals("", out)
self.assertEquals(
"ERROR: Both a DNS name and an IP address are "
@@ -75,7 +75,7 @@ class CommandTests(NetCmdTestCase):
missing.append(path)
if missing:
self.fail("The following commands do not have a synopsis set: %r" %
- missing)
+ missing)
def test_short_description_everywhere(self):
missing = []
diff --git a/python/samba/tests/policy.py b/python/samba/tests/policy.py
index b2457451528..538efcd95b0 100644
--- a/python/samba/tests/policy.py
+++ b/python/samba/tests/policy.py
@@ -27,8 +27,8 @@ class PolicyTests(TestCase):
def test_get_gpo_flags(self):
self.assertEquals(["GPO_FLAG_USER_DISABLE"],
- policy.get_gpo_flags(policy.GPO_FLAG_USER_DISABLE))
+ policy.get_gpo_flags(policy.GPO_FLAG_USER_DISABLE))
def test_get_gplink_options(self):
self.assertEquals(["GPLINK_OPT_DISABLE"],
- policy.get_gplink_options(policy.GPLINK_OPT_DISABLE))
+ policy.get_gplink_options(policy.GPLINK_OPT_DISABLE))
diff --git a/python/samba/tests/posixacl.py b/python/samba/tests/posixacl.py
index 8b48825fc6f..78eae888360 100644
--- a/python/samba/tests/posixacl.py
+++ b/python/samba/tests/posixacl.py
@@ -322,7 +322,7 @@ class PosixAclMappingTests(TestCaseInTempDir):
nwrap_module_fn_prefix = os.getenv('NSS_WRAPPER_MODULE_FN_PREFIX')
nwrap_winbind_active = (nwrap_module_so_path != "" and
- nwrap_module_fn_prefix == "winbind")
+ nwrap_module_fn_prefix == "winbind")
LA_sid = security.dom_sid(str(domsid)+"-"+str(security.DOMAIN_RID_ADMINISTRATOR))
BA_sid = security.dom_sid(security.SID_BUILTIN_ADMINISTRATORS)
@@ -665,7 +665,7 @@ class PosixAclMappingTests(TestCaseInTempDir):
domsid = passdb.get_global_sam_sid()
session_info = self.get_session_info(domsid)
setntacl(self.lp, self.tempf, acl, str(domsid), use_ntvfs=False,
- session_info=session_info)
+ session_info=session_info)
facl = getntacl(self.lp, self.tempf)
self.assertEquals(facl.as_sddl(domsid),acl)
posix_acl = smbd.get_sys_acl(self.tempf, smb_acl.SMB_ACL_TYPE_ACCESS)
@@ -674,7 +674,7 @@ class PosixAclMappingTests(TestCaseInTempDir):
nwrap_module_fn_prefix = os.getenv('NSS_WRAPPER_MODULE_FN_PREFIX')
nwrap_winbind_active = (nwrap_module_so_path != "" and
- nwrap_module_fn_prefix == "winbind")
+ nwrap_module_fn_prefix == "winbind")
LA_sid = security.dom_sid(str(domsid)+"-"+str(security.DOMAIN_RID_ADMINISTRATOR))
BA_sid = security.dom_sid(security.SID_BUILTIN_ADMINISTRATORS)
diff --git a/python/samba/tests/provision.py b/python/samba/tests/provision.py
index b7d8369e58e..bd39abf9920 100644
--- a/python/samba/tests/provision.py
+++ b/python/samba/tests/provision.py
@@ -66,7 +66,7 @@ class ProvisionTestCase(samba.tests.TestCaseInTempDir):
ldb = setup_secretsdb(paths, None, None, lp=env_loadparm())
try:
self.assertEquals("LSA Secrets",
- ldb.searchone(basedn="CN=LSA Secrets", attribute="CN").decode('utf8'))
+ ldb.searchone(basedn="CN=LSA Secrets", attribute="CN").decode('utf8'))
finally:
del ldb
os.unlink(path)
@@ -123,9 +123,9 @@ class SanitizeServerRoleTests(TestCase):
def test_same(self):
self.assertEquals("standalone server",
- sanitize_server_role("standalone server"))
+ sanitize_server_role("standalone server"))
self.assertEquals("member server",
- sanitize_server_role("member server"))
+ sanitize_server_role("member server"))
def test_invalid(self):
self.assertRaises(ValueError, sanitize_server_role, "foo")
@@ -187,7 +187,7 @@ class ProvisionResultTests(TestCase):
result.adminpass = "geheim"
entries = self.report_logger(result)
self.assertEquals(entries[1],
- ("INFO", 'Admin password: geheim'))
+ ("INFO", 'Admin password: geheim'))
class DetermineNetbiosNameTests(TestCase):
diff --git a/python/samba/tests/s3idmapdb.py b/python/samba/tests/s3idmapdb.py
index 1f510f10bad..651ef0faca1 100644
--- a/python/samba/tests/s3idmapdb.py
+++ b/python/samba/tests/s3idmapdb.py
@@ -32,7 +32,7 @@ class IdmapDbTestCase(TestCase):
def setUp(self):
super(IdmapDbTestCase, self).setUp()
self.idmapdb = IdmapDatabase(os.path.join(DATADIR,
- "winbindd_idmap"))
+ "winbindd_idmap"))
def test_user_hwm(self):
self.assertEquals(10000, self.idmapdb.get_user_hwm())
diff --git a/python/samba/tests/samba3sam.py b/python/samba/tests/samba3sam.py
index 24a213779e9..f860031dc1b 100644
--- a/python/samba/tests/samba3sam.py
+++ b/python/samba/tests/samba3sam.py
@@ -57,10 +57,10 @@ class MapBaseTestCase(TestCaseInTempDir):
"@LIST": "rootdse,paged_results,server_sort,asq,samldb,password_hash,operational,objectguid,rdn_name,samba3sam,samba3sid,show_deleted_ignore,dsdb_flags_ignore,partition"})
ldb.add({"dn": "@PARTITION",
- "partition": ["%s" % (s4.basedn_casefold),
- "%s" % (s3.basedn_casefold)],
- "replicateEntries": ["@ATTRIBUTES", "@INDEXLIST"],
- "modules": "*:"})
+ "partition": ["%s" % (s4.basedn_casefold),
+ "%s" % (s3.basedn_casefold)],
+ "replicateEntries": ["@ATTRIBUTES", "@INDEXLIST"],
+ "modules": "*:"})
def setUp(self):
self.lp = env_loadparm()
@@ -182,8 +182,8 @@ class Samba3SamTestCase(MapBaseTestCase):
"""Looking up by objectClass"""
msg = self.ldb.search(expression="(|(objectClass=user)(cn=Administrator))")
self.assertEquals(set([str(m.dn) for m in msg]),
- set(["unixName=Administrator,ou=Users,dc=vernstok,dc=nl",
- "unixName=nobody,ou=Users,dc=vernstok,dc=nl"]))
+ set(["unixName=Administrator,ou=Users,dc=vernstok,dc=nl",
+ "unixName=nobody,ou=Users,dc=vernstok,dc=nl"]))
def test_s3sam_modify(self):
# Adding a record that will be fallbacked
@@ -202,8 +202,8 @@ class Samba3SamTestCase(MapBaseTestCase):
#
#
msg = self.ldb.search(expression="(cn=Foo)", base="cn=Foo",
- scope=SCOPE_BASE,
- attrs=['foo','blah','cn','showInAdvancedViewOnly'])
+ scope=SCOPE_BASE,
+ attrs=['foo','blah','cn','showInAdvancedViewOnly'])
self.assertEquals(len(msg), 1)
self.assertEquals(str(msg[0]["showInAdvancedViewOnly"]), "TRUE")
self.assertEquals(str(msg[0]["foo"]), "bar")
@@ -211,10 +211,10 @@ class Samba3SamTestCase(MapBaseTestCase):
# Adding record that will be mapped
self.ldb.add({"dn": "cn=Niemand,cn=Users,dc=vernstok,dc=nl",
- "objectClass": "user",
- "unixName": "bin",
- "sambaUnicodePwd": "geheim",
- "cn": "Niemand"})
+ "objectClass": "user",
+ "unixName": "bin",
+ "sambaUnicodePwd": "geheim",
+ "cn": "Niemand"})
# Checking for existence of record (remote)
msg = self.ldb.search(expression="(unixName=bin)",
@@ -225,7 +225,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'])
+ attrs=['unixName','cn','dn', 'sambaUnicodePwd'])
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")
@@ -233,7 +233,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'])
+ attrs=['unixName','cn','dn', 'sambaUnicodePwd'])
#print "got %d replies" % len(msg)
self.assertEquals(len(msg), 1) # TODO: should check with more records
self.assertEquals(str(msg[0]["cn"]), "Niemand")
@@ -244,7 +244,7 @@ class Samba3SamTestCase(MapBaseTestCase):
msg = self.samba3.db.search(expression="(cn=Niemand)")
self.assertTrue(len(msg) >= 1)
self.assertEquals(str(msg[0]["sambaSID"]),
- "S-1-5-21-4231626423-2410014848-2360679739-2001")
+ "S-1-5-21-4231626423-2410014848-2360679739-2001")
self.assertEquals(str(msg[0]["displayName"]), "Niemand")
# Adding attribute...
@@ -407,7 +407,7 @@ objectSid: S-1-5-21-4231626423-2410014848-2360679739-1052
# Search remote record by local DN
dn = self.samba4.dn("cn=A")
res = self.ldb.search(dn, scope=SCOPE_BASE,
- attrs=["dnsHostName", "lastLogon"])
+ attrs=["dnsHostName", "lastLogon"])
self.assertEquals(len(res), 1)
self.assertEquals(str(res[0].dn), dn)
self.assertTrue(not "dnsHostName" in res[0])
@@ -416,7 +416,7 @@ objectSid: S-1-5-21-4231626423-2410014848-2360679739-1052
# Search remote record by remote DN
dn = self.samba3.dn("cn=A")
res = self.samba3.db.search(dn, scope=SCOPE_BASE,
- attrs=["dnsHostName", "lastLogon", "sambaLogonTime"])
+ attrs=["dnsHostName", "lastLogon", "sambaLogonTime"])
self.assertEquals(len(res), 1)
self.assertEquals(str(res[0].dn), dn)
self.assertTrue(not "dnsHostName" in res[0])
@@ -426,7 +426,7 @@ objectSid: S-1-5-21-4231626423-2410014848-2360679739-1052
# Search split record by local DN
dn = self.samba4.dn("cn=X")
res = self.ldb.search(dn, scope=SCOPE_BASE,
- attrs=["dnsHostName", "lastLogon"])
+ attrs=["dnsHostName", "lastLogon"])
self.assertEquals(len(res), 1)
self.assertEquals(str(res[0].dn), dn)
self.assertEquals(str(res[0]["dnsHostName"]), "x")
@@ -435,7 +435,7 @@ objectSid: S-1-5-21-4231626423-2410014848-2360679739-1052
# Search split record by remote DN
dn = self.samba3.dn("cn=X")
res = self.samba3.db.search(dn, scope=SCOPE_BASE,
- attrs=["dnsHostName", "lastLogon", "sambaLogonTime"])
+ attrs=["dnsHostName", "lastLogon", "sambaLogonTime"])
self.assertEquals(len(res), 1)
self.assertEquals(str(res[0].dn), dn)
self.assertTrue(not "dnsHostName" in res[0])
@@ -446,7 +446,7 @@ objectSid: S-1-5-21-4231626423-2410014848-2360679739-1052
# Search by ignored attribute
res = self.ldb.search(expression="(revision=x)", scope=SCOPE_DEFAULT,
- attrs=["dnsHostName", "lastLogon"])
+ attrs=["dnsHostName", "lastLogon"])
self.assertEquals(len(res), 2)
res = sorted(res, key=attrgetter('dn'))
self.assertEquals(str(res[0].dn), self.samba4.dn("cn=X"))
@@ -458,7 +458,7 @@ objectSid: S-1-5-21-4231626423-2410014848-2360679739-1052
# Search by kept attribute
res = self.ldb.search(expression="(description=y)",
- scope=SCOPE_DEFAULT, attrs=["dnsHostName", "lastLogon"])
+ scope=SCOPE_DEFAULT, attrs=["dnsHostName", "lastLogon"])
self.assertEquals(len(res), 2)
res = sorted(res, key=attrgetter('dn'))
self.assertEquals(str(res[0].dn), self.samba4.dn("cn=C"))
@@ -505,7 +505,7 @@ objectSid: S-1-5-21-4231626423-2410014848-2360679739-1052
# In most cases, this even works when the mapping is missing
# a `convert_operator' by enumerating the remote db.
res = self.ldb.search(expression="(primaryGroupID=512)",
- attrs=["dnsHostName", "lastLogon", "primaryGroupID"])
+ attrs=["dnsHostName", "lastLogon", "primaryGroupID"])
self.assertEquals(len(res), 1)
self.assertEquals(str(res[0].dn), self.samba4.dn("cn=A"))
self.assertTrue(not "dnsHostName" in res[0])
@@ -815,10 +815,10 @@ objectSid: S-1-5-21-4231626423-2410014848-2360679739-1052
# Add local record
dn = "cn=test,dc=idealx,dc=org"
self.ldb.add({"dn": dn,
- "cn": "test",
- "foo": "bar",
- "revision": "1",
- "description": "test"})
+ "cn": "test",
+ "foo": "bar",
+ "revision": "1",
+ "description": "test"})
# Check it's there
attrs = ["foo", "revision", "description"]
res = self.ldb.search(dn, scope=SCOPE_BASE, attrs=attrs)
@@ -876,13 +876,13 @@ description: foo
dn = self.samba4.dn("cn=test")
dn2 = self.samba3.dn("cn=test")
self.samba3.db.add({"dn": dn2,
- "cn": "test",
- "description": "foo",
- "sambaBadPasswordCount": "3",
- "sambaNextRid": "1001"})
+ "cn": "test",
+ "description": "foo",
+ "sambaBadPasswordCount": "3",
+ "sambaNextRid": "1001"})
# Check it's there
res = self.samba3.db.search(dn2, scope=SCOPE_BASE,
- attrs=["description", "sambaBadPasswordCount", "sambaNextRid"])
+ attrs=["description", "sambaBadPasswordCount", "sambaNextRid"])
self.assertEquals(len(res), 1)
self.assertEquals(str(res[0].dn), dn2)
self.assertEquals(str(res[0]["description"]), "foo")
@@ -911,7 +911,7 @@ badPwdCount: 4
self.ldb.modify_ldif(ldif)
# Check in mapped db
res = self.ldb.search(dn, scope=SCOPE_BASE,
- attrs=["description", "badPwdCount", "nextRid"])
+ attrs=["description", "badPwdCount", "nextRid"])
self.assertEquals(len(res), 1)
self.assertEquals(str(res[0].dn), dn)
self.assertEquals(str(res[0]["description"]), "test")
@@ -919,7 +919,7 @@ badPwdCount: 4
self.assertEquals(str(res[0]["nextRid"]), "1001")
# Check in remote db
res = self.samba3.db.search(dn2, scope=SCOPE_BASE,
- attrs=["description", "sambaBadPasswordCount", "sambaNextRid"])
+ attrs=["description", "sambaBadPasswordCount", "sambaNextRid"])
self.assertEquals(len(res), 1)
self.assertEquals(str(res[0].dn), dn2)
self.assertEquals(str(res[0]["description"]), "test")
@@ -932,7 +932,7 @@ badPwdCount: 4
# Check in mapped db
dn = dn2
res = self.ldb.search(dn, scope=SCOPE_BASE,
- attrs=["description", "badPwdCount", "nextRid"])
+ attrs=["description", "badPwdCount", "nextRid"])
self.assertEquals(len(res), 1)
self.assertEquals(str(res[0].dn), dn)
self.assertEquals(str(res[0]["description"]), "test")
@@ -941,7 +941,7 @@ badPwdCount: 4
# Check in remote db
dn2 = self.samba3.dn("cn=toast")
res = self.samba3.db.search(dn2, scope=SCOPE_BASE,
- attrs=["description", "sambaBadPasswordCount", "sambaNextRid"])
+ attrs=["description", "sambaBadPasswordCount", "sambaNextRid"])
self.assertEquals(len(res), 1)
self.assertEquals(str(res[0].dn), dn2)
self.assertEquals(str(res[0]["description"]), "test")
@@ -963,10 +963,10 @@ badPwdCount: 4
dn = self.samba4.dn("cn=test")
dn2 = self.samba3.dn("cn=test")
self.samba3.db.add({"dn": dn2,
- "cn": "test",
- "description": "foo",
- "sambaBadPasswordCount": "3",
- "sambaNextRid": "1001"})
+ "cn": "test",
+ "description": "foo",
+ "sambaBadPasswordCount": "3",
+ "sambaNextRid": "1001"})
# Modify local data of remote record
ldif = """
@@ -1104,8 +1104,8 @@ revision: 2
# Check in remote db
dn2 = self.samba3.dn("cn=toast")
res = self.samba3.db.search(dn2, scope=SCOPE_BASE,
- attrs=["description", "sambaBadPasswordCount", "sambaNextRid",
- "revision"])
+ attrs=["description", "sambaBadPasswordCount", "sambaNextRid",
+ "revision"])
self.assertEquals(len(res), 1)
self.assertEquals(str(res[0].dn), dn2)
self.assertEquals(str(res[0]["description"]), "test")
diff --git a/python/samba/tests/samba_tool/computer.py b/python/samba/tests/samba_tool/computer.py
index dedcb90ca56..beb984c3c69 100644
--- a/python/samba/tests/samba_tool/computer.py
+++ b/python/samba/tests/samba_tool/computer.py
@@ -179,9 +179,9 @@ class ComputerCmdTestCase(SambaToolCmdTest):
dsdb.ATYPE_WORKSTATION_TRUST)
computerlist = self.samdb.search(base=self.samdb.domain_dn(),
- scope=ldb.SCOPE_SUBTREE,
- expression=search_filter,
- attrs=["samaccountname"])
+ scope=ldb.SCOPE_SUBTREE,
+ expression=search_filter,
+ attrs=["samaccountname"])
self.assertTrue(len(computerlist) > 0, "no computers found in samdb")
@@ -278,11 +278,11 @@ class ComputerCmdTestCase(SambaToolCmdTest):
samaccountname = "%s$" % name
search_filter = ("(&(sAMAccountName=%s)(objectCategory=%s,%s))" %
(ldb.binary_encode(samaccountname),
- "CN=Computer,CN=Schema,CN=Configuration",
- self.samdb.domain_dn()))
+ "CN=Computer,CN=Schema,CN=Configuration",
+ self.samdb.domain_dn()))
computerlist = self.samdb.search(base=self.samdb.domain_dn(),
- scope=ldb.SCOPE_SUBTREE,
- expression=search_filter, attrs=[])
+ scope=ldb.SCOPE_SUBTREE,
+ expression=search_filter, attrs=[])
if computerlist:
return computerlist[0]
else:
diff --git a/python/samba/tests/samba_tool/forest.py b/python/samba/tests/samba_tool/forest.py
index 3e11d1fc82c..1f2194671e9 100644
--- a/python/samba/tests/samba_tool/forest.py
+++ b/python/samba/tests/samba_tool/forest.py
@@ -26,7 +26,7 @@ class ForestCmdTestCase(SambaToolCmdTest):
def setUp(self):
super(ForestCmdTestCase, self).setUp()
self.samdb = self.getSamDB("-H", "ldap://%s" % os.environ["DC_SERVER"],
- "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]))
+ "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]))
self.domain_dn = self.samdb.domain_dn()
def tearDown(self):
@@ -43,10 +43,10 @@ class ForestCmdTestCase(SambaToolCmdTest):
def test_display(self):
"""Tests that we can display forest settings"""
(result, out, err) = self.runsublevelcmd("forest", ("directory_service",
- "show"),
- "-H", "ldap://%s" % os.environ["DC_SERVER"],
- "-U%s%%%s" % (os.environ["DC_USERNAME"],
- os.environ["DC_PASSWORD"]))
+ "show"),
+ "-H", "ldap://%s" % os.environ["DC_SERVER"],
+ "-U%s%%%s" % (os.environ["DC_USERNAME"],
+ os.environ["DC_PASSWORD"]))
self.assertCmdSuccess(result, out, err)
self.assertEquals(err,"","Shouldn't be any error messages")
@@ -56,10 +56,10 @@ class ForestCmdTestCase(SambaToolCmdTest):
"""Test that we can modify the dsheuristics setting"""
(result, out, err) = self.runsublevelcmd("forest", ("directory_service",
- "dsheuristics"), "0000002",
- "-H", "ldap://%s" % os.environ["DC_SERVER"],
- "-U%s%%%s" % (os.environ["DC_USERNAME"],
- os.environ["DC_PASSWORD"]))
+ "dsheuristics"), "0000002",
+ "-H", "ldap://%s" % os.environ["DC_SERVER"],
+ "-U%s%%%s" % (os.environ["DC_USERNAME"],
+ os.environ["DC_PASSWORD"]))
self.assertCmdSuccess(result, out, err)
self.assertEquals(err,"","Shouldn't be any error messages")
diff --git a/python/samba/tests/samba_tool/fsmo.py b/python/samba/tests/samba_tool/fsmo.py
index 7fd0ae2e033..dcef4e5209b 100644
--- a/python/samba/tests/samba_tool/fsmo.py
+++ b/python/samba/tests/samba_tool/fsmo.py
@@ -30,11 +30,11 @@ class FsmoCmdTestCase(SambaToolCmdTest):
# Check that the output is sensible
samdb = self.getSamDB("-H", "ldap://%s" % os.environ["SERVER"],
- "-U%s%%%s" % (os.environ["USERNAME"], os.environ["PASSWORD"]))
+ "-U%s%%%s" % (os.environ["USERNAME"], os.environ["PASSWORD"]))
try:
res = samdb.search(base=ldb.Dn(samdb, "CN=Infrastructure,DC=DomainDnsZones") + samdb.get_default_basedn(),
- scope=ldb.SCOPE_BASE, attrs=["fsmoRoleOwner"])
+ scope=ldb.SCOPE_BASE, attrs=["fsmoRoleOwner"])
self.assertTrue("DomainDnsZonesMasterRole owner: " + res[0]["fsmoRoleOwner"][0] in out)
except ldb.LdbError as e:
diff --git a/python/samba/tests/samba_tool/group.py b/python/samba/tests/samba_tool/group.py
index 23e910485cf..6753691fd9c 100644
--- a/python/samba/tests/samba_tool/group.py
+++ b/python/samba/tests/samba_tool/group.py
@@ -32,7 +32,7 @@ class GroupCmdTestCase(SambaToolCmdTest):
def setUp(self):
super(GroupCmdTestCase, self).setUp()
self.samdb = self.getSamDB("-H", "ldap://%s" % os.environ["DC_SERVER"],
- "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]))
+ "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]))
self.groups = []
self.groups.append(self._randomGroup({"name": "testgroup1"}))
self.groups.append(self._randomGroup({"name": "testgroup2"}))
@@ -85,7 +85,7 @@ class GroupCmdTestCase(SambaToolCmdTest):
"--description=%s" % group["description"],
"-H", "ldap://%s" % os.environ["DC_SERVER"],
"-U%s%%%s" % (os.environ["DC_USERNAME"],
- os.environ["DC_PASSWORD"]))
+ os.environ["DC_PASSWORD"]))
self.assertCmdSuccess(result, out, err)
self.assertEquals(err,"","There shouldn't be any error message")
@@ -199,8 +199,8 @@ class GroupCmdTestCase(SambaToolCmdTest):
def _find_group(self, name):
search_filter = ("(&(sAMAccountName=%s)(objectCategory=%s,%s))" %
(ldb.binary_encode(name),
- "CN=Group,CN=Schema,CN=Configuration",
- self.samdb.domain_dn()))
+ "CN=Group,CN=Schema,CN=Configuration",
+ self.samdb.domain_dn()))
grouplist = self.samdb.search(base=self.samdb.domain_dn(),
scope=ldb.SCOPE_SUBTREE,
expression=search_filter,
diff --git a/python/samba/tests/samba_tool/ou.py b/python/samba/tests/samba_tool/ou.py
index e1443c10d5a..c646349ffac 100644
--- a/python/samba/tests/samba_tool/ou.py
+++ b/python/samba/tests/samba_tool/ou.py
@@ -31,7 +31,7 @@ class OUCmdTestCase(SambaToolCmdTest):
def setUp(self):
super(OUCmdTestCase, self).setUp()
self.samdb = self.getSamDB("-H", "ldap://%s" % os.environ["DC_SERVER"],
- "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]))
+ "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]))
self.ous = []
self.ous.append(self._randomOU({"name": "testou1"}))
self.ous.append(self._randomOU({"name": "testou2"}))
@@ -159,7 +159,7 @@ class OUCmdTestCase(SambaToolCmdTest):
"Renamed ou '%s' still exists" % ou["name"])
found = self._find_ou(newouname)
self.assertIsNotNone(found,
- "Renamed ou '%s' does not exist" % newouname)
+ "Renamed ou '%s' does not exist" % newouname)
(result, out, err) = self.runsubcmd("ou", "rename",
"OU=%s" % newouname,
@@ -262,8 +262,8 @@ class OUCmdTestCase(SambaToolCmdTest):
def _find_ou(self, name):
search_filter = ("(&(name=%s)(objectCategory=%s,%s))" %
(ldb.binary_encode(name),
- "CN=Organizational-Unit,CN=Schema,CN=Configuration",
- self.samdb.domain_dn()))
+ "CN=Organizational-Unit,CN=Schema,CN=Configuration",
+ self.samdb.domain_dn()))
oulist = self.samdb.search(base=self.samdb.domain_dn(),
scope=ldb.SCOPE_SUBTREE,
expression=search_filter,
diff --git a/python/samba/tests/samba_tool/rodc.py b/python/samba/tests/samba_tool/rodc.py
index 870b5d4339e..3ae52449890 100644
--- a/python/samba/tests/samba_tool/rodc.py
+++ b/python/samba/tests/samba_tool/rodc.py
@@ -35,7 +35,7 @@ class RodcCmdTestCase(SambaToolCmdTest):
self.creds.guess(self.lp)
self.session = system_session()
self.ldb = SamDB("ldap://" + os.environ["DC_SERVER"],
- session_info=self.session, credentials=self.creds,lp=self.lp)
+ session_info=self.session, credentials=self.creds,lp=self.lp)
self.base_dn = self.ldb.domain_dn()
diff --git a/python/samba/tests/samba_tool/schema.py b/python/samba/tests/samba_tool/schema.py
index 31db5c63347..56d09a78de7 100644
--- a/python/samba/tests/samba_tool/schema.py
+++ b/python/samba/tests/samba_tool/schema.py
@@ -26,7 +26,7 @@ class SchemaCmdTestCase(SambaToolCmdTest):
def setUp(self):
super(SchemaCmdTestCase, self).setUp()
self.samdb = self.getSamDB("-H", "ldap://%s" % os.environ["DC_SERVER"],
- "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]))
+ "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]))
def tearDown(self):
super(SchemaCmdTestCase, self).tearDown()
@@ -34,10 +34,10 @@ class SchemaCmdTestCase(SambaToolCmdTest):
def test_display_attribute(self):
"""Tests that we can display schema attributes"""
(result, out, err) = self.runsublevelcmd("schema", ("attribute",
- "show"), "uid",
- "-H", "ldap://%s" % os.environ["DC_SERVER"],
- "-U%s%%%s" % (os.environ["DC_USERNAME"],
- os.environ["DC_PASSWORD"]))
+ "show"), "uid",
+ "-H", "ldap://%s" % os.environ["DC_SERVER"],
+ "-U%s%%%s" % (os.environ["DC_USERNAME"],
+ os.environ["DC_PASSWORD"]))
self.assertCmdSuccess(result, out, err)
self.assertEquals(err,"","Shouldn't be any error messages")
@@ -46,40 +46,40 @@ class SchemaCmdTestCase(SambaToolCmdTest):
def test_modify_attribute_searchflags(self):
"""Tests that we can modify searchFlags of an attribute"""
(result, out, err) = self.runsublevelcmd("schema", ("attribute",
- "modify"), "uid", "--searchflags=9",
- "-H", "ldap://%s" % os.environ["DC_SERVER"],
- "-U%s%%%s" % (os.environ["DC_USERNAME"],
- os.environ["DC_PASSWORD"]))
+ "modify"), "uid", "--searchflags=9",
+ "-H", "ldap://%s" % os.environ["DC_SERVER"],
+ "-U%s%%%s" % (os.environ["DC_USERNAME"],
+ os.environ["DC_PASSWORD"]))
self.assertCmdFail(result, 'Unknown flag 9, please see --help')
(result, out, err) = self.runsublevelcmd("schema", ("attribute",
- "modify"), "uid", "--searchflags=fATTINDEX",
- "-H", "ldap://%s" % os.environ["DC_SERVER"],
- "-U%s%%%s" % (os.environ["DC_USERNAME"],
- os.environ["DC_PASSWORD"]))
+ "modify"), "uid", "--searchflags=fATTINDEX",
+ "-H", "ldap://%s" % os.environ["DC_SERVER"],
+ "-U%s%%%s" % (os.environ["DC_USERNAME"],
+ os.environ["DC_PASSWORD"]))
self.assertCmdSuccess(result, out, err)
self.assertEquals(err,"","Shouldn't be any error messages")
self.assertIn("modified cn=uid,CN=Schema,CN=Configuration,DC=samba,DC=example,DC=com", out)
(result, out, err) = self.runsublevelcmd("schema", ("attribute",
- "modify"), "uid",
- "--searchflags=fATTINDEX,fSUBTREEATTINDEX",
- "-H", "ldap://%s" % os.environ["DC_SERVER"],
- "-U%s%%%s" % (os.environ["DC_USERNAME"],
- os.environ["DC_PASSWORD"]))
+ "modify"), "uid",
+ "--searchflags=fATTINDEX,fSUBTREEATTINDEX",
+ "-H", "ldap://%s" % os.environ["DC_SERVER"],
+ "-U%s%%%s" % (os.environ["DC_USERNAME"],
+ os.environ["DC_PASSWORD"]))
self.assertCmdSuccess(result, out, err)
self.assertEquals(err,"","Shouldn't be any error messages")
self.assertIn("modified cn=uid,CN=Schema,CN=Configuration,DC=samba,DC=example,DC=com", out)
(result, out, err) = self.runsublevelcmd("schema", ("attribute",
- "modify"), "uid",
- "--searchflags=fAtTiNdEx,fPRESERVEONDELETE",
- "-H", "ldap://%s" % os.environ["DC_SERVER"],
- "-U%s%%%s" % (os.environ["DC_USERNAME"],
- os.environ["DC_PASSWORD"]))
+ "modify"), "uid",
+ "--searchflags=fAtTiNdEx,fPRESERVEONDELETE",
+ "-H", "ldap://%s" % os.environ["DC_SERVER"],
+ "-U%s%%%s" % (os.environ["DC_USERNAME"],
+ os.environ["DC_PASSWORD"]))
self.assertCmdSuccess(result, out, err)
self.assertEquals(err,"","Shouldn't be any error messages")
@@ -88,10 +88,10 @@ class SchemaCmdTestCase(SambaToolCmdTest):
def test_show_oc_attribute(self):
"""Tests that we can modify searchFlags of an attribute"""
(result, out, err) = self.runsublevelcmd("schema", ("attribute",
- "show_oc"), "cn",
- "-H", "ldap://%s" % os.environ["DC_SERVER"],
- "-U%s%%%s" % (os.environ["DC_USERNAME"],
- os.environ["DC_PASSWORD"]))
+ "show_oc"), "cn",
+ "-H", "ldap://%s" % os.environ["DC_SERVER"],
+ "-U%s%%%s" % (os.environ["DC_USERNAME"],
+ os.environ["DC_PASSWORD"]))
self.assertCmdSuccess(result, out, err)
self.assertEquals(err,"","Shouldn't be any error messages")
@@ -101,10 +101,10 @@ class SchemaCmdTestCase(SambaToolCmdTest):
def test_display_objectclass(self):
"""Tests that we can display schema objectclasses"""
(result, out, err) = self.runsublevelcmd("schema", ("objectclass",
- "show"), "person",
- "-H", "ldap://%s" % os.environ["DC_SERVER"],
- "-U%s%%%s" % (os.environ["DC_USERNAME"],
- os.environ["DC_PASSWORD"]))
+ "show"), "person",
+ "-H", "ldap://%s" % os.environ["DC_SERVER"],
+ "-U%s%%%s" % (os.environ["DC_USERNAME"],
+ os.environ["DC_PASSWORD"]))
self.assertCmdSuccess(result, out, err)
self.assertEquals(err,"","Shouldn't be any error messages")
diff --git a/python/samba/tests/samba_tool/user.py b/python/samba/tests/samba_tool/user.py
index 6fc0bdafee9..08662ad9d1d 100644
--- a/python/samba/tests/samba_tool/user.py
+++ b/python/samba/tests/samba_tool/user.py
@@ -36,7 +36,7 @@ class UserCmdTestCase(SambaToolCmdTest):
def setUp(self):
super(UserCmdTestCase, self).setUp()
self.samdb = self.getSamDB("-H", "ldap://%s" % os.environ["DC_SERVER"],
- "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]))
+ "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]))
self.users = []
self.users.append(self._randomUser({"name": "sambatool1", "company": "comp1"}))
self.users.append(self._randomUser({"name": "sambatool2", "company": "comp1"}))
@@ -217,16 +217,16 @@ class UserCmdTestCase(SambaToolCmdTest):
for a in cache_attrs.keys():
v = cache_attrs[a].get("value", "")
self.assertMatch(out, "%s: %s" % (a, v),
- "syncpasswords --cache-ldb-initialize: %s: %s out[%s]" % (a, v, out))
+ "syncpasswords --cache-ldb-initialize: %s: %s out[%s]" % (a, v, out))
(result, out, err) = self.runsubcmd("user", "syncpasswords", "--no-wait")
self.assertCmdSuccess(result, out, err, "Ensure syncpasswords --no-wait runs")
self.assertEqual(err,"","syncpasswords --no-wait")
self.assertMatch(out, "dirsync_loop(): results 0",
- "syncpasswords --no-wait: 'dirsync_loop(): results 0': out[%s]" % (out))
+ "syncpasswords --no-wait: 'dirsync_loop(): results 0': out[%s]" % (out))
for user in self.users:
self.assertMatch(out, "sAMAccountName: %s" % (user["name"]),
- "syncpasswords --no-wait: 'sAMAccountName': %s out[%s]" % (user["name"], out))
+ "syncpasswords --no-wait: 'sAMAccountName': %s out[%s]" % (user["name"], out))
for user in self.users:
newpasswd = self.randomPass()
@@ -249,24 +249,24 @@ class UserCmdTestCase(SambaToolCmdTest):
self.assertCmdSuccess(result, out, err, "Ensure syncpasswords --no-wait runs")
self.assertEqual(err,"","syncpasswords --no-wait")
self.assertMatch(out, "dirsync_loop(): results 0",
- "syncpasswords --no-wait: 'dirsync_loop(): results 0': out[%s]" % (out))
+ "syncpasswords --no-wait: 'dirsync_loop(): results 0': out[%s]" % (out))
self.assertMatch(out, "sAMAccountName: %s" % (user["name"]),
- "syncpasswords --no-wait: 'sAMAccountName': %s out[%s]" % (user["name"], out))
+ "syncpasswords --no-wait: 'sAMAccountName': %s out[%s]" % (user["name"], out))
self.assertMatch(out, "# unicodePwd::: REDACTED SECRET ATTRIBUTE",
- "getpassword '# unicodePwd::: REDACTED SECRET ATTRIBUTE': out[%s]" % out)
+ "getpassword '# unicodePwd::: REDACTED SECRET ATTRIBUTE': out[%s]" % out)
self.assertMatch(out, "unicodePwd:: %s" % unicodePwd,
- "getpassword unicodePwd: out[%s]" % out)
+ "getpassword unicodePwd: out[%s]" % out)
self.assertMatch(out, "# supplementalCredentials::: REDACTED SECRET ATTRIBUTE",
- "getpassword '# supplementalCredentials::: REDACTED SECRET ATTRIBUTE': out[%s]" % out)
+ "getpassword '# supplementalCredentials::: REDACTED SECRET ATTRIBUTE': out[%s]" % out)
self.assertMatch(out, "supplementalCredentials:: ",
- "getpassword supplementalCredentials: out[%s]" % out)
+ "getpassword supplementalCredentials: out[%s]" % out)
if "virtualSambaGPG:: " in out:
self.assertMatch(out, "virtualClearTextUTF8:: %s" % virtualClearTextUTF8,
- "getpassword virtualClearTextUTF8: out[%s]" % out)
+ "getpassword virtualClearTextUTF8: out[%s]" % out)
self.assertMatch(out, "virtualClearTextUTF16:: %s" % virtualClearTextUTF16,
- "getpassword virtualClearTextUTF16: out[%s]" % out)
+ "getpassword virtualClearTextUTF16: out[%s]" % out)
self.assertMatch(out, "virtualSSHA: ",
- "getpassword virtualSSHA: out[%s]" % out)
+ "getpassword virtualSSHA: out[%s]" % out)
(result, out, err) = self.runsubcmd("user", "getpassword",
user["name"],
@@ -276,19 +276,19 @@ class UserCmdTestCase(SambaToolCmdTest):
self.assertEqual(err,"","getpassword without url")
self.assertMatch(out, "Got password OK", "getpassword without url")
self.assertMatch(out, "sAMAccountName: %s" % (user["name"]),
- "getpassword: 'sAMAccountName': %s out[%s]" % (user["name"], out))
+ "getpassword: 'sAMAccountName': %s out[%s]" % (user["name"], out))
self.assertMatch(out, "unicodePwd:: %s" % unicodePwd,
- "getpassword unicodePwd: out[%s]" % out)
+ "getpassword unicodePwd: out[%s]" % out)
self.assertMatch(out, "supplementalCredentials:: ",
- "getpassword supplementalCredentials: out[%s]" % out)
+ "getpassword supplementalCredentials: out[%s]" % out)
self._verify_supplementalCredentials(out.replace("\nGot password OK\n", ""))
if "virtualSambaGPG:: " in out:
self.assertMatch(out, "virtualClearTextUTF8:: %s" % virtualClearTextUTF8,
- "getpassword virtualClearTextUTF8: out[%s]" % out)
+ "getpassword virtualClearTextUTF8: out[%s]" % out)
self.assertMatch(out, "virtualClearTextUTF16:: %s" % virtualClearTextUTF16,
- "getpassword virtualClearTextUTF16: out[%s]" % out)
+ "getpassword virtualClearTextUTF16: out[%s]" % out)
self.assertMatch(out, "virtualSSHA: ",
- "getpassword virtualSSHA: out[%s]" % out)
+ "getpassword virtualSSHA: out[%s]" % out)
for user in self.users:
newpasswd = self.randomPass()
@@ -373,7 +373,7 @@ class UserCmdTestCase(SambaToolCmdTest):
"--attributes=sAMAccountName,company",
"-H", "ldap://%s" % os.environ["DC_SERVER"],
"-U%s%%%s" % (os.environ["DC_USERNAME"],
- os.environ["DC_PASSWORD"]))
+ os.environ["DC_PASSWORD"]))
self.assertCmdSuccess(result, out, err, "Error running show")
expected_out = """dn: CN=%s %s,CN=Users,%s
@@ -585,8 +585,8 @@ sAMAccountName: %s
def _find_user(self, name):
search_filter = "(&(sAMAccountName=%s)(objectCategory=%s,%s))" % (ldb.binary_encode(name), "CN=Person,CN=Schema,CN=Configuration", self.samdb.domain_dn())
userlist = self.samdb.search(base=self.samdb.domain_dn(),
- scope=ldb.SCOPE_SUBTREE,
- expression=search_filter, attrs=[])
+ scope=ldb.SCOPE_SUBTREE,
+ expression=search_filter, attrs=[])
if userlist:
return userlist[0]
else:
diff --git a/python/samba/tests/samba_tool/user_check_password_script.py b/python/samba/tests/samba_tool/user_check_password_script.py
index f1deb88ee65..c84c7f687a0 100644
--- a/python/samba/tests/samba_tool/user_check_password_script.py
+++ b/python/samba/tests/samba_tool/user_check_password_script.py
@@ -33,7 +33,7 @@ class UserCheckPwdTestCase(SambaToolCmdTest):
def setUp(self):
super(UserCheckPwdTestCase, self).setUp()
self.samdb = self.getSamDB("-H", "ldap://%s" % os.environ["DC_SERVER"],
- "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]))
+ "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]))
self.old_min_pwd_age = self.samdb.get_minPwdAge()
self.samdb.set_minPwdAge("0")
diff --git a/python/samba/tests/samba_tool/user_virtualCryptSHA.py b/python/samba/tests/samba_tool/user_virtualCryptSHA.py
index 3190d116afb..a25bf5e6eb8 100644
--- a/python/samba/tests/samba_tool/user_virtualCryptSHA.py
+++ b/python/samba/tests/samba_tool/user_virtualCryptSHA.py
@@ -126,7 +126,7 @@ class UserCmdCryptShaTestCase(SambaToolCmdTest):
self.ldb.modify(
msg,
controls=["local_oid:%s:0" %
- dsdb.DSDB_CONTROL_BYPASS_PASSWORD_HASH_OID])
+ dsdb.DSDB_CONTROL_BYPASS_PASSWORD_HASH_OID])
# gpg decryption not enabled.
# both virtual attributes specified, no rounds option
diff --git a/python/samba/tests/samba_tool/user_wdigest.py b/python/samba/tests/samba_tool/user_wdigest.py
index eddb79f4d18..327fe5a4fde 100644
--- a/python/samba/tests/samba_tool/user_wdigest.py
+++ b/python/samba/tests/samba_tool/user_wdigest.py
@@ -68,7 +68,7 @@ class UserCmdWdigestTestCase(SambaToolCmdTest):
self.samdb = self.getSamDB(
"-H", "ldap://%s" % os.environ["DC_SERVER"],
"-U%s%%%s" % (os.environ["DC_USERNAME"],
- os.environ["DC_PASSWORD"]))
+ os.environ["DC_PASSWORD"]))
self.dns_domain = self.samdb.domain_dns_name()
res = self.samdb.search(
base=self.samdb.get_config_basedn(),
diff --git a/python/samba/tests/security.py b/python/samba/tests/security.py
index e0df9125eed..02c1e8897f6 100644
--- a/python/samba/tests/security.py
+++ b/python/samba/tests/security.py
@@ -74,7 +74,7 @@ class SecurityDescriptorTests(samba.tests.TestCase):
def test_from_sddl_invalidtype2(self):
sddl = "O:AOG:DAD:(A;;RPWPCCDCLCSWRCWDWOGA;;;S-1-0-0)"
self.assertRaises(TypeError, security.descriptor.from_sddl, sddl,
- "S-2-0-0")
+ "S-2-0-0")
def test_as_sddl(self):
text = "O:AOG:DAD:(A;;RPWPCCDCLCSWRCWDWOGA;;;S-1-0-0)"
@@ -139,11 +139,11 @@ class PrivilegeTests(samba.tests.TestCase):
def test_privilege_name(self):
self.assertEquals("SeShutdownPrivilege",
- security.privilege_name(security.SEC_PRIV_SHUTDOWN))
+ security.privilege_name(security.SEC_PRIV_SHUTDOWN))
def test_privilege_id(self):
self.assertEquals(security.SEC_PRIV_SHUTDOWN,
- security.privilege_id("SeShutdownPrivilege"))
+ security.privilege_id("SeShutdownPrivilege"))
class CheckAccessTests(samba.tests.TestCase):
diff --git a/python/samba/tests/smb.py b/python/samba/tests/smb.py
index 141e4388e03..a34ca835b71 100644
--- a/python/samba/tests/smb.py
+++ b/python/samba/tests/smb.py
@@ -49,9 +49,9 @@ class SMBTests(samba.tests.TestCase):
def test_list(self):
ls = [f['name'] for f in self.conn.list(addom)]
self.assertIn('scripts', ls,
- msg='"scripts" directory not found in sysvol')
+ msg='"scripts" directory not found in sysvol')
self.assertIn('Policies',ls,
- msg='"Policies" directory not found in sysvol')
+ msg='"Policies" directory not found in sysvol')
def test_unlink(self):
"""
@@ -67,7 +67,7 @@ class SMBTests(samba.tests.TestCase):
contents = self.conn.loadfile(test_file)
self.assertEquals(contents.decode('utf8'), test_contents,
- msg='contents of test file did not match what was written')
+ msg='contents of test file did not match what was written')
# with python2 this will save/load str type (with embedded nulls)
# with python3 this will save/load bytes type
@@ -76,7 +76,7 @@ class SMBTests(samba.tests.TestCase):
contents = self.conn.loadfile(test_file)
self.assertEquals(contents, test_literal_bytes_embed_nulls,
- msg='contents of test file did not match what was written')
+ msg='contents of test file did not match what was written')
# python3 only this will save/load unicode
def test_save_load_utfcontents(self):
@@ -85,7 +85,7 @@ class SMBTests(samba.tests.TestCase):
contents = self.conn.loadfile(test_file)
self.assertEquals(contents.decode('utf8'), utf_contents,
- msg='contents of test file did not match what was written')
+ msg='contents of test file did not match what was written')
# with python2 this will save/load str type
# with python3 this will save/load bytes type
@@ -94,4 +94,4 @@ class SMBTests(samba.tests.TestCase):
contents = self.conn.loadfile(test_file)
self.assertEquals(contents, binary_contents,
- msg='contents of test file did not match what was written')
+ msg='contents of test file did not match what was written')
diff --git a/python/samba/tests/source.py b/python/samba/tests/source.py
index db4960ba7cb..378c6a2e9fd 100644
--- a/python/samba/tests/source.py
+++ b/python/samba/tests/source.py
@@ -151,7 +151,7 @@ class TestSource(TestCase):
def _format_message(self, dict_, message):
files = ["%s: %s" % (f, ', '.join([str(i + 1) for i in lines]))
- for f, lines in dict_.items()]
+ for f, lines in dict_.items()]
files.sort()
return message + '\n\n %s' % ('\n '.join(files))
@@ -170,8 +170,8 @@ class TestSource(TestCase):
self._push_file(tabs, fname, line_no)
if tabs:
self.fail(self._format_message(tabs,
- 'Tab characters were found in the following source files.'
- '\nThey should either be replaced by "\\t" or by spaces:'))
+ 'Tab characters were found in the following source files.'
+ '\nThey should either be replaced by "\\t" or by spaces:'))
def test_unix_newlines(self):
"""Check for unix new lines."""
@@ -181,7 +181,7 @@ class TestSource(TestCase):
self._push_file(illegal_newlines, fname, line_no)
if illegal_newlines:
self.fail(self._format_message(illegal_newlines,
- 'Non-unix newlines were found in the following source files:'))
+ 'Non-unix newlines were found in the following source files:'))
def test_trailing_whitespace(self):
"""Check that there is not trailing whitespace in Python files."""
@@ -191,7 +191,7 @@ class TestSource(TestCase):
self._push_file(trailing_whitespace, fname, line_no)
if trailing_whitespace:
self.fail(self._format_message(trailing_whitespace,
- 'Trailing whitespace was found in the following source files.'))
+ 'Trailing whitespace was found in the following source files.'))
def test_shebang_lines(self):
"""Check that files with shebang lines and only those are executable."""
@@ -208,7 +208,7 @@ class TestSource(TestCase):
self._push_file(files_without_shebang, fname, line_no)
if files_with_shebang:
self.fail(self._format_message(files_with_shebang,
- 'Files with shebang line that are not executable:'))
+ 'Files with shebang line that are not executable:'))
if files_without_shebang:
self.fail(self._format_message(files_without_shebang,
- 'Files without shebang line that are executable:'))
+ 'Files without shebang line that are executable:'))
diff --git a/python/samba/tests/subunitrun.py b/python/samba/tests/subunitrun.py
index 21a7115dcae..92f36edaa17 100755
--- a/python/samba/tests/subunitrun.py
+++ b/python/samba/tests/subunitrun.py
@@ -46,10 +46,10 @@ class SubunitOptions(optparse.OptionGroup):
def __init__(self, parser):
optparse.OptionGroup.__init__(self, parser, "Subunit Options")
self.add_option('-l', '--list', dest='listtests', default=False,
- help='List tests rather than running them.',
- action="store_true")
+ help='List tests rather than running them.',
+ action="store_true")
self.add_option('--load-list', dest='load_list', default=None,
- help='Specify a filename containing the test ids to use.')
+ help='Specify a filename containing the test ids to use.')
class TestProgram(BaseTestProgram):
diff --git a/python/samba/tests/upgrade.py b/python/samba/tests/upgrade.py
index b46a4173191..9e539a98ff5 100644
--- a/python/samba/tests/upgrade.py
+++ b/python/samba/tests/upgrade.py
@@ -37,4 +37,4 @@ class WinsUpgradeTests(LdbTestCase):
def test_version(self):
import_wins(self.ldb, {})
self.assertEquals("VERSION",
- str(self.ldb.search(expression="(objectClass=winsMaxVersion)")[0]["cn"]))
+ str(self.ldb.search(expression="(objectClass=winsMaxVersion)")[0]["cn"]))
diff --git a/python/samba/tests/upgradeprovision.py b/python/samba/tests/upgradeprovision.py
index 6d1d7cbdfbf..39739af0273 100644
--- a/python/samba/tests/upgradeprovision.py
+++ b/python/samba/tests/upgradeprovision.py
@@ -137,7 +137,7 @@ class UpdateSecretsTests(samba.tests.TestCaseInTempDir):
# Test that updating an already up-to-date secretsdb works fine
self.secretsdb = self._getCurrentFormatDb()
self.assertEquals(None,
- update_secrets(self.referencedb, self.secretsdb, dummymessage))
+ update_secrets(self.referencedb, self.secretsdb, dummymessage))
def test_update_modules(self):
empty_db = self._getEmptyDb()
diff --git a/python/samba/tests/upgradeprovisionneeddc.py b/python/samba/tests/upgradeprovisionneeddc.py
index 9db96c8d248..9e523961691 100644
--- a/python/samba/tests/upgradeprovisionneeddc.py
+++ b/python/samba/tests/upgradeprovisionneeddc.py
@@ -26,12 +26,12 @@ from samba.credentials import Credentials
from samba.auth import system_session
from samba.provision import getpolicypath,find_provision_key_parameters
from samba.upgradehelpers import (get_paths, get_ldbs,
- identic_rename,
- updateOEMInfo, getOEMInfo, update_gpo,
- delta_update_basesamdb,
- update_dns_account_password,
- search_constructed_attrs_stored,
- increment_calculated_keyversion_number)
+ identic_rename,
+ updateOEMInfo, getOEMInfo, update_gpo,
+ delta_update_basesamdb,
+ update_dns_account_password,
+ search_constructed_attrs_stored,
+ increment_calculated_keyversion_number)
from samba.tests import env_loadparm, TestCaseInTempDir
from samba.tests.provision import create_dummy_secretsdb
import ldb
@@ -82,8 +82,8 @@ class UpgradeProvisionWithLdbTestCase(TestCaseInTempDir):
self.paths = paths
self.ldbs = get_ldbs(paths, self.creds, system_session(), self.lp)
self.names = find_provision_key_parameters(self.ldbs.sam,
- self.ldbs.secrets, self.ldbs.idmap, paths, smb_conf_path,
- self.lp)
+ self.ldbs.secrets, self.ldbs.idmap, paths, smb_conf_path,
+ self.lp)
self.referencedb = create_dummy_secretsdb(
os.path.join(self.tempdir, "ref.ldb"))
@@ -104,7 +104,7 @@ class UpgradeProvisionWithLdbTestCase(TestCaseInTempDir):
self.names.rootdn,
hash)
self.assertEqual(self.ldbs.sam.get_attribute_replmetadata_version(dn,
- "unicodePwd"),
+ "unicodePwd"),
140)
# This function should not decrement the version
hash[dn.lower()] = 130
@@ -113,7 +113,7 @@ class UpgradeProvisionWithLdbTestCase(TestCaseInTempDir):
self.names.rootdn,
hash)
self.assertEqual(self.ldbs.sam.get_attribute_replmetadata_version(dn,
- "unicodePwd"),
+ "unicodePwd"),
140)
def test_identic_rename(self):
@@ -122,7 +122,7 @@ class UpgradeProvisionWithLdbTestCase(TestCaseInTempDir):
guestDN = ldb.Dn(self.ldbs.sam, "CN=Guest,CN=Users,%s" % rootdn)
identic_rename(self.ldbs.sam, guestDN)
res = self.ldbs.sam.search(expression="(name=Guest)", base=rootdn,
- scope=ldb.SCOPE_SUBTREE, attrs=["dn"])
+ scope=ldb.SCOPE_SUBTREE, attrs=["dn"])
self.assertEquals(len(res), 1)
self.assertEquals(str(res[0]["dn"]), "CN=Guest,CN=Users,%s" % rootdn)
@@ -134,7 +134,7 @@ class UpgradeProvisionWithLdbTestCase(TestCaseInTempDir):
def test_update_gpo_simple(self):
dir = getpolicypath(self.paths.sysvol, self.names.dnsdomain,
- self.names.policyid)
+ self.names.policyid)
shutil.rmtree(dir)
self.assertFalse(os.path.isdir(dir))
update_gpo(self.paths, self.ldbs.sam, self.names, self.lp, dummymessage)
@@ -147,7 +147,7 @@ class UpgradeProvisionWithLdbTestCase(TestCaseInTempDir):
os.mkdir(path)
os.mkdir(os.path.join(path, self.names.dnsdomain))
os.mkdir(os.path.join(os.path.join(path, self.names.dnsdomain),
- "Policies"))
+ "Policies"))
update_gpo(self.paths, self.ldbs.sam, self.names, self.lp, dummymessage)
shutil.rmtree(path)
self.paths.sysvol = save
@@ -160,7 +160,7 @@ class UpgradeProvisionWithLdbTestCase(TestCaseInTempDir):
def test_update_dns_account(self):
update_dns_account_password(self.ldbs.sam, self.ldbs.secrets,
- self.names)
+ self.names)
def test_updateOEMInfo(self):
realm = self.lp.get("realm")
diff --git a/python/samba/tests/xattr.py b/python/samba/tests/xattr.py
index c99ffcf0087..ca25afbdcd7 100644
--- a/python/samba/tests/xattr.py
+++ b/python/samba/tests/xattr.py
@@ -49,7 +49,7 @@ class XattrTests(TestCase):
open(tempf, 'w').write("empty")
try:
samba.xattr_native.wrap_setxattr(tempf, "user.unittests",
- ndr_pack(ntacl))
+ ndr_pack(ntacl))
except IOError:
raise SkipTest("the filesystem where the tests are runned do not support XATTR")
os.unlink(tempf)
@@ -76,7 +76,7 @@ class XattrTests(TestCase):
open(tempf, 'w').write("empty")
try:
samba.xattr_tdb.wrap_setxattr(eadb_path,
- tempf, "user.unittests", ndr_pack(ntacl))
+ tempf, "user.unittests", ndr_pack(ntacl))
finally:
os.unlink(tempf)
os.unlink(eadb_path)
@@ -88,8 +88,8 @@ class XattrTests(TestCase):
open(tempf, 'w').write("empty")
try:
self.assertRaises(IOError, samba.xattr_tdb.wrap_setxattr,
- os.path.join("nonexistent", "eadb.tdb"), tempf,
- "user.unittests", ndr_pack(ntacl))
+ os.path.join("nonexistent", "eadb.tdb"), tempf,
+ "user.unittests", ndr_pack(ntacl))
finally:
os.unlink(tempf)
@@ -100,9 +100,9 @@ class XattrTests(TestCase):
open(tempf, 'w').write("empty")
try:
samba.xattr_tdb.wrap_setxattr(eadb_path, tempf, "user.unittests",
- reftxt)
+ reftxt)
text = samba.xattr_tdb.wrap_getxattr(eadb_path, tempf,
- "user.unittests")
+ "user.unittests")
self.assertEquals(text, reftxt)
finally:
os.unlink(tempf)
@@ -116,7 +116,7 @@ class XattrTests(TestCase):
open(tempf, 'w').write("empty")
try:
samba.posix_eadb.wrap_setxattr(eadb_path,
- tempf, "user.unittests", ndr_pack(ntacl))
+ tempf, "user.unittests", ndr_pack(ntacl))
finally:
os.unlink(tempf)
os.unlink(eadb_path)
@@ -128,9 +128,9 @@ class XattrTests(TestCase):
open(tempf, 'w').write("empty")
try:
samba.posix_eadb.wrap_setxattr(eadb_path, tempf, "user.unittests",
- reftxt)
+ reftxt)
text = samba.posix_eadb.wrap_getxattr(eadb_path, tempf,
- "user.unittests")
+ "user.unittests")
self.assertEquals(text, reftxt)
finally:
os.unlink(tempf)