1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-30 19:42:05 +03:00

Add support for secondary contexts from Python.

(This used to be commit 16d1ad0505)
This commit is contained in:
Jelmer Vernooij
2008-05-25 04:23:03 +02:00
parent a2446e5f85
commit 928ecbaebb
5 changed files with 136 additions and 45 deletions

View File

@ -28,3 +28,16 @@ class BareTestCase(TestCase):
("60a15ec5-4de8-11d7-a637-005056a20182", 1))
self.assertEquals("\x01\x00\x00\x00", x.request(0, chr(0) * 4))
#def test_alter_context(self):
# x = ClientConnection("ncalrpc:localhost[DEFAULT]",
# ("12345778-1234-abcd-ef00-0123456789ac", 1))
# x.alter_context(("60a15ec5-4de8-11d7-a637-005056a20182", 1))
# self.assertEquals("\x01\x00\x00\x00", x.request(0, chr(0) * 4))
def test_two_connections(self):
x = ClientConnection("ncalrpc:localhost[DEFAULT]",
("60a15ec5-4de8-11d7-a637-005056a20182", 1))
y = ClientConnection("ncalrpc:localhost",
("60a15ec5-4de8-11d7-a637-005056a20182", 1),
basis_connection=x)
self.assertEquals("\x01\x00\x00\x00", y.request(0, chr(0) * 4))

View File

@ -26,6 +26,10 @@ class RpcEchoTests(RpcInterfaceTestCase):
def setUp(self):
self.conn = echo.rpcecho("ncalrpc:", self.get_loadparm())
def test_two_contexts(self):
self.conn2 = echo.rpcecho("ncalrpc", basis_connection=self.conn)
self.assertEquals(3, self.conn2.AddOne(2))
def test_addone(self):
self.assertEquals(2, self.conn.AddOne(1))