summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2004-10-03 11:07:04 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:36 -0500
commit263212aba5d05367cc9ff92daf6b1047ea699ac3 (patch)
treef3b03d482c5ea644b3ba3cea33540e72dc0c5c07 /source4/scripting
parent9880410f1ffb4c7d58f4c4059fb132b98d3520b5 (diff)
downloadsamba-263212aba5d05367cc9ff92daf6b1047ea699ac3.tar.gz
samba-263212aba5d05367cc9ff92daf6b1047ea699ac3.tar.bz2
samba-263212aba5d05367cc9ff92daf6b1047ea699ac3.zip
r2807: OK I think winreg_EnumValue() finally works. The previous version
didn't work with non-NULL registry value names. Update testsuite to enumerate all keys and values two levels deep. (This used to be commit c09f0f355ba6a589121588492aa2db5deb7121e0)
Diffstat (limited to 'source4/scripting')
-rwxr-xr-xsource4/scripting/swig/torture/winreg.py60
1 files changed, 25 insertions, 35 deletions
diff --git a/source4/scripting/swig/torture/winreg.py b/source4/scripting/swig/torture/winreg.py
index acf319d6f9..b7a42042a8 100755
--- a/source4/scripting/swig/torture/winreg.py
+++ b/source4/scripting/swig/torture/winreg.py
@@ -30,12 +30,16 @@ def test_CloseKey(pipe, handle):
dcerpc.winreg_CloseKey(pipe, r)
-def test_Enum(pipe, handle, depth = 0):
+def test_Enum(pipe, handle, name, depth = 0):
if depth > 2:
return
- keyinfo = test_QueryInfoKey(pipe, handle)
+ try:
+ keyinfo = test_QueryInfoKey(pipe, handle)
+ except dcerpc.WERROR, arg:
+ if arg[0] == dcerpc.WERR_ACCESS_DENIED:
+ return
# Enumerate keys
@@ -68,7 +72,8 @@ def test_Enum(pipe, handle, depth = 0):
result = dcerpc.winreg_OpenKey(pipe, s)
- test_Enum(pipe, result['handle'], depth + 1)
+ test_Enum(pipe, result['handle'], name + '/' + s['keyname']['name'],
+ depth + 1)
test_CloseKey(pipe, result['handle'])
@@ -77,44 +82,30 @@ def test_Enum(pipe, handle, depth = 0):
r = {}
r['handle'] = handle
- keyinfo['max_valnamelen'] = 18
- keyinfo['max_valbufsize'] = 0x31f5
-
- r['foo'] = {}
- r['foo']['len'] = 0
- r['foo']['max_len'] = keyinfo['max_valnamelen'] * 2
- r['foo']['buffer'] = {}
- r['foo']['buffer']['max_len'] = keyinfo['max_valnamelen']
- r['foo']['buffer']['offset'] = 0
- r['foo']['buffer']['len'] = 0
- r['foo']['buffer']['buffer'] = ''
+ r['name_in'] = {}
+ r['name_in']['len'] = 0
+ r['name_in']['max_len'] = (keyinfo['max_valnamelen'] + 1) * 2
+ r['name_in']['buffer'] = {}
+ r['name_in']['buffer']['max_len'] = keyinfo['max_valnamelen'] + 1
+ r['name_in']['buffer']['offset'] = 0
+ r['name_in']['buffer']['len'] = 0
r['type'] = 0
- r['value'] = {}
- r['value']['max_len'] = keyinfo['max_valbufsize']
- r['value']['offset'] = 0
- r['value']['len'] = 0
- r['value']['buffer'] = []
- r['returned_len'] = 0
- r['foo2'] = {}
- r['foo2']['max_len'] = keyinfo['max_valbufsize']
- r['foo2']['offset'] = 0
- r['foo2']['len'] = 0
- r['foo2']['buffer'] = ''
- r['value1'] = keyinfo['max_valbufsize']
- r['value2'] = 0
+ r['value_in'] = {}
+ r['value_in']['max_len'] = keyinfo['max_valbufsize']
+ r['value_in']['offset'] = 0
+ r['value_in']['len'] = 0
+ r['value_len1'] = keyinfo['max_valbufsize']
+ r['value_len2'] = 0
for i in range(0, keyinfo['num_values']):
r['enum_index'] = i
- print keyinfo
- print dcerpc.winreg_EnumValue(pipe, r)
+ dcerpc.winreg_EnumValue(pipe, r)
- sys.exit(1)
+def test_Key(pipe, handle, name):
-def test_Key(pipe, handle):
-
- test_Enum(pipe, handle)
+ test_Enum(pipe, handle, name)
def runtests(binding, domain, username, password):
@@ -126,5 +117,4 @@ def runtests(binding, domain, username, password):
handle = test_OpenHKLM(pipe)
- test_Key(pipe, handle)
-
+ test_Key(pipe, handle, 'HKLM')