summaryrefslogtreecommitdiffstats
path: root/source4/dsdb/tests/python
diff options
context:
space:
mode:
Diffstat (limited to 'source4/dsdb/tests/python')
-rwxr-xr-xsource4/dsdb/tests/python/urgent_replication.py17
1 files changed, 4 insertions, 13 deletions
diff --git a/source4/dsdb/tests/python/urgent_replication.py b/source4/dsdb/tests/python/urgent_replication.py
index 8083ce42a1..19176c18c8 100755
--- a/source4/dsdb/tests/python/urgent_replication.py
+++ b/source4/dsdb/tests/python/urgent_replication.py
@@ -5,8 +5,7 @@ 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
from ldb import (LdbError, ERR_NO_SUCH_OBJECT, Message,
MessageElement, Dn, FLAG_MOD_REPLACE)
@@ -14,10 +13,6 @@ import samba.tests
import samba.dsdb as dsdb
import samba.getopt as options
-from subunit.run import SubunitTestRunner
-
-import unittest
-
parser = optparse.OptionParser("urgent_replication.py [options] <host>")
sambaopts = options.SambaOptions(parser)
parser.add_option_group(sambaopts)
@@ -26,6 +21,8 @@ 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:
@@ -342,10 +339,4 @@ rIDAvailablePool: 133001-1073741823""", ["relax:0"])
self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"])
-runner = SubunitTestRunner()
-rc = 0
-#
-if not runner.run(unittest.makeSuite(UrgentReplicationTests)).wasSuccessful():
- rc = 1
-
-sys.exit(rc)
+TestProgram(module=__name__, opts=subunitopts)