diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2014-11-02 08:37:08 -0800 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2014-11-22 02:23:10 +0100 |
commit | 330597507c796db55a48b084c7542f03ee4a93ee (patch) | |
tree | e9512308c51f412cae2716e5ea356efd3193eaa4 /source4/dsdb/tests/python | |
parent | d6545fe27b35e63781f9f87fe9262bb933ffa9be (diff) | |
download | samba-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-x | source4/dsdb/tests/python/sites.py | 17 |
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) |