diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-01-25 01:37:47 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-01-25 01:37:47 +0100 |
commit | c91791bbc489d90eca5f6b8d6dc369d7e2129c29 (patch) | |
tree | ce305e7f812948b0a1f5b237e7944626d0aa8771 /source4/scripting/python | |
parent | 76eb7ddd75719eb516a0dc10a88e23fd6463a718 (diff) | |
download | samba-c91791bbc489d90eca5f6b8d6dc369d7e2129c29.tar.gz samba-c91791bbc489d90eca5f6b8d6dc369d7e2129c29.tar.xz samba-c91791bbc489d90eca5f6b8d6dc369d7e2129c29.zip |
python: Add test for secretsdb_become_dc
(This used to be commit 9173c678efb6f74dbec64298bcb00952feff2ed7)
Diffstat (limited to 'source4/scripting/python')
-rw-r--r-- | source4/scripting/python/samba/tests/provision.py | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/source4/scripting/python/samba/tests/provision.py b/source4/scripting/python/samba/tests/provision.py index f5a0339c1f5..83952df9fe7 100644 --- a/source4/scripting/python/samba/tests/provision.py +++ b/source4/scripting/python/samba/tests/provision.py @@ -1,7 +1,7 @@ #!/usr/bin/python # Unix SMB/CIFS implementation. -# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007 +# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007-2008 # # 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 @@ -18,7 +18,7 @@ # import os -from samba.provision import setup_secretsdb +from samba.provision import setup_secretsdb, secretsdb_become_dc import samba.tests from ldb import Dn @@ -37,7 +37,22 @@ class ProvisionTestCase(samba.tests.TestCaseInTempDir): finally: del ldb os.unlink(path) - + + def test_become_dc(self): + path = os.path.join(self.tempdir, "secrets.ldb") + secrets_ldb = setup_secretsdb(path, setup_path, None, None, None) + try: + secretsdb_become_dc(secrets_ldb, setup_path, domain="EXAMPLE", + realm="example", netbiosname="myhost", + domainsid="S-5-22", keytab_path="keytab.path", + samdb_url="ldap://url/", + dns_keytab_path="dns.keytab", dnspass="bla", + machinepass="machinepass", dnsdomain="example.com") + self.assertEquals(1, + len(secrets_ldb.search("samAccountName=krbtgt,flatname=EXAMPLE,CN=Principals"))) + finally: + del secrets_ldb + os.unlink(path) class Disabled: def test_setup_templatesdb(self): |