From 8ade4d978506f6b2fab2ccd194f8b62d5d97d168 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Mon, 25 Oct 2004 13:06:31 +0000 Subject: r3217: Start of a spoolss_GetPrinter test. (This used to be commit 994fe92febe38f06d69f43b01c80e8350e902986) --- source4/scripting/swig/torture/spoolss.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'source4/scripting/swig/torture') diff --git a/source4/scripting/swig/torture/spoolss.py b/source4/scripting/swig/torture/spoolss.py index a18b9c61a7..240d815fb4 100644 --- a/source4/scripting/swig/torture/spoolss.py +++ b/source4/scripting/swig/torture/spoolss.py @@ -36,6 +36,30 @@ def test_ClosePrinter(pipe, handle): dcerpc.spoolss_ClosePrinter(pipe, r) +def test_GetPrinter(pipe, handle): + + r = {} + r['handle'] = handle + + for level in [1, 2, 3]: + + r['level'] = level + r['buffer'] = None + r['buf_size'] = 0 + + 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'] + + result = dcerpc.spoolss_GetPrinter(pipe, r) + + print result + + def test_EnumPrinters(pipe): print 'testing spoolss_EnumPrinters' @@ -71,6 +95,8 @@ def test_EnumPrinters(pipe): handle = test_OpenPrinterEx(pipe, printer) + test_GetPrinter(pipe, handle) + test_ClosePrinter(pipe, handle) -- cgit