From 98b5380af65ea1ec760d00187355384de0757b04 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 1 Nov 2014 21:22:59 -0700 Subject: Use samba.tests.subunitrun in urgent replication test. Change-Id: I3e7a32876d557ac376326ab75e851298e874d584 Signed-off-by: Jelmer Vernooij Reviewed-by: Andrew Bartlett --- source4/dsdb/tests/python/urgent_replication.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'source4/dsdb/tests/python') 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] ") 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) -- cgit