summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2014-11-02 08:23:36 -0800
committerJelmer Vernooij <jelmer@samba.org>2014-11-22 02:23:10 +0100
commit21280da0d6a4e3c547de8f486fe6ae84eea3f135 (patch)
treec32807e4d784a211b067980f66b52da5f3992c07
parentee281c61d01b5fb167571b8ace5e739758100db6 (diff)
downloadsamba-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>
-rwxr-xr-x[-rw-r--r--]python/samba/tests/subunitrun.py0
-rwxr-xr-xsource4/dsdb/tests/python/sec_descriptor.py32
-rwxr-xr-xsource4/selftest/tests.py2
3 files changed, 14 insertions, 20 deletions
diff --git a/python/samba/tests/subunitrun.py b/python/samba/tests/subunitrun.py
index d45467607e..d45467607e 100644..100755
--- a/python/samba/tests/subunitrun.py
+++ b/python/samba/tests/subunitrun.py
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)
diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py
index 9feb9ad99b..ef8e957e79 100755
--- a/source4/selftest/tests.py
+++ b/source4/selftest/tests.py
@@ -473,7 +473,7 @@ plantestsuite("samba4.urgent_replication.python(dc)", "dc:local", [python, os.pa
plantestsuite_loadlist("samba4.ldap.dirsync.python(dc)", "dc", [python, os.path.join(samba4srcdir, "dsdb/tests/python/dirsync.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
plantestsuite("samba4.ldap.sites.python(dc)", "dc", [python, os.path.join(samba4srcdir, "dsdb/tests/python/sites.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
for env in ["dc", "fl2000dc", "fl2003dc", "fl2008r2dc"]:
- plantestsuite("samba4.ldap_schema.python(%s)" % env, env, [python, os.path.join(samba4srcdir, "dsdb/tests/python/ldap_schema.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
+ plantestsuite_loadlist("samba4.ldap_schema.python(%s)" % env, env, [python, os.path.join(samba4srcdir, "dsdb/tests/python/ldap_schema.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
plantestsuite("samba4.ldap.possibleInferiors.python(%s)" % env, env, [python, os.path.join(samba4srcdir, "dsdb/samdb/ldb_modules/tests/possibleinferiors.py"), "ldap://$SERVER", '-U"$USERNAME%$PASSWORD"', "-W$DOMAIN"])
plantestsuite("samba4.ldap.secdesc.python(%s)" % env, env, [python, os.path.join(samba4srcdir, "dsdb/tests/python/sec_descriptor.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
plantestsuite("samba4.ldap.acl.python(%s)" % env, env, [python, os.path.join(samba4srcdir, "dsdb/tests/python/acl.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])