4 from optparse import OptionParser
8 parser = OptionParser()
10 parser.add_option("-b", "--binding", action="store", type="string",
13 parser.add_option("-d", "--domain", action="store", type="string",
16 parser.add_option("-u", "--username", action="store", type="string",
19 parser.add_option("-p", "--password", action="store", type="string",
22 (options, args) = parser.parse_args()
24 if not options.binding:
25 parser.error('You must supply a binding string')
27 if not options.username or not options.password or not options.domain:
28 parser.error('You must supply a domain, username and password')
30 binding = options.binding
31 domain = options.domain
32 username = options.username
33 password = options.password
36 parser.error('You must supply the name of a module to test')
43 module = __import__('torture_%s' % test)
45 print 'No such module "%s"' % test
48 if not hasattr(module, 'runtests'):
49 print 'Module "%s" does not have a runtests function' % test
51 module.runtests(binding, (domain, username, password))