diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-05-29 17:31:16 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-05-29 17:31:16 +0200 |
commit | e16f0e15b40229e7a42311dddfb391cf6142462e (patch) | |
tree | b796f5a1271f9c7dc84fd3e52508b9b46545bcea /source4/scripting | |
parent | 90aeca8ebdd74250038a11d4c523c01072711092 (diff) | |
download | samba-e16f0e15b40229e7a42311dddfb391cf6142462e.tar.gz samba-e16f0e15b40229e7a42311dddfb391cf6142462e.tar.xz samba-e16f0e15b40229e7a42311dddfb391cf6142462e.zip |
Update after changes to the provision API, make sure temp dir gets cleaned
up.
(This used to be commit 064e9ddb3786bd7df8785b39754b1e6674496b66)
Diffstat (limited to 'source4/scripting')
-rw-r--r-- | source4/scripting/python/samba/tests/samdb.py | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/source4/scripting/python/samba/tests/samdb.py b/source4/scripting/python/samba/tests/samdb.py index 0d4f7bde0e..a022d7bb51 100644 --- a/source4/scripting/python/samba/tests/samdb.py +++ b/source4/scripting/python/samba/tests/samdb.py @@ -16,13 +16,13 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # -from auth import system_session -from credentials import Credentials +from samba.auth import system_session +from samba.credentials import Credentials import os -from samba.provision import setup_samdb +from samba.provision import setup_samdb, guess_names from samba.samdb import SamDB from samba.tests import cmdline_loadparm, TestCaseInTempDir -import security +from samba import security from unittest import TestCase import uuid @@ -42,14 +42,23 @@ class SamDBTestCase(TestCaseInTempDir): domainsid = security.random_sid() hostguid = str(uuid.uuid4()) path = os.path.join(self.tempdir, "samdb.ldb") + names = guess_names(lp=cmdline_loadparm, hostname="foo", + domain="EXAMPLE.COM", dnsdomain="example.com", + serverrole="domain controller", + domaindn=self.domaindn, configdn=configdn, + schemadn=schemadn) self.samdb = setup_samdb(path, setup_path, system_session(), creds, - cmdline_loadparm, schemadn, configdn, - self.domaindn, "example.com", "EXAMPLE.COM", - "FOO", lambda x: None, "foo", domaindn, - False, domainsid, "# no aci", domainguid, - policyguid, "EXAMPLE", True, "secret", - "secret", "secret", hostguid, invocationid, + cmdline_loadparm, names, + lambda x: None, domainsid, + "# no aci", domainguid, + policyguid, False, "secret", + "secret", "secret", invocationid, "secret", "domain controller") + def tearDown(self): + for f in ['templates.ldb', 'schema.ldb', 'configuration.ldb', + 'users.ldb', 'samdb.ldb']: + os.remove(os.path.join(self.tempdir, f)) + super(SamDBTestCase, self).tearDown() def test_add_foreign(self): self.samdb.add_foreign(self.domaindn, "S-1-5-7", "Somedescription") |