From e3627c2c6eaf8b0ede0b014aacb3478d25faf1b8 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Thu, 14 Oct 2004 07:25:47 +0000 Subject: r2965: Ignore *.pyc files in torture directory. Allow test module name to be specified on command line for pytorture module. Start spoolss torture test. (This used to be commit 44bab84f765f6a4d37733a353fc6b74b09c1b39a) --- source4/scripting/swig/torture/pytorture | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'source4/scripting/swig/torture/pytorture') diff --git a/source4/scripting/swig/torture/pytorture b/source4/scripting/swig/torture/pytorture index 89ecfbabcf..8a8f4d8bdf 100755 --- a/source4/scripting/swig/torture/pytorture +++ b/source4/scripting/swig/torture/pytorture @@ -1,5 +1,6 @@ #!/usr/bin/python +import sys from optparse import OptionParser # Parse command line @@ -31,7 +32,20 @@ domain = options.domain 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) -- cgit