summaryrefslogtreecommitdiff
path: root/source4/scripting/swig
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2004-09-12 11:47:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:58:41 -0500
commit984e71e5e51bb7b7abc390f95691affa2d9c0f33 (patch)
treee56b3b5319ba167af855d1add974301cd5902bba /source4/scripting/swig
parenta34ddd04ca89c4bff68dbfb873dcc1dfdbc096ef (diff)
downloadsamba-984e71e5e51bb7b7abc390f95691affa2d9c0f33.tar.gz
samba-984e71e5e51bb7b7abc390f95691affa2d9c0f33.tar.bz2
samba-984e71e5e51bb7b7abc390f95691affa2d9c0f33.zip
r2300: Start writing a Python torture test suite based on the smbtorture rpc tests.
(This used to be commit 73e087f11e401ef8da7c53148444b2745a94dbaf)
Diffstat (limited to 'source4/scripting/swig')
-rwxr-xr-xsource4/scripting/swig/test11
-rwxr-xr-xsource4/scripting/swig/torture/samr.py52
2 files changed, 52 insertions, 11 deletions
diff --git a/source4/scripting/swig/test b/source4/scripting/swig/test
deleted file mode 100755
index f90cef747f..0000000000
--- a/source4/scripting/swig/test
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/python
-
-import dcerpc
-
-handle = dcerpc.pipe_connect("ncacn_np:win2k3dc",
- dcerpc.DCERPC_SAMR_UUID, dcerpc.DCERPC_SAMR_VERSION,
- "win2k3dom", "administrator", "penguin")
-
-connect = {"system_name": "win2k3dc", "access_mask": 0x02000000}
-
-print dcerpc.samr_Connect2(handle, connect)
diff --git a/source4/scripting/swig/torture/samr.py b/source4/scripting/swig/torture/samr.py
new file mode 100755
index 0000000000..d7edbbcef5
--- /dev/null
+++ b/source4/scripting/swig/torture/samr.py
@@ -0,0 +1,52 @@
+#!/usr/bin/python
+
+import dcerpc
+
+def test_Connect(handle):
+
+ print 'testing samr_Connect'
+
+ r = {}
+ r['system_name'] = '\0\0'
+ r['access_mask'] = 0x02000000
+
+ result = dcerpc.samr_Connect(pipe, r)
+
+ dcerpc.samr_Close(pipe, result)
+
+ print 'testing samr_Connect2'
+
+ r = {}
+ r['system_name'] = None
+ r['access_mask'] = 0x02000000
+
+ result = dcerpc.samr_Connect2(pipe, r)
+ dcerpc.samr_Close(pipe, result)
+
+ print 'testing samr_Connect3'
+
+ r = {}
+ r['system_name'] = None
+ r['unknown'] = 0
+ r['access_mask'] = 0x02000000
+
+ result = dcerpc.samr_Connect3(pipe, r)
+ dcerpc.samr_Close(pipe, result)
+
+ print 'testing samr_Connect4'
+
+ r = {}
+ r['system_name'] = None
+ r['unknown'] = 0
+ r['access_mask'] = 0x02000000
+
+ result = dcerpc.samr_Connect4(pipe, r)
+ dcerpc.samr_Close(pipe, result)
+
+# Connect to server
+
+pipe = dcerpc.pipe_connect('ncacn_np:win2k3dc',
+ dcerpc.DCERPC_SAMR_UUID, dcerpc.DCERPC_SAMR_VERSION,
+ 'win2k3dom', 'administrator', 'penguin')
+
+test_Connect(pipe)