2 # Bootstrap Samba and run a number of tests against it.
3 # Copyright (C) 2012 Jelmer Vernooij <jelmer@samba.org>
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 def write_clientconf(conffile
, clientdir
, vars):
22 if not os
.path
.isdir(clientdir
):
23 os
.mkdir(clientdir
, 0777)
25 for n
in ["private", "lockdir", "statedir", "cachedir"]:
26 p
= os
.path
.join(clientdir
, n
)
31 # this is ugly, but the ncalrpcdir needs exactly 0755
32 # otherwise tests fail.
35 for n
in ["ncalrpcdir", "ncalrpcdir/np"]:
36 p
= os
.path
.join(clientdir
, n
)
43 "netbios name": "client",
44 "private dir": os
.path
.join(clientdir
, "private"),
45 "lock dir": os
.path
.join(clientdir
, "lockdir"),
46 "state directory": os
.path
.join(clientdir
, "statedir"),
47 "cache directory": os
.path
.join(clientdir
, "cachedir"),
48 "ncalrpc dir": os
.path
.join(clientdir
, "ncalrpcdir"),
49 "name resolve order": "file bcast",
50 "panic action": os
.path
.join(os
.path
.dirname(__file__
), "gdb_backtrace \%d"),
52 "notify:inotify": "false",
54 "system:anonymous": "true",
55 "client lanman auth": "Yes",
57 "torture:basedir": clientdir
,
58 # We don't want to pass our self-tests if the PAC code is wrong
59 "gensec:require_pac": "true",
60 "resolv:host file": os
.path
.join(prefix_abs
, "dns_host_file"),
61 # We don't want to run 'speed' tests for very long
62 "torture:timelimit": "1",
66 settings
["workgroup"] = vars["DOMAIN"]
68 settings
["realm"] = vars["REALM"]
69 if opts
.socket_wrapper
:
70 settings
["interfaces"] = interfaces
72 f
= open(conffile
, 'w')
75 for item
in settings
.iteritems():
76 f
.write("\t%s = %s\n" % item
)