summaryrefslogtreecommitdiff
path: root/source4/scripting/swig/torture
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2004-10-31 05:45:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:06 -0500
commit5d7c6d7bbdbf9e796fa4d21aa47f177b6c81367e (patch)
treec1824885513bc428eaa0640cd7a424a614446e1f /source4/scripting/swig/torture
parent3d2dd91d4dcf93392e14e9b55faa712edf5aa366 (diff)
downloadsamba-5d7c6d7bbdbf9e796fa4d21aa47f177b6c81367e.tar.gz
samba-5d7c6d7bbdbf9e796fa4d21aa47f177b6c81367e.tar.bz2
samba-5d7c6d7bbdbf9e796fa4d21aa47f177b6c81367e.zip
r3405: Test EnumPrinterData and GetPrinterData.
(This used to be commit a4facee8602cfb9b2599e0068dd42933ed94655e)
Diffstat (limited to 'source4/scripting/swig/torture')
-rw-r--r--source4/scripting/swig/torture/spoolss.py49
1 files changed, 48 insertions, 1 deletions
diff --git a/source4/scripting/swig/torture/spoolss.py b/source4/scripting/swig/torture/spoolss.py
index 1b19bd8f1a..4779c278f2 100644
--- a/source4/scripting/swig/torture/spoolss.py
+++ b/source4/scripting/swig/torture/spoolss.py
@@ -9,7 +9,8 @@ def ResizeBufferCall(fn, pipe, r):
result = fn(pipe, r)
- if result['result'] == dcerpc.WERR_INSUFFICIENT_BUFFER:
+ if result['result'] == dcerpc.WERR_INSUFFICIENT_BUFFER or \
+ result['result'] == dcerpc.WERR_MORE_DATA:
r['buffer'] = result['buf_size'] * '\x00'
r['buf_size'] = result['buf_size']
@@ -226,6 +227,49 @@ def test_EnumJobs(pipe, handle):
sys.exit(1)
+ # TODO: AddJob, DeleteJob, ScheduleJob
+
+
+def test_EnumPrinterData(pipe, handle):
+
+ print 'test_EnumPrinterData'
+
+ enum_index = 0
+
+ while 1:
+
+ r = {}
+ r['handle'] = handle
+ r['enum_index'] = enum_index
+
+ r['value_offered'] = 0
+ r['data_size'] = 0
+
+ result = dcerpc.spoolss_EnumPrinterData(pipe, r)
+
+ r['value_offered'] = result['value_needed']
+ r['data_size'] = result['data_size']
+
+ result = dcerpc.spoolss_EnumPrinterData(pipe, r)
+
+ if result['result'] == dcerpc.WERR_NO_MORE_ITEMS:
+ break
+
+ s = {}
+ s['handle'] = handle
+ s['value_name'] = result['value_name']
+
+ result2 = ResizeBufferCall(dcerpc.spoolss_GetPrinterData, pipe, s)
+
+ if result['buffer'][:result2['buf_size']] != result2['buffer']:
+ print 'EnumPrinterData/GetPrinterData mismatch'
+ sys.exit(1)
+
+ enum_index += 1
+
+ sys.exit(1)
+
+
def test_EnumPrinters(pipe):
print 'testing spoolss_EnumPrinters'
@@ -276,6 +320,7 @@ def test_EnumPrinters(pipe):
test_EnumForms(pipe, handle)
test_AddForm(pipe, handle)
test_EnumJobs(pipe, handle)
+ test_EnumPrinterData(pipe, handle)
test_ClosePrinter(pipe, handle)
@@ -283,6 +328,8 @@ def test_PrintServer(pipe):
handle = test_OpenPrinterEx(pipe, None)
+ # EnumForms and AddForm tests return WERR_BADFID here (??)
+
test_ClosePrinter(pipe, handle)