svn commit: samba r3405 - in
branches/SAMBA_4_0/source/scripting/swig/torture: .
tpot at samba.org
tpot at samba.org
Sun Oct 31 05:45:52 GMT 2004
Author: tpot
Date: 2004-10-31 05:45:52 +0000 (Sun, 31 Oct 2004)
New Revision: 3405
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3405
Log:
Test EnumPrinterData and GetPrinterData.
Modified:
branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py
Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py
===================================================================
--- branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-10-31 05:45:05 UTC (rev 3404)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-10-31 05:45:52 UTC (rev 3405)
@@ -9,7 +9,8 @@
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 @@
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 @@
test_EnumForms(pipe, handle)
test_AddForm(pipe, handle)
test_EnumJobs(pipe, handle)
+ test_EnumPrinterData(pipe, handle)
test_ClosePrinter(pipe, handle)
@@ -283,6 +328,8 @@
handle = test_OpenPrinterEx(pipe, None)
+ # EnumForms and AddForm tests return WERR_BADFID here (??)
+
test_ClosePrinter(pipe, handle)
More information about the samba-cvs
mailing list