diff options
| author | Jelmer Vernooij <jelmer@samba.org> | 2014-11-02 08:57:37 -0800 |
|---|---|---|
| committer | Jelmer Vernooij <jelmer@samba.org> | 2014-11-22 02:23:10 +0100 |
| commit | 0c82bdda0fddab4aa6bdbbbe13b6f888ed1c2c67 (patch) | |
| tree | 3421f3ec4b9066191f5a6a053fbd4ebee1c3459f /source4/dsdb/tests/python | |
| parent | fc0b8aac9d5f1f77aa9a412fa5da2cc6b1a984ae (diff) | |
| download | samba-0c82bdda0fddab4aa6bdbbbe13b6f888ed1c2c67.tar.gz samba-0c82bdda0fddab4aa6bdbbbe13b6f888ed1c2c67.tar.xz samba-0c82bdda0fddab4aa6bdbbbe13b6f888ed1c2c67.zip | |
sec_descriptor: Use samba.tests.subunitrun.
Change-Id: I5caba3e27ad21cc5381883a823e0ec5e2966a264
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/sec_descriptor.py | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/source4/dsdb/tests/python/sec_descriptor.py b/source4/dsdb/tests/python/sec_descriptor.py index 39b5d4e569..321d1288cc 100755 --- a/source4/dsdb/tests/python/sec_descriptor.py +++ b/source4/dsdb/tests/python/sec_descriptor.py @@ -10,8 +10,8 @@ import random 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 @@ -29,10 +29,8 @@ from samba.auth import system_session from samba.dsdb import DS_DOMAIN_FUNCTION_2008 from samba.dcerpc.security import ( SECINFO_OWNER, SECINFO_GROUP, SECINFO_DACL, SECINFO_SACL) -from subunit.run import SubunitTestRunner import samba.tests from samba.tests import delete_force -import unittest parser = optparse.OptionParser("sec_descriptor.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: @@ -2174,15 +2175,4 @@ if not "://" in host: if host.lower().startswith("ldap://"): ldb_options = ["modules:paged_searches"] -runner = SubunitTestRunner() -suite = unittest.TestSuite() -suite.addTests(unittest.makeSuite(OwnerGroupDescriptorTests)) -suite.addTests(unittest.makeSuite(DaclDescriptorTests)) -suite.addTests(unittest.makeSuite(SdFlagsDescriptorTests)) -suite.addTests(unittest.makeSuite(RightsAttributesTests)) -suite.addTests(unittest.makeSuite(SdAutoInheritTests)) -if not runner.run(suite).wasSuccessful(): - rc = 1 -else: - rc = 0 -sys.exit(rc) +TestProgram(module=__name__, opts=subunitopts) |
