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

tpot at samba.org tpot at samba.org
Tue Apr 5 11:54:53 GMT 2005


Author: tpot
Date: 2005-04-05 11:54:53 +0000 (Tue, 05 Apr 2005)
New Revision: 6215

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=6215

Log:
Add test for LookupNames.  Fix CreateUser2 test.

Modified:
   branches/SAMBA_4_0/source/scripting/swig/torture/torture_samr.py


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/torture/torture_samr.py
===================================================================
--- branches/SAMBA_4_0/source/scripting/swig/torture/torture_samr.py	2005-04-05 11:50:47 UTC (rev 6214)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/torture_samr.py	2005-04-05 11:54:53 UTC (rev 6215)
@@ -49,7 +49,7 @@
         return domain_handle.CreateUser2(username, 0x0080) # WSTRUST
     except dcerpc.NTSTATUS, arg:
         if arg[0] == 0x0c0000063L:
-            domain_handle.OpenUser(username).DeleteUser()
+            test_OpenUser_byname(pipe, domain_handle, username).DeleteUser()
             return domain_handle.CreateUser2(username)
         raise
 
@@ -57,45 +57,22 @@
 
     print 'test samr_LookupNames'
 
-    r = {}
-    r['domain_handle'] = domain_handle
-    r['num_names'] = 1
-    r['names'] = []
-    r['names'].append({'name': name})
+    domain_handle.LookupNames(['Administrator', 'xxNONAMExx'])
 
-    result = dcerpc.samr_LookupNames(pipe, r)
-
-    rid = result['rids']['ids'][0]
-
-    r['num_names'] = 2
-    r['names'].append({'name': 'xxNONAMExx'})
-
-
     try:
-        dcerpc.samr_LookupNames(pipe, r)
+        domain_handle.LookupNames(['xxNONAMExx'])
     except dcerpc.NTSTATUS, arg:
-        if arg[0] != dcerpc.STATUS_SOME_UNMAPPED:
+        if arg[0] != 0xc0000073L:
             raise dcerpc.NTSTATUS(arg)
 
-    r['num_names'] = 0
+    return domain_handle.LookupNames([name])
 
-    dcerpc.samr_LookupNames(pipe, r)
-
-    return rid
-
 def test_OpenUser_byname(pipe, domain_handle, user_name):
 
-    rid = test_LookupName(pipe, domain_handle, user_name)
+    rids, types = test_LookupName(pipe, domain_handle, user_name)
 
-    r = {}
-    r['domain_handle'] = domain_handle
-    r['access_mask'] = 0x02000000
-    r['rid'] = rid
+    return domain_handle.OpenUser(rids[0])
 
-    result = dcerpc.samr_OpenUser(pipe, r)
-
-    return result['user_handle']
-
 def test_DeleteUser_byname(pipe, domain_handle, user_name):
 
     user_handle = test_OpenUser_byname(pipe, domain_handle, user_name)
@@ -218,7 +195,7 @@
 
 def test_DeleteAlias_byname(pipe, domain_handle, alias_name):
 
-    rid = test_LookupName(pipe, domain_handle, alias_name)
+    rid = test_LookupNames(pipe, domain_handle, alias_name)
 
     r = {}
     r['domain_handle'] = domain_handle
@@ -339,7 +316,7 @@
 
 def test_DeleteGroup_byname(pipe, domain_handle, group_name):
     
-    rid = test_LookupName(pipe, domain_handle, group_name)
+    rid = test_LookupNames(pipe, domain_handle, group_name)
 
     r = {}
     r['domain_handle'] = domain_handle



More information about the samba-cvs mailing list