1 # Unix SMB/CIFS implementation.
2 # Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 """Tests for samba.samba3.param"""
20 from samba
.samba3
import param
as s3param
21 from samba
.tests
import TestCaseInTempDir
25 for p
in ["../../../../../testdata/samba3", "../../../../testdata/samba3"]:
26 DATADIR
= os
.path
.join(os
.path
.dirname(__file__
), p
)
27 if os
.path
.exists(DATADIR
):
31 class ParamTestCase(TestCaseInTempDir
):
35 os
.system("cp -r %s %s" % (DATADIR
, self
.tempdir
))
36 datadir
= os
.path
.join(self
.tempdir
, "samba3")
38 self
.lp
= s3param
.get_context()
39 self
.lp
.load(os
.path
.join(datadir
, "smb.conf"))
43 os
.system("rm -rf %s" % os
.path
.join(self
.tempdir
, "samba3"))
47 self
.assertEqual("BEDWYR", self
.lp
.get("netbios name"))
48 self
.assertEqual("SAMBA", self
.lp
.get("workgroup"))
49 self
.assertEqual("USER", self
.lp
.get("security"))
50 self
.assertEqual("/mnt/cd1", self
.lp
.get("path", "cd1"))