svn commit: samba r2419 - in
branches/SAMBA_4_0/source/scripting/swig/torture: .
tpot at samba.org
tpot at samba.org
Sun Sep 19 12:38:06 GMT 2004
Author: tpot
Date: 2004-09-19 12:38:06 +0000 (Sun, 19 Sep 2004)
New Revision: 2419
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/scripting/swig/torture&rev=2419&nolog=1
Log:
Write tests for samr_EnumDomains() and samr_LookupDomain().
Modified:
branches/SAMBA_4_0/source/scripting/swig/torture/samr.py
Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/torture/samr.py
===================================================================
--- branches/SAMBA_4_0/source/scripting/swig/torture/samr.py 2004-09-19 12:37:32 UTC (rev 2418)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/samr.py 2004-09-19 12:38:06 UTC (rev 2419)
@@ -8,7 +8,7 @@
print 'testing samr_Connect'
r = {}
- r['system_name'] = [0]
+ r['system_name'] = 0;
r['access_mask'] = 0x02000000
result = dcerpc.samr_Connect(pipe, r)
@@ -68,13 +68,44 @@
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_SetSecurity(pipe, r)
+ result = dcerpc.samr_LookupDomain(pipe, r)
+ print result
+
+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
parser = OptionParser()
@@ -112,6 +143,9 @@
domain, username, password)
handle = test_Connect(pipe)
+
test_QuerySecurity(pipe, handle)
+test_EnumDomains(pipe, handle)
+
print 'Done'
More information about the samba-cvs
mailing list