summaryrefslogtreecommitdiffstats
path: root/source4/dsdb/tests/python
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2014-11-02 08:37:08 -0800
committerJelmer Vernooij <jelmer@samba.org>2014-11-22 02:23:10 +0100
commit330597507c796db55a48b084c7542f03ee4a93ee (patch)
treee9512308c51f412cae2716e5ea356efd3193eaa4 /source4/dsdb/tests/python
parentd6545fe27b35e63781f9f87fe9262bb933ffa9be (diff)
downloadsamba-330597507c796db55a48b084c7542f03ee4a93ee.tar.gz
samba-330597507c796db55a48b084c7542f03ee4a93ee.tar.xz
samba-330597507c796db55a48b084c7542f03ee4a93ee.zip
sites: Use samba.tests.subunitrun.
Change-Id: Ic06e1a0f7174683b6b817a5412b8635145329c00 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/sites.py17
1 files changed, 6 insertions, 11 deletions
diff --git a/source4/dsdb/tests/python/sites.py b/source4/dsdb/tests/python/sites.py
index 8b984b2fe8..402d676ae1 100755
--- a/source4/dsdb/tests/python/sites.py
+++ b/source4/dsdb/tests/python/sites.py
@@ -22,8 +22,8 @@ import optparse
import sys
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 TestProgram, SubunitOptions
import samba.getopt as options
from samba import sites
@@ -31,8 +31,6 @@ from samba.auth import system_session
from samba.samdb import SamDB
import samba.tests
from samba.dcerpc import security
-from subunit.run import SubunitTestRunner
-import unittest
parser = optparse.OptionParser("dirsync.py [options] <host>")
sambaopts = options.SambaOptions(parser)
@@ -42,6 +40,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:
@@ -116,10 +117,4 @@ class SimpleSitesTests(SitesBaseTests):
ldb = SamDB(ldapshost, credentials=creds, session_info=system_session(lp), lp=lp)
-runner = SubunitTestRunner()
-rc = 0
-
-if not runner.run(unittest.makeSuite(SimpleSitesTests)).wasSuccessful():
- rc = 1
-
-sys.exit(rc)
+TestProgram(module=__name__, opts=subunitopts)