From: Jelmer Vernooij Date: Fri, 25 Jan 2008 00:37:47 +0000 (+0100) Subject: python: Add test for secretsdb_become_dc X-Git-Url: http://git.samba.org/?p=metze%2Fsamba%2Fwb-ndr.git;a=commitdiff_plain;h=9173c678efb6f74dbec64298bcb00952feff2ed7 python: Add test for secretsdb_become_dc --- diff --git a/source/scripting/python/samba/tests/provision.py b/source/scripting/python/samba/tests/provision.py index f5a0339c1f5..83952df9fe7 100644 --- a/source/scripting/python/samba/tests/provision.py +++ b/source/scripting/python/samba/tests/provision.py @@ -1,7 +1,7 @@ #!/usr/bin/python # Unix SMB/CIFS implementation. -# Copyright (C) Jelmer Vernooij 2007 +# Copyright (C) Jelmer Vernooij 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):