summaryrefslogtreecommitdiff
path: root/source4/scripting/swig/torture/pytorture
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2004-09-28 12:49:05 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:27 -0500
commit83d0f6ffae928e8d8571216542cfb580accff028 (patch)
tree578d1cc87954fa1af16606631a99405f9c7c1397 /source4/scripting/swig/torture/pytorture
parent169cf23812ab32e1b6b4ba5c27c53266e16a9f1e (diff)
downloadsamba-83d0f6ffae928e8d8571216542cfb580accff028.tar.gz
samba-83d0f6ffae928e8d8571216542cfb580accff028.tar.bz2
samba-83d0f6ffae928e8d8571216542cfb580accff028.zip
r2728: Break arg parsing stuff out of samr.py into a standalone program.
(This used to be commit 799b377badebf9a3f388b7d3fdc36484aa5e3376)
Diffstat (limited to 'source4/scripting/swig/torture/pytorture')
-rwxr-xr-xsource4/scripting/swig/torture/pytorture37
1 files changed, 37 insertions, 0 deletions
diff --git a/source4/scripting/swig/torture/pytorture b/source4/scripting/swig/torture/pytorture
new file mode 100755
index 0000000000..89ecfbabcf
--- /dev/null
+++ b/source4/scripting/swig/torture/pytorture
@@ -0,0 +1,37 @@
+#!/usr/bin/python
+
+from optparse import OptionParser
+
+# 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
+
+# Run tests
+
+import samr
+samr.runtests(binding, domain, username, password)