s4-drs: Add DRSUAPI_DRS_NONGC_RO_REP bit to DRS_OPTIONS
[Samba/fernandojvsilva.git] / source4 / scripting / python / samba / tests / dcerpc / bare.py
blob6cadad89f1bd42dae8dfe1a311f6f9be09d297dc
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
4 # Unix SMB/CIFS implementation.
5 # Copyright © Jelmer Vernooij <jelmer@samba.org> 2008
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 from samba.dcerpc import ClientConnection
22 from unittest import TestCase
23 from samba.tests import cmdline_loadparm
26 class BareTestCase(TestCase):
28 def test_bare(self):
29 # Connect to the echo pipe
30 x = ClientConnection("ncalrpc:localhost[DEFAULT]",
31 ("60a15ec5-4de8-11d7-a637-005056a20182", 1), lp_ctx=cmdline_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), lp_ctx=cmdline_loadparm)
37 y = ClientConnection("ncalrpc:localhost",
38 ("60a15ec5-4de8-11d7-a637-005056a20182", 1),
39 basis_connection=x, lp_ctx=cmdline_loadparm)
40 x.alter_context(("60a15ec5-4de8-11d7-a637-005056a20182", 1))
41 # FIXME: self.assertEquals("\x01\x00\x00\x00", x.request(0, chr(0) * 4))
43 def test_two_connections(self):
44 x = ClientConnection("ncalrpc:localhost[DEFAULT]",
45 ("60a15ec5-4de8-11d7-a637-005056a20182", 1), lp_ctx=cmdline_loadparm)
46 y = ClientConnection("ncalrpc:localhost",
47 ("60a15ec5-4de8-11d7-a637-005056a20182", 1),
48 basis_connection=x, lp_ctx=cmdline_loadparm)
49 self.assertEquals("\x01\x00\x00\x00", y.request(0, chr(0) * 4))