build: Change bin/default/python -> bin/python symlink to bin/default/python_modules
[Samba.git] / source4 / scripting / python / samba / tests / dcerpc / bare.py
blob3efbf9d4cf3e057575e5355dab57b3bd52c531f1
1 # -*- coding: utf-8 -*-
3 # Unix SMB/CIFS implementation.
4 # Copyright © Jelmer Vernooij <jelmer@samba.org> 2008
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 """Tests for samba.tests.dcerpc.bare."""
22 from samba.dcerpc import ClientConnection
23 import samba.tests
25 class BareTestCase(samba.tests.TestCase):
27 def test_bare(self):
28 # Connect to the echo pipe
29 x = ClientConnection("ncalrpc:localhost[DEFAULT]",
30 ("60a15ec5-4de8-11d7-a637-005056a20182", 1),
31 lp_ctx=samba.tests.env_loadparm())
32 self.assertEquals("\x01\x00\x00\x00", x.request(0, chr(0) * 4))
34 def test_alter_context(self):
35 x = ClientConnection("ncalrpc:localhost[DEFAULT]",
36 ("12345778-1234-abcd-ef00-0123456789ac", 1),
37 lp_ctx=samba.tests.env_loadparm())
38 y = ClientConnection("ncalrpc:localhost",
39 ("60a15ec5-4de8-11d7-a637-005056a20182", 1),
40 basis_connection=x, lp_ctx=samba.tests.env_loadparm())
41 x.alter_context(("60a15ec5-4de8-11d7-a637-005056a20182", 1))
42 # FIXME: self.assertEquals("\x01\x00\x00\x00", x.request(0, chr(0) * 4))
44 def test_two_connections(self):
45 x = ClientConnection("ncalrpc:localhost[DEFAULT]",
46 ("60a15ec5-4de8-11d7-a637-005056a20182", 1),
47 lp_ctx=samba.tests.env_loadparm())
48 y = ClientConnection("ncalrpc:localhost",
49 ("60a15ec5-4de8-11d7-a637-005056a20182", 1),
50 basis_connection=x, lp_ctx=samba.tests.env_loadparm())
51 self.assertEquals("\x01\x00\x00\x00", y.request(0, chr(0) * 4))