Merge branch 'v4-0-test' of git://git.samba.org/samba into 4-0-abartlet
[sfrench/samba-autobuild/.git] / source4 / scripting / python / samba / tests / provision.py
1 #!/usr/bin/python
2
3 # Unix SMB/CIFS implementation.
4 # Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
5 #   
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
10 #   
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #   
16 # You should have received a copy of the GNU General Public License
17 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 #
19
20 import os
21 from samba.provision import setup_secretsdb
22 import samba.tests
23 from ldb import Dn
24
25 setup_dir = "setup"
26 def setup_path(file):
27     return os.path.join(setup_dir, file)
28
29
30 class ProvisionTestCase(samba.tests.TestCaseInTempDir):
31     def test_setup_secretsdb(self):
32         path = os.path.join(self.tempdir, "secrets.ldb")
33         ldb = setup_secretsdb(path, setup_path, None, None, None)
34         try:
35             self.assertEquals("LSA Secrets",
36                  ldb.searchone(Dn(ldb, "CN=LSA Secrets"), "CN"))
37         finally:
38             del ldb
39             os.unlink(path)
40
41
42 class Disabled:
43     def test_setup_templatesdb(self):
44         raise NotImplementedError(self.test_setup_templatesdb)
45
46     def test_setup_registry(self):
47         raise NotImplementedError(self.test_setup_registry)
48
49     def test_setup_samdb_rootdse(self):
50         raise NotImplementedError(self.test_setup_samdb_rootdse)
51
52     def test_setup_samdb_partitions(self):
53         raise NotImplementedError(self.test_setup_samdb_partitions)
54
55     def test_create_phpldapadmin_config(self):
56         raise NotImplementedError(self.test_create_phpldapadmin_config)
57
58     def test_provision_dns(self):
59         raise NotImplementedError(self.test_provision_dns)
60
61     def test_provision_ldapbase(self):
62         raise NotImplementedError(self.test_provision_ldapbase)
63
64     def test_provision_guess(self):
65         raise NotImplementedError(self.test_provision_guess)
66
67     def test_join_domain(self):
68         raise NotImplementedError(self.test_join_domain)
69
70     def test_vampire(self):
71         raise NotImplementedError(self.test_vampire)
72
73     def test_erase_partitions(self):
74         raise NotImplementedError(self.test_erase_partitions)
75