diff options
| author | Jelmer Vernooij <jelmer@samba.org> | 2014-11-02 08:23:36 -0800 |
|---|---|---|
| committer | Jelmer Vernooij <jelmer@samba.org> | 2014-11-22 02:23:10 +0100 |
| commit | 21280da0d6a4e3c547de8f486fe6ae84eea3f135 (patch) | |
| tree | c32807e4d784a211b067980f66b52da5f3992c07 /source4/dsdb/tests/python | |
| parent | ee281c61d01b5fb167571b8ace5e739758100db6 (diff) | |
| download | samba-21280da0d6a4e3c547de8f486fe6ae84eea3f135.tar.gz samba-21280da0d6a4e3c547de8f486fe6ae84eea3f135.tar.xz samba-21280da0d6a4e3c547de8f486fe6ae84eea3f135.zip | |
sec_descriptor test: Simplify, use samba.tests.subunitrun module.
Change-Id: I4ffda49cf3e209eaa28fc83f6fd9ded47f0ad7ee
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 | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/source4/dsdb/tests/python/sec_descriptor.py b/source4/dsdb/tests/python/sec_descriptor.py index 10d37187a5..39b5d4e569 100755 --- a/source4/dsdb/tests/python/sec_descriptor.py +++ b/source4/dsdb/tests/python/sec_descriptor.py @@ -142,12 +142,13 @@ showInAdvancedViewOnly: TRUE def setUp(self): super(DescriptorTests, self).setUp() - self.ldb_admin = ldb - self.base_dn = ldb.domain_dn() + self.ldb_admin = SamDB(host, credentials=creds, session_info=system_session(lp), lp=lp, + options=ldb_options) + self.base_dn = self.ldb_admin.domain_dn() self.configuration_dn = self.ldb_admin.get_config_basedn().get_linearized() self.schema_dn = self.ldb_admin.get_schema_basedn().get_linearized() self.domain_sid = security.dom_sid(self.ldb_admin.get_domain_sid()) - self.sd_utils = sd_utils.SDUtils(ldb) + self.sd_utils = sd_utils.SDUtils(self.ldb_admin) print "baseDN: %s" % self.base_dn ################################################################################################ @@ -2173,22 +2174,15 @@ if not "://" in host: if host.lower().startswith("ldap://"): ldb_options = ["modules:paged_searches"] -ldb = SamDB(host, - credentials=creds, - session_info=system_session(lp), - lp=lp, - options=ldb_options) - runner = SubunitTestRunner() -rc = 0 -if not runner.run(unittest.makeSuite(OwnerGroupDescriptorTests)).wasSuccessful(): - rc = 1 -if not runner.run(unittest.makeSuite(DaclDescriptorTests)).wasSuccessful(): - rc = 1 -if not runner.run(unittest.makeSuite(SdFlagsDescriptorTests)).wasSuccessful(): - rc = 1 -if not runner.run(unittest.makeSuite(RightsAttributesTests)).wasSuccessful(): - rc = 1 -if not runner.run(unittest.makeSuite(SdAutoInheritTests)).wasSuccessful(): +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) |
