python:samba/tests: don't use the x.alter_context() method in dcerpc/bare.py
authorStefan Metzmacher <metze@samba.org>
Mon, 29 Jun 2015 08:03:40 +0000 (10:03 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 3 Jul 2015 00:00:28 +0000 (02:00 +0200)
Establishing a new context on a given connection using alter_context
is supposed to be done by using y = ClientConnection(..., basis_connection=x)

The current x.alter_context() can work as it's not allowed to
change the abstract or transfer syntax of an existing presentation
context.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
python/samba/tests/dcerpc/bare.py

index 3efbf9d4cf3e057575e5355dab57b3bd52c531f1..e101c5bcfcf98313a9ea87775d21b8a191c477a2 100644 (file)
@@ -31,21 +31,12 @@ class BareTestCase(samba.tests.TestCase):
                 lp_ctx=samba.tests.env_loadparm())
         self.assertEquals("\x01\x00\x00\x00", x.request(0, chr(0) * 4))
 
-    def test_alter_context(self):
+    def test_two_contexts(self):
         x = ClientConnection("ncalrpc:localhost[DEFAULT]",
                 ("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())
-        x.alter_context(("60a15ec5-4de8-11d7-a637-005056a20182", 1))
-        # FIXME: 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),
-                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())
+        self.assertEquals(24, len(x.request(0, chr(0) * 8)))
         self.assertEquals("\x01\x00\x00\x00", y.request(0, chr(0) * 4))