summaryrefslogtreecommitdiff
path: root/source4/scripting/swig/torture
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2004-11-03 06:29:22 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:22 -0500
commit90a8c4acc7e673e6439197776d19cc4b095ac322 (patch)
tree526b6ce20d26c78c384bff99caa4d6c48f05c208 /source4/scripting/swig/torture
parente3e5ef95addf3ca6b99166323adee4eada18d213 (diff)
downloadsamba-90a8c4acc7e673e6439197776d19cc4b095ac322.tar.gz
samba-90a8c4acc7e673e6439197776d19cc4b095ac322.tar.bz2
samba-90a8c4acc7e673e6439197776d19cc4b095ac322.zip
r3506: Test EnumPorts function.
(This used to be commit 354068aae16b7e0c13416cfcdf9bdef5138dccc0)
Diffstat (limited to 'source4/scripting/swig/torture')
-rw-r--r--source4/scripting/swig/torture/spoolss.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/source4/scripting/swig/torture/spoolss.py b/source4/scripting/swig/torture/spoolss.py
index a4fdbbb107..35a0a6039f 100644
--- a/source4/scripting/swig/torture/spoolss.py
+++ b/source4/scripting/swig/torture/spoolss.py
@@ -104,13 +104,20 @@ def test_EnumPorts(pipe, handle):
print 'spoolss_EnumPorts()'
- r = {}
- r['handle'] = handle
- r['level'] = 1
- r['buffer'] = None
- r['buf_size'] = 0
+ for level in [1, 2]:
+
+ r = {}
+ r['handle'] = handle
+ r['servername'] = None
+ r['level'] = level
+
+ result = ResizeBufferCall(dcerpc.spoolss_EnumPorts, pipe, r)
+
+ ports = dcerpc.unmarshall_spoolss_PortInfo_array(
+ result['buffer'], r['level'], result['count'])
- result = ResizeBufferCall(dcerpc.spoolss_EnumPorts, pipe, r)
+ if level == 1:
+ port_names = map(lambda x: x['info1']['port_name'], ports)
def test_DeleteForm(pipe, handle, formname):
@@ -377,6 +384,7 @@ def test_EnumPrinters(pipe):
handle = test_OpenPrinterEx(pipe, printername)
test_GetPrinter(pipe, handle)
+ test_EnumPorts(pipe, handle)
test_EnumForms(pipe, handle)
test_AddForm(pipe, handle)
test_EnumJobs(pipe, handle)