From d857e7b1a7a2cc1f7f4f9f2ffd5a11f8c627ae39 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 2 Nov 2014 09:44:05 -0800 Subject: ldap: Use samba.tests.subunitrun. Change-Id: I872654afb31a5eda8c88aac716f9ce79816e5f05 Signed-off-by: Jelmer Vernooij Reviewed-by: Andrew Bartlett --- source4/dsdb/tests/python/acl.py | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) (limited to 'source4/dsdb/tests/python') diff --git a/source4/dsdb/tests/python/acl.py b/source4/dsdb/tests/python/acl.py index 7ef9ad9e4e..4acc12349f 100755 --- a/source4/dsdb/tests/python/acl.py +++ b/source4/dsdb/tests/python/acl.py @@ -8,8 +8,8 @@ import base64 import re sys.path.insert(0, "bin/python") import samba -samba.ensure_external_module("testtools", "testtools") -samba.ensure_external_module("subunit", "subunit/python") + +from samba.tests.subunitrun import SubunitOptions, TestProgram import samba.getopt as options from samba.join import dc_join @@ -29,8 +29,6 @@ from samba.samdb import SamDB from samba.credentials import Credentials, DONT_USE_KERBEROS import samba.tests from samba.tests import delete_force -from subunit.run import SubunitTestRunner -import unittest import samba.dsdb parser = optparse.OptionParser("acl.py [options] ") @@ -41,6 +39,9 @@ parser.add_option_group(options.VersionOptions(parser)) # use command line creds if available credopts = options.CredentialsOptions(parser) parser.add_option_group(credopts) +subunitopts = SubunitOptions(parser) +parser.add_option_group(subunitopts) + opts, args = parser.parse_args() if len(args) < 1: @@ -1902,18 +1903,4 @@ class AclSPNTests(AclTests): ldb = SamDB(ldaphost, credentials=creds, session_info=system_session(lp), lp=lp) -runner = SubunitTestRunner() -suite = unittest.TestSuite() -suite.addTests(unittest.makeSuite(AclAddTests)) -suite.addTests(unittest.makeSuite(AclModifyTests)) -suite.addTests(unittest.makeSuite(AclDeleteTests)) -suite.addTests(unittest.makeSuite(AclRenameTests)) -suite.addTests(unittest.makeSuite(AclCARTests)) -suite.addTests(unittest.makeSuite(AclSearchTests)) -suite.addTests(unittest.makeSuite(AclExtendedTests)) -suite.addTests(unittest.makeSuite(AclSPNTests)) -if not runner.run(suite).wasSuccessful(): - rc = 1 -else: - rc = 0 -sys.exit(rc) +TestProgram(module=__name__, opts=subunitopts) -- cgit