svn commit: samba r2429 - in branches/SAMBA_4_0/source/scripting/swig/torture: .

tpot at samba.org tpot at samba.org
Mon Sep 20 06:31:59 GMT 2004


Author: tpot
Date: 2004-09-20 06:31:59 +0000 (Mon, 20 Sep 2004)
New Revision: 2429

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/scripting/swig/torture&rev=2429&nolog=1

Log:
Add tests for samr_QueryUserInfo(), samr_QueryUserInfo2(),
samr_GetUserPwInfo(), samr_TestPrivateFunctionsUser().  Add stubs for
the rest of the functions in test_OpenDomain() from smbtorture.

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-20 05:41:31 UTC (rev 2428)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/samr.py	2004-09-20 06:31:59 UTC (rev 2429)
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 
-import dcerpc
+import sys, dcerpc
 from optparse import OptionParser
 
 def test_Connect(handle):
@@ -167,6 +167,63 @@
 
     dcerpc.samr_DeleteUser(pipe, r)
 
+def test_QueryUserInfo(pipe, user_handle):
+
+    levels = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 20, 21]
+
+    for level in levels:
+        r = {}
+        r['handle'] = user_handle
+        r['level'] = level
+
+        result = dcerpc.samr_QueryUserInfo(pipe, r)
+
+def test_QueryUserInfo2(pipe, user_handle):
+
+    levels = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 20, 21]
+
+    for level in levels:
+        r = {}
+        r['handle'] = user_handle
+        r['level'] = level
+
+        result = dcerpc.samr_QueryUserInfo2(pipe, r)
+
+def test_SetUserInfo(pipe, user_handle):
+    pass
+
+def test_GetUserPwInfo(pipe, user_handle):
+
+    r = {}
+    r['handle'] = user_handle
+
+    result = dcerpc.samr_GetUserPwInfo(pipe, r)
+
+def test_TestPrivateFunctionsUser(pipe, user_handle):
+
+    r = {}
+    r['handle'] = user_handle
+
+    try:
+        result = dcerpc.samr_TestPrivateFunctionsUser(pipe, r)
+    except dcerpc.NTSTATUS, arg:
+        if arg[0] != 0xc0000002:
+            raise dcerpc.NTSTATUS(arg)
+
+def test_user_ops(pipe, user_handle):
+
+    test_QuerySecurity(pipe, user_handle)
+
+    test_QueryUserInfo(pipe, user_handle)
+
+    test_QueryUserInfo2(pipe, user_handle)
+
+    test_SetUserInfo(pipe, user_handle)
+
+    test_GetUserPwInfo(pipe, user_handle)
+
+    test_TestPrivateFunctionsUser(pipe, user_handle)
+
 def test_CreateUser(pipe, domain_handle):
 
     r = {}
@@ -190,8 +247,82 @@
 
     user_handle = result['acct_handle']
 
-    # samr_QueryUserInfo(), etc
+    q = {}
+    q['handle'] = user_handle
+    q['level'] = 16
 
+    result = dcerpc.samr_QueryUserInfo(pipe, q)
+
+    test_user_ops(pipe, user_handle)
+
+    return user_handle
+
+def test_CreateAlias(pipe, domain_handle):
+    pass
+
+def test_CreateDomainGroup(pipe, domain_handle):
+    pass
+
+def test_CreateAlias(pipe, domain_handle):
+    pass
+
+def test_CreateDomainGroup(pipe, domain_handle):
+    pass
+
+def test_QueryDomainInfo(pipe, domain_handle):
+    pass
+    
+def test_QueryDomainInfo2(pipe, domain_handle):
+    pass
+
+def test_EnumDomainUsers(pipe, domain_handle):
+    pass
+
+def test_EnumDomainGroups(pipe, domain_handle):
+    pass
+
+def test_EnumDomainAliases(pipe, domain_handle):
+    pass
+
+def test_QueryDisplayInfo(pipe, domain_handle):
+    pass
+
+def test_QueryDisplayInfo2(pipe, domain_handle):
+    pass
+    
+def test_QueryDisplayInfo3(pipe, domain_handle):
+    pass
+
+def test_GetDisplayEnumerationIndex(pipe, domain_handle):
+    pass
+
+def test_GetDisplayEnumerationIndex2(pipe, domain_handle):
+    pass
+
+def test_GroupList(pipe, domain_handle):
+    pass
+
+def test_TestPrivateFunctionsDomain(pipe, domain_handle):
+    pass
+
+def test_RidToSid(pipe, domain_handle):
+    pass
+
+def test_GetBootKeyInformation(pipe, domain_handle):
+    pass
+
+def test_DeleteUser(pipe, user_handle):
+    pass
+
+def test_DeleteAlias(pipe, alias_handle):
+    pass
+
+def test_DeleteDomainGroup(pipe, group_handle):
+    pass
+
+def test_Close(pipe, domain_handle):
+    pass
+
 def test_OpenDomain(pipe, handle, domain_sid):
 
     print 'testing samr_OpenDomain'
@@ -211,8 +342,48 @@
 
     test_CreateUser2(pipe, domain_handle)
 
-    test_CreateUser(pipe, domain_handle)
+    user_handle = test_CreateUser(pipe, domain_handle)
+
+    alias_handle = test_CreateAlias(pipe, domain_handle)
+
+    group_handle = test_CreateDomainGroup(pipe, domain_handle)
+
+    test_QueryDomainInfo(pipe, domain_handle)
     
+    test_QueryDomainInfo2(pipe, domain_handle)
+
+    test_EnumDomainUsers(pipe, domain_handle)
+
+    test_EnumDomainGroups(pipe, domain_handle)
+
+    test_EnumDomainAliases(pipe, domain_handle)
+
+    test_QueryDisplayInfo(pipe, domain_handle)
+
+    test_QueryDisplayInfo2(pipe, domain_handle)
+    
+    test_QueryDisplayInfo3(pipe, domain_handle)
+
+    test_GetDisplayEnumerationIndex(pipe, domain_handle)
+
+    test_GetDisplayEnumerationIndex2(pipe, domain_handle)
+
+    test_GroupList(pipe, domain_handle)
+
+    test_TestPrivateFunctionsDomain(pipe, domain_handle)
+
+    test_RidToSid(pipe, domain_handle)
+
+    test_GetBootKeyInformation(pipe, domain_handle)
+
+    test_DeleteUser(pipe, user_handle)
+
+    test_DeleteAlias(pipe, alias_handle)
+
+    test_DeleteDomainGroup(pipe, group_handle)
+
+    test_Close(pipe, domain_handle)
+    
 def test_LookupDomain(pipe, handle, domain):
 
     print 'testing samr_LookupDomain'



More information about the samba-cvs mailing list