summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2005-04-05 11:54:53 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:11:27 -0500
commit86122d78e5356c0bce7dc0f6599d0efb2d09ee7c (patch)
treed0c5f890483c208555c51ef26d25fa18eb048ac8
parentb796dc40771f082939e491180570e9697c03cf28 (diff)
downloadsamba-86122d78e5356c0bce7dc0f6599d0efb2d09ee7c.tar.gz
samba-86122d78e5356c0bce7dc0f6599d0efb2d09ee7c.tar.bz2
samba-86122d78e5356c0bce7dc0f6599d0efb2d09ee7c.zip
r6215: Add test for LookupNames. Fix CreateUser2 test.
(This used to be commit e3a69a73222ae3277c2d10d33c5c71b7a14da789)
-rwxr-xr-xsource4/scripting/swig/torture/torture_samr.py41
1 files changed, 9 insertions, 32 deletions
diff --git a/source4/scripting/swig/torture/torture_samr.py b/source4/scripting/swig/torture/torture_samr.py
index 2064d28044..ececbc9db6 100755
--- a/source4/scripting/swig/torture/torture_samr.py
+++ b/source4/scripting/swig/torture/torture_samr.py
@@ -49,7 +49,7 @@ def test_CreateUser2(pipe, domain_handle):
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,44 +57,21 @@ def test_LookupName(pipe, domain_handle, name):
print 'test samr_LookupNames'
- r = {}
- r['domain_handle'] = domain_handle
- r['num_names'] = 1
- r['names'] = []
- r['names'].append({'name': name})
-
- result = dcerpc.samr_LookupNames(pipe, r)
-
- rid = result['rids']['ids'][0]
-
- r['num_names'] = 2
- r['names'].append({'name': 'xxNONAMExx'})
-
+ domain_handle.LookupNames(['Administrator', '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
-
- dcerpc.samr_LookupNames(pipe, r)
-
- return rid
+ return domain_handle.LookupNames([name])
def test_OpenUser_byname(pipe, domain_handle, user_name):
- rid = test_LookupName(pipe, domain_handle, user_name)
-
- r = {}
- r['domain_handle'] = domain_handle
- r['access_mask'] = 0x02000000
- r['rid'] = rid
-
- result = dcerpc.samr_OpenUser(pipe, r)
+ rids, types = test_LookupName(pipe, domain_handle, user_name)
- return result['user_handle']
+ return domain_handle.OpenUser(rids[0])
def test_DeleteUser_byname(pipe, domain_handle, user_name):
@@ -218,7 +195,7 @@ def test_CreateUser(pipe, domain_handle):
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_CreateAlias(pipe, domain_handle, domain_sid):
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