Author: tpot Date: 2004-10-14 07:25:47 +0000 (Thu, 14 Oct 2004) New Revision: 2965
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/scripting/swig/torture&rev=2965&nolog=1 Log: Ignore *.pyc files in torture directory. Allow test module name to be specified on command line for pytorture module. Start spoolss torture test. Added: branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py Modified: branches/SAMBA_4_0/source/scripting/swig/torture/ branches/SAMBA_4_0/source/scripting/swig/torture/pytorture Changeset: Property changes on: branches/SAMBA_4_0/source/scripting/swig/torture ___________________________________________________________________ Name: svn:ignore + *.pyc Modified: branches/SAMBA_4_0/source/scripting/swig/torture/pytorture =================================================================== --- branches/SAMBA_4_0/source/scripting/swig/torture/pytorture 2004-10-14 06:45:25 UTC (rev 2964) +++ branches/SAMBA_4_0/source/scripting/swig/torture/pytorture 2004-10-14 07:25:47 UTC (rev 2965) @@ -1,5 +1,6 @@ #!/usr/bin/python +import sys from optparse import OptionParser # Parse command line @@ -31,7 +32,20 @@ username = options.username password = options.password -# Run tests +if len(args) == 0: + parser.error('You must supply the name of a module to test') -import samr -samr.runtests(binding, domain, username, password) +# Import and test + +for test in args: + + try: + module = __import__(test) + except ImportError: + print 'No such module "%s"' % test + sys.exit(1) + + if not hasattr(module, 'runtests'): + print 'Module "%s" does not have a runtests function' % test + + module.runtests(binding, domain, username, password) Added: branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py =================================================================== --- branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-10-14 06:45:25 UTC (rev 2964) +++ branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py 2004-10-14 07:25:47 UTC (rev 2965) @@ -0,0 +1,24 @@ +import dcerpc + +def test_EnumPrinters(pipe): + + r = {} + r['flags'] = 0x02 + r['server'] = None + r['level'] = 1 + r['buffer'] = 392 * '\x00' + r['buf_size'] = 392 + + result = dcerpc.spoolss_EnumPrinters(pipe, r) + + print result + +def runtests(binding, domain, username, password): + + print 'Testing SPOOLSS pipe' + + pipe = dcerpc.pipe_connect(binding, + dcerpc.DCERPC_SPOOLSS_UUID, dcerpc.DCERPC_SPOOLSS_VERSION, + domain, username, password) + + test_EnumPrinters(pipe)