summaryrefslogtreecommitdiff
path: root/source4/scripting/swig
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2004-10-28 03:40:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:04:51 -0500
commitfe54d8bc99f4ccfcaba2116430213161ebb6bf39 (patch)
tree7d32246f9e82f86029ef42211dc9f99c53116cec /source4/scripting/swig
parent4eda9e51b3759a40b1c39d36185b5db9b8b8017e (diff)
downloadsamba-fe54d8bc99f4ccfcaba2116430213161ebb6bf39.tar.gz
samba-fe54d8bc99f4ccfcaba2116430213161ebb6bf39.tar.bz2
samba-fe54d8bc99f4ccfcaba2116430213161ebb6bf39.zip
r3302: The security descriptors in spoolss_PrinterInfo2 and spoolss_PrinterInfo3
need to be marked as subcontext(0). GetPrinter tests now work for all info levels! (This used to be commit 53bd02960e17f7517e0d6c4f489d27b8bdcc7582)
Diffstat (limited to 'source4/scripting/swig')
-rw-r--r--source4/scripting/swig/torture/spoolss.py59
1 files changed, 53 insertions, 6 deletions
diff --git a/source4/scripting/swig/torture/spoolss.py b/source4/scripting/swig/torture/spoolss.py
index 240d815fb4..91e785ca75 100644
--- a/source4/scripting/swig/torture/spoolss.py
+++ b/source4/scripting/swig/torture/spoolss.py
@@ -6,7 +6,8 @@ def test_OpenPrinterEx(pipe, printer):
print 'testing spoolss_OpenPrinterEx(%s)' % printer
r = {}
- r['printername'] = '\\\\win2k3dc\\%s' % printer
+ r['printername'] = '\\\\%s\\%s' % \
+ (dcerpc.dcerpc_server_name(pipe), printer)
r['datatype'] = None
r['devmode_ctr'] = {}
r['devmode_ctr']['size'] = 0
@@ -41,7 +42,9 @@ def test_GetPrinter(pipe, handle):
r = {}
r['handle'] = handle
- for level in [1, 2, 3]:
+ for level in [0, 1, 2, 3, 4, 5, 6, 7]:
+
+ print 'test_GetPrinter(level = %d)' % level
r['level'] = level
r['buffer'] = None
@@ -49,8 +52,6 @@ def test_GetPrinter(pipe, handle):
result = dcerpc.spoolss_GetPrinter(pipe, r)
- print result
-
if result['result'] == dcerpc.WERR_INSUFFICIENT_BUFFER:
r['buffer'] = result['buf_size'] * '\x00'
r['buf_size'] = result['buf_size']
@@ -59,6 +60,47 @@ def test_GetPrinter(pipe, handle):
print result
+def test_EnumForms(pipe, handle):
+
+ print 'testing spoolss_EnumForms'
+
+ r = {}
+ r['handle'] = handle
+ r['level'] = 1
+ r['buffer'] = None
+ r['buf_size'] = 0
+
+ result = dcerpc.spoolss_EnumForms(pipe, r)
+
+ if result['result'] == dcerpc.WERR_INSUFFICIENT_BUFFER:
+ r['buffer'] = result['buf_size'] * '\x00'
+ r['buf_size'] = result['buf_size']
+
+ result = dcerpc.spoolss_EnumForms(pipe, r)
+
+ print result
+
+
+def test_EnumPorts(pipe, handle):
+
+ print 'testing spoolss_EnumPorts'
+
+ r = {}
+ r['handle'] = handle
+ r['level'] = 1
+ r['buffer'] = None
+ r['buf_size'] = 0
+
+ result = dcerpc.spoolss_EnumPorts(pipe, r)
+
+ if result['result'] == dcerpc.WERR_INSUFFICIENT_BUFFER:
+ r['buffer'] = result['buf_size'] * '\x00'
+ r['buf_size'] = result['buf_size']
+
+ result = dcerpc.spoolss_EnumPorts(pipe, r)
+
+ print result
+
def test_EnumPrinters(pipe):
@@ -70,7 +112,9 @@ def test_EnumPrinters(pipe):
r['flags'] = 0x02
r['server'] = None
- for level in [1, 2, 4, 5]:
+ for level in [0, 1, 4, 5]:
+
+ print 'test_EnumPrinters(level = %d)' % level
r['level'] = level
r['buf_size'] = 0
@@ -87,7 +131,10 @@ def test_EnumPrinters(pipe):
printers = dcerpc.unmarshall_spoolss_PrinterInfo_array(
result['buffer'], r['level'], result['count'])
- if printer_names is None:
+ from pprint import pprint
+ pprint(printers)
+
+ if level == 1:
printer_names = map(
lambda x: string.split(x['info1']['name'], ',')[0], printers)