summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-09-15 04:36:13 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:58:44 -0500
commitd97f808cb695886f1fefc6c58b2b955fc78302b9 (patch)
treefa5edd1e04503438fc0633a9cdd56d0d63dbb7f1 /source4/scripting
parent31288d654552736ee96a0c7edbbc0b0cdcf1a3f5 (diff)
downloadsamba-d97f808cb695886f1fefc6c58b2b955fc78302b9.tar.gz
samba-d97f808cb695886f1fefc6c58b2b955fc78302b9.tar.bz2
samba-d97f808cb695886f1fefc6c58b2b955fc78302b9.zip
r2339: my first python commit!
added command line options for binding string, domain, username and password (This used to be commit e94bec1079f266fdb869642eab24f542a81f8e5a)
Diffstat (limited to 'source4/scripting')
-rwxr-xr-xsource4/scripting/swig/torture/samr.py30
1 files changed, 27 insertions, 3 deletions
diff --git a/source4/scripting/swig/torture/samr.py b/source4/scripting/swig/torture/samr.py
index ca9c7e9597..91b612dd72 100755
--- a/source4/scripting/swig/torture/samr.py
+++ b/source4/scripting/swig/torture/samr.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
import dcerpc
+from optparse import OptionParser
def test_Connect(handle):
@@ -55,11 +56,34 @@ def test_Connect(handle):
r['info']['info1']['unknown2'] = 0
result = dcerpc.samr_Connect5(pipe, r)
-
+
+ print result
+
+# parse command line
+parser = OptionParser()
+parser.add_option("-b", "--binding", action="store", type="string", dest="binding")
+parser.add_option("-d", "--domain", action="store", type="string", dest="domain")
+parser.add_option("-u", "--username", action="store", type="string", dest="username")
+parser.add_option("-p", "--password", action="store", type="string", dest="password")
+
+(options, args) = parser.parse_args()
+
+if not options.binding:
+ parser.error('You must supply a binding string')
+
+if not options.username or not options.password or not options.domain:
+ parser.error('You must supply a domain, username and password')
+
+
+binding=options.binding
+domain=options.domain
+username=options.username
+password=options.password
+
# Connect to server
-pipe = dcerpc.pipe_connect('ncacn_np:win2k3dc',
+pipe = dcerpc.pipe_connect(binding,
dcerpc.DCERPC_SAMR_UUID, dcerpc.DCERPC_SAMR_VERSION,
- 'win2k3dom', 'administrator', 'penguin')
+ domain, username, password)
test_Connect(pipe)