summaryrefslogtreecommitdiffstats
path: root/source4/dsdb/tests/python
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2014-11-02 09:44:05 -0800
committerJelmer Vernooij <jelmer@samba.org>2014-11-22 02:23:10 +0100
commitd857e7b1a7a2cc1f7f4f9f2ffd5a11f8c627ae39 (patch)
treeaa1c45cf8a57024e8186a2f42e6d25495a9ced9c /source4/dsdb/tests/python
parentcfb5e9bbf2bde885c50097ab0a2914c674e65860 (diff)
downloadsamba-d857e7b1a7a2cc1f7f4f9f2ffd5a11f8c627ae39.tar.gz
samba-d857e7b1a7a2cc1f7f4f9f2ffd5a11f8c627ae39.tar.xz
samba-d857e7b1a7a2cc1f7f4f9f2ffd5a11f8c627ae39.zip
ldap: Use samba.tests.subunitrun.
Change-Id: I872654afb31a5eda8c88aac716f9ce79816e5f05 Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/dsdb/tests/python')
-rwxr-xr-xsource4/dsdb/tests/python/acl.py25
1 files changed, 6 insertions, 19 deletions
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] <host>")
@@ -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)