summaryrefslogtreecommitdiffstats
path: root/source4/dsdb/tests/python/ldap.py
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2014-11-01 21:31:18 -0700
committerJelmer Vernooij <jelmer@samba.org>2014-11-24 10:46:05 +0100
commit4f75f17ba7c9b80cf3aa0ce2db57e1754464403a (patch)
tree5270ee674966ceeb61ba384ffe7e6395b248dc67 /source4/dsdb/tests/python/ldap.py
parent98b5380af65ea1ec760d00187355384de0757b04 (diff)
downloadsamba-4f75f17ba7c9b80cf3aa0ce2db57e1754464403a.tar.gz
samba-4f75f17ba7c9b80cf3aa0ce2db57e1754464403a.tar.xz
samba-4f75f17ba7c9b80cf3aa0ce2db57e1754464403a.zip
Use samba.tests.subunitrun in dsdb ldap and ldap_schema tests.
Change-Id: I51ddc55720a23013a2c6ae20e3225f027348083c Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/dsdb/tests/python/ldap.py')
-rwxr-xr-xsource4/dsdb/tests/python/ldap.py34
1 files changed, 19 insertions, 15 deletions
diff --git a/source4/dsdb/tests/python/ldap.py b/source4/dsdb/tests/python/ldap.py
index b1f0d6a94f..7139f3c814 100755
--- a/source4/dsdb/tests/python/ldap.py
+++ b/source4/dsdb/tests/python/ldap.py
@@ -2,6 +2,21 @@
# -*- coding: utf-8 -*-
# This is a port of the original in testprogs/ejs/ldap.js
+# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2008-2011
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
import optparse
import sys
import time
@@ -10,9 +25,7 @@ import os
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.auth import system_session
@@ -35,9 +48,6 @@ from samba.dsdb import (UF_NORMAL_ACCOUNT,
SYSTEM_FLAG_CONFIG_ALLOW_RENAME, SYSTEM_FLAG_CONFIG_ALLOW_MOVE,
SYSTEM_FLAG_CONFIG_ALLOW_LIMITED_MOVE)
-from subunit.run import SubunitTestRunner
-import unittest
-
from samba.ndr import ndr_pack, ndr_unpack
from samba.dcerpc import security, lsa
from samba.tests import delete_force
@@ -49,6 +59,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:
@@ -2974,12 +2986,4 @@ if not "tdb://" in host:
else:
gc_ldb = None
-runner = SubunitTestRunner()
-suite = unittest.TestSuite()
-suite.addTests(unittest.makeSuite(BaseDnTests))
-suite.addTests(unittest.makeSuite(BasicTests))
-if not runner.run(suite).wasSuccessful():
- rc = 1
-else:
- rc = 0
-sys.exit(rc)
+TestProgram(module=__name__, opts=subunitopts)