summaryrefslogtreecommitdiff
path: root/source4/scripting/swig/torture
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2004-09-19 12:38:06 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:58:50 -0500
commit6feaf61b61d8f76faeab176af79e1d6e6bea419f (patch)
tree93ae12e559fa7bc19294b674fa771a121beb5ba9 /source4/scripting/swig/torture
parent9261314a9ddf3b0886f9fc2886401bb1e8c21738 (diff)
downloadsamba-6feaf61b61d8f76faeab176af79e1d6e6bea419f.tar.gz
samba-6feaf61b61d8f76faeab176af79e1d6e6bea419f.tar.bz2
samba-6feaf61b61d8f76faeab176af79e1d6e6bea419f.zip
r2419: Write tests for samr_EnumDomains() and samr_LookupDomain().
(This used to be commit aa15fd1ecba2163a077f398cecfb49d71a49cc9d)
Diffstat (limited to 'source4/scripting/swig/torture')
-rwxr-xr-xsource4/scripting/swig/torture/samr.py42
1 files changed, 38 insertions, 4 deletions
diff --git a/source4/scripting/swig/torture/samr.py b/source4/scripting/swig/torture/samr.py
index d3b9a4dd47..00e4db1958 100755
--- a/source4/scripting/swig/torture/samr.py
+++ b/source4/scripting/swig/torture/samr.py
@@ -8,7 +8,7 @@ def test_Connect(handle):
print 'testing samr_Connect'
r = {}
- r['system_name'] = [0]
+ r['system_name'] = 0;
r['access_mask'] = 0x02000000
result = dcerpc.samr_Connect(pipe, r)
@@ -68,12 +68,43 @@ def test_QuerySecurity(pipe, handle):
result = dcerpc.samr_QuerySecurity(pipe, r)
+ s = {}
+ s['handle'] = handle
+ s['sec_info'] = 7
+ s['sdbuf'] = result['sdbuf']
+
+ result = dcerpc.samr_SetSecurity(pipe, s)
+
+ result = dcerpc.samr_QuerySecurity(pipe, r)
+
+def test_LookupDomain(pipe, handle, domain):
+
+ print 'testing samr_LookupDomain'
+
r = {}
r['handle'] = handle
- r['sec_info'] = 7
- r['sdbuf'] = result['sdbuf']
+ r['domain'] = {}
+ r['domain']['name_len'] = 0
+ r['domain']['name_size'] = 0
+ r['domain']['name'] = domain
+
+ result = dcerpc.samr_LookupDomain(pipe, r)
+
+ print result
- result = dcerpc.samr_SetSecurity(pipe, r)
+def test_EnumDomains(pipe, handle):
+
+ print 'testing samr_EnumDomains'
+
+ r = {}
+ r['handle'] = handle
+ r['resume_handle'] = 0
+ r['buf_size'] = -1
+
+ result = dcerpc.samr_EnumDomains(pipe, r)
+
+ for domain in result['sam']['entries']:
+ test_LookupDomain(pipe, handle, domain['name']['name'])
# Parse command line
@@ -112,6 +143,9 @@ pipe = dcerpc.pipe_connect(binding,
domain, username, password)
handle = test_Connect(pipe)
+
test_QuerySecurity(pipe, handle)
+test_EnumDomains(pipe, handle)
+
print 'Done'