92231cbd259a671b1f8575775639b4f3398a4b46
[kai/samba-autobuild/.git] / source4 / selftest / tests.py
1 #!/usr/bin/python
2 # This script generates a list of testsuites that should be run as part of
3 # the Samba 4 test suite.
4
5 # The output of this script is parsed by selftest.pl, which then decides
6 # which of the tests to actually run. It will, for example, skip all tests
7 # listed in selftest/skip or only run a subset during "make quicktest".
8
9 # The idea is that this script outputs all of the tests of Samba 4, not
10 # just those that are known to pass, and list those that should be skipped
11 # or are known to fail in selftest/skip or selftest/knownfail. This makes it
12 # very easy to see what functionality is still missing in Samba 4 and makes
13 # it possible to run the testsuite against other servers, such as Samba 3 or
14 # Windows that have a different set of features.
15
16 # The syntax for a testsuite is "-- TEST --" on a single line, followed
17 # by the name of the test, the environment it needs and the command to run, all
18 # three separated by newlines. All other lines in the output are considered
19 # comments.
20 from __future__ import print_function
21
22 import os, sys
23 sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../../selftest"))
24 import selftesthelpers
25 from selftesthelpers import *
26
27 print("OPTIONS %s" % " ".join(smbtorture4_options), file=sys.stderr)
28
29 def plansmbtorture4testsuite(name, env, options, modname=None):
30     return selftesthelpers.plansmbtorture4testsuite(name, env, options,
31         target='samba4', modname=modname)
32
33 samba4srcdir = source4dir()
34 samba4bindir = bindir()
35 validate = os.getenv("VALIDATE", "")
36 if validate:
37     validate_list = [validate]
38 else:
39     validate_list = []
40
41 nmblookup4 = binpath('nmblookup4')
42 smbclient4 = binpath('smbclient4')
43
44 bbdir = os.path.join(srcdir(), "testprogs/blackbox")
45
46 # Simple tests for LDAP and CLDAP
47 for auth_type in ['', '-k no', '-k yes']:
48     for auth_level in ['--option=clientldapsaslwrapping=plain', '--sign', '--encrypt']:
49         creds = '-U"$USERNAME%$PASSWORD"'
50         options = creds + ' ' + auth_type + ' ' + auth_level
51         plantestsuite("samba4.ldb.ldap with options %r(ad_dc_ntvfs)" % options, "ad_dc_ntvfs", "%s/test_ldb.sh ldap $SERVER %s" % (bbdir, options))
52
53 # see if we support ADS on the Samba3 side
54 try:
55     config_h = os.environ["CONFIG_H"]
56 except KeyError:
57     config_h = os.path.join(samba4bindir, "default/include/config.h")
58
59 # check available features
60 config_hash = dict()
61 f = open(config_h, 'r')
62 try:
63     lines = f.readlines()
64     config_hash = dict((x[0], ' '.join(x[1:]))
65             for x in map(lambda line: line.strip().split(' ')[1:],
66                          filter(lambda line: (line[0:7] == '#define') and (len(line.split(' ')) > 2), lines)))
67 finally:
68     f.close()
69
70 have_heimdal_support = ("SAMBA4_USES_HEIMDAL" in config_hash)
71
72 for options in ['-U"$USERNAME%$PASSWORD"']:
73     plantestsuite("samba4.ldb.ldaps with options %s(ad_dc_ntvfs)" % options, "ad_dc_ntvfs",
74             "%s/test_ldb.sh ldaps $SERVER_IP %s" % (bbdir, options))
75
76 creds_options = [
77     '--simple-bind-dn=$USERNAME@$REALM --password=$PASSWORD',
78 ]
79 peer_options = {
80     'SERVER_IP': '$SERVER_IP',
81     'SERVER_NAME': '$SERVER',
82     'SERVER.REALM': '$SERVER.$REALM',
83 }
84 tls_verify_options = [
85     '--option="tlsverifypeer=no_check"',
86     '--option="tlsverifypeer=ca_only"',
87     '--option="tlsverifypeer=ca_and_name_if_available"',
88     '--option="tlsverifypeer=ca_and_name"',
89     '--option="tlsverifypeer=as_strict_as_possible"',
90 ]
91
92 # we use :local for fl2008r2dc because of the self-signed certificate
93 for env in ["ad_dc_ntvfs", "fl2008r2dc:local"]:
94     for peer_key in peer_options.keys():
95         peer_val = peer_options[peer_key]
96         for creds in creds_options:
97             for tls_verify in tls_verify_options:
98                 options = creds + ' ' + tls_verify
99                 plantestsuite("samba4.ldb.simple.ldaps with options %s %s(%s)" % (
100                               peer_key, options, env), env,
101                               "%s/test_ldb_simple.sh ldaps %s %s" % (bbdir, peer_val, options))
102
103 # test all "ldap server require strong auth" combinations
104 for env in ["ad_dc_ntvfs", "fl2008r2dc", "fl2003dc"]:
105     options = '--simple-bind-dn="$USERNAME@$REALM" --password="$PASSWORD"'
106     plantestsuite("samba4.ldb.simple.ldap with SIMPLE-BIND %s(%s)" % (options, env),
107                   env, "%s/test_ldb_simple.sh ldap $SERVER %s" % (bbdir, options))
108     options += ' --option="tlsverifypeer=no_check"'
109     plantestsuite("samba4.ldb.simple.ldaps with SIMPLE-BIND %s(%s)" % (options, env),
110                   env, "%s/test_ldb_simple.sh ldaps $SERVER %s" % (bbdir, options))
111
112     auth_options = [
113         '--option=clientldapsaslwrapping=plain',
114         '--sign',
115         '--encrypt',
116     ]
117
118     for auth_option in auth_options:
119         options = '-U"$USERNAME%$PASSWORD"' + ' ' + auth_option
120         plantestsuite("samba4.ldb.simple.ldap with SASL-BIND %s(%s)" % (options, env),
121                       env, "%s/test_ldb_simple.sh ldap $SERVER %s" % (bbdir, options))
122     options = '-U"$USERNAME%$PASSWORD" --option="tlsverifypeer=no_check"'
123     plantestsuite("samba4.ldb.simple.ldaps with SASL-BIND %s(%s)" % (options, env),
124                   env, "%s/test_ldb_simple.sh ldaps $SERVER %s" % (bbdir, options))
125
126 for options in ['-U"$USERNAME%$PASSWORD"']:
127     plantestsuite("samba4.ldb.ldapi with options %s(ad_dc_ntvfs:local)" % options, "ad_dc_ntvfs:local",
128             "%s/test_ldb.sh ldapi $PREFIX_ABS/ad_dc_ntvfs/private/ldapi %s" % (bbdir, options))
129
130 for t in smbtorture4_testsuites("ldap."):
131     plansmbtorture4testsuite(t, "ad_dc_ntvfs", '-U"$USERNAME%$PASSWORD" //$SERVER_IP/_none_')
132
133 ldbdir = os.path.join(srcdir(), "lib/ldb")
134 # Don't run LDB tests when using system ldb, as we won't have ldbtest installed
135 if os.path.exists(os.path.join(samba4bindir, "ldbtest")):
136     plantestsuite("ldb.base", "none", "%s/tests/test-tdb-subunit.sh %s" % (ldbdir, samba4bindir))
137 else:
138     skiptestsuite("ldb.base", "Using system LDB, ldbtest not available")
139
140 # Tests for RPC
141
142 # add tests to this list as they start passing, so we test
143 # that they stay passing
144 ncacn_np_tests = ["rpc.schannel", "rpc.join", "rpc.lsa", "rpc.dssetup", "rpc.altercontext", "rpc.netlogon", "rpc.netlogon.admin", "rpc.handles", "rpc.samsync", "rpc.samba3-sessionkey", "rpc.samba3-getusername", "rpc.samba3-lsa", "rpc.samba3-bind", "rpc.samba3-netlogon", "rpc.asyncbind", "rpc.lsalookup", "rpc.lsa-getuser", "rpc.schannel2", "rpc.authcontext"]
145 ncalrpc_tests = ["rpc.schannel", "rpc.join", "rpc.lsa", "rpc.dssetup", "rpc.altercontext", "rpc.netlogon", "rpc.netlogon.admin", "rpc.asyncbind", "rpc.lsalookup", "rpc.lsa-getuser", "rpc.schannel2", "rpc.authcontext"]
146 drs_rpc_tests = smbtorture4_testsuites("drs.rpc")
147 ncacn_ip_tcp_tests = ["rpc.schannel", "rpc.join", "rpc.lsa", "rpc.dssetup", "rpc.drsuapi", "rpc.drsuapi_w2k8", "rpc.netlogon", "rpc.netlogon.admin", "rpc.asyncbind", "rpc.lsalookup", "rpc.lsa-getuser", "rpc.schannel2", "rpc.authcontext", "rpc.samr.passwords.validate"] + drs_rpc_tests
148 slow_ncacn_np_tests = ["rpc.samlogon", "rpc.samr", "rpc.samr.users", "rpc.samr.large-dc", "rpc.samr.users.privileges", "rpc.samr.passwords", "rpc.samr.passwords.pwdlastset", "rpc.samr.passwords.lockout", "rpc.samr.passwords.badpwdcount"]
149 slow_ncacn_ip_tcp_tests = ["rpc.cracknames"]
150
151 all_rpc_tests = ncalrpc_tests + ncacn_np_tests + ncacn_ip_tcp_tests + slow_ncacn_np_tests + slow_ncacn_ip_tcp_tests + ["rpc.lsa.secrets", "rpc.pac", "rpc.samba3-sharesec", "rpc.countcalls"]
152
153 # Make sure all tests get run
154 rpc_tests = smbtorture4_testsuites("rpc.")
155 auto_rpc_tests = filter(lambda t: t not in all_rpc_tests, rpc_tests)
156
157 for bindoptions in ["seal,padcheck"] + validate_list + ["bigendian"]:
158     for transport in ["ncalrpc", "ncacn_np", "ncacn_ip_tcp"]:
159         env = "ad_dc_ntvfs"
160         if transport == "ncalrpc":
161             tests = ncalrpc_tests
162             env = "ad_dc_ntvfs:local"
163         elif transport == "ncacn_np":
164             tests = ncacn_np_tests
165         elif transport == "ncacn_ip_tcp":
166             tests = ncacn_ip_tcp_tests
167         else:
168             raise AssertionError("invalid transport %r"% transport)
169         for t in tests:
170             plansmbtorture4testsuite(t, env, ["%s:$SERVER[%s]" % (transport, bindoptions), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.%s on %s with %s" % (t, transport, bindoptions))
171         plansmbtorture4testsuite('rpc.samba3-sharesec', env, ["%s:$SERVER[%s]" % (transport, bindoptions), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', '--option=torture:share=tmp'], "samba4.rpc.samba3.sharesec on %s with %s" % (transport, bindoptions))
172
173 #Plugin S4 DC tests (confirms named pipe auth forwarding).  This can be expanded once kerberos is supported in the plugin DC
174 #
175 for bindoptions in ["seal,padcheck"] + validate_list + ["bigendian"]:
176     for t in ncacn_np_tests:
177         env = "ad_dc"
178         transport = "ncacn_np"
179         plansmbtorture4testsuite(t, env, ["%s:$SERVER[%s]" % (transport, bindoptions), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.%s with %s" % (t, bindoptions))
180
181 for bindoptions in [""] + validate_list + ["bigendian"]:
182     for t in auto_rpc_tests:
183         plansmbtorture4testsuite(t, "ad_dc_ntvfs", ["$SERVER[%s]" % bindoptions, '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.%s with %s" % (t, bindoptions))
184
185 t = "rpc.countcalls"
186 plansmbtorture4testsuite(t, "ad_dc_ntvfs:local", ["$SERVER[%s]" % bindoptions, '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], modname="samba4.%s" % t)
187
188 for transport in ["ncacn_np", "ncacn_ip_tcp"]:
189     env = "ad_dc_ntvfs"
190     if transport == "ncacn_np":
191         tests = slow_ncacn_np_tests
192     elif transport == "ncacn_ip_tcp":
193         tests = slow_ncacn_ip_tcp_tests
194     else:
195         raise AssertionError("Invalid transport %r" % transport)
196     for t in tests:
197         bindoptions = ''
198         if t == 'rpc.cracknames':
199             bindoptions = 'seal'
200         plansmbtorture4testsuite(t, env, ["%s:$SERVER[%s]" % (transport,bindoptions), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.%s on %s with %s" % (t, transport, bindoptions))
201
202 # Tests for the DFS referral calls implementation
203 for t in smbtorture4_testsuites("dfs."):
204     plansmbtorture4testsuite(t, "ad_dc_ntvfs", '//$SERVER/ipc\$ -U$USERNAME%$PASSWORD')
205     plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/ipc\$ -U$USERNAME%$PASSWORD')
206
207 # Tests for the NET API (net.api.become.dc tested below against all the roles)
208 net_tests = filter(lambda x: "net.api.become.dc" not in x, smbtorture4_testsuites("net."))
209 for t in net_tests:
210     plansmbtorture4testsuite(t, "ad_dc_ntvfs", '$SERVER[%s] -U$USERNAME%%$PASSWORD -W$DOMAIN' % validate)
211
212 # Tests for session keys and encryption of RPC pipes
213 # FIXME: Integrate these into a single smbtorture test
214
215 transport = "ncacn_np"
216 for env in ["ad_dc_ntvfs", "nt4_dc"]:
217     for ntlmoptions in [
218         "-k no --option=clientusespnego=yes",
219         "-k no --option=clientusespnego=yes --option=ntlmssp_client:128bit=no",
220         "-k no --option=clientusespnego=yes --option=ntlmssp_client:56bit=yes",
221         "-k no --option=clientusespnego=yes --option=ntlmssp_client:56bit=no",
222         "-k no --option=clientusespnego=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=yes",
223         "-k no --option=clientusespnego=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=no",
224         "-k no --option=clientusespnego=yes --option=clientntlmv2auth=yes",
225         "-k no --option=clientusespnego=yes --option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no",
226         "-k no --option=clientusespnego=yes --option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=yes",
227         "-k no --option=clientusespnego=no --option=clientntlmv2auth=yes",
228         "-k no --option=gensec:spnego=no --option=clientntlmv2auth=yes",
229         "-k no --option=clientusespnego=no"]:
230         name = "rpc.lsa.secrets on %s with with %s" % (transport, ntlmoptions)
231         plansmbtorture4testsuite('rpc.lsa.secrets', env, ["%s:$SERVER[]" % (transport), ntlmoptions, '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', '--option=gensec:target_hostname=$NETBIOSNAME'], "samba4.%s" % name)
232     plantestsuite("samba.blackbox.pdbtest(%s)" % env, "%s:local" % env, [os.path.join(bbdir, "test_pdbtest.sh"), '$SERVER', "$PREFIX", "pdbtest", smbclient4, '$SMB_CONF_PATH', configuration])
233
234 gpo = smbtorture4_testsuites("gpo.")
235 for t in gpo:
236     plansmbtorture4testsuite(t, 'ad_dc:local', ['//$SERVER/sysvol', '-U$USERNAME%$PASSWORD'])
237
238 transports = ["ncacn_np", "ncacn_ip_tcp"]
239
240 #Kerberos varies between functional levels, so it is important to check this on all of them
241 for env in ["ad_dc_ntvfs", "fl2000dc", "fl2003dc", "fl2008r2dc", "ad_dc"]:
242     transport = "ncacn_np"
243     plansmbtorture4testsuite('rpc.pac', env, ["%s:$SERVER[]" % (transport, ), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.pac on %s" % (transport,))
244     plansmbtorture4testsuite('rpc.lsa.secrets', env, ["%s:$SERVER[]" % (transport, ), '-k', 'yes', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', '--option=gensec:target_hostname=$NETBIOSNAME', 'rpc.lsa.secrets'], "samba4.rpc.lsa.secrets on %s with Kerberos" % (transport,))
245     plansmbtorture4testsuite('rpc.lsa.secrets', env, ["%s:$SERVER[]" % (transport, ), '-k', 'yes', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', "--option=clientusespnegoprincipal=yes", '--option=gensec:target_hostname=$NETBIOSNAME'], "samba4.rpc.lsa.secrets on %s with Kerberos - use target principal" % (transport,))
246     plansmbtorture4testsuite('rpc.lsa.secrets', env, ["%s:$SERVER[target_principal=dcom/$NETBIOSNAME]" % (transport, ), '-k', 'yes', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.lsa.secrets on %s with Kerberos - netbios name principal dcom" % (transport,))
247     plansmbtorture4testsuite('rpc.lsa.secrets', env, ["%s:$SERVER[target_principal=$NETBIOSNAME\$]" % (transport, ), '-k', 'yes', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.lsa.secrets on %s with Kerberos - netbios name principal dollar" % (transport,))
248     plansmbtorture4testsuite('rpc.lsa.secrets', env, ["%s:$SERVER[target_principal=$NETBIOSNAME]" % (transport, ), '-k', 'yes', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.lsa.secrets on %s with Kerberos - netbios name principal" % (transport,))
249     plansmbtorture4testsuite('rpc.lsa.secrets.none*', env, ["%s:$SERVER" % transport, '-k', 'yes', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', "--option=gensec:fake_gssapi_krb5=yes", '--option=gensec:gssapi_krb5=no', '--option=gensec:target_hostname=$NETBIOSNAME'], "samba4.rpc.lsa.secrets on %s with Kerberos - use Samba3 style login" % transport)
250     plansmbtorture4testsuite('rpc.lsa.secrets.none*', env, ["%s:$SERVER" % transport, '-k', 'yes', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', "--option=gensec:fake_gssapi_krb5=yes", '--option=gensec:gssapi_krb5=no', '--option=gensec:target_hostname=$NETBIOSNAME', '--option=gensec_krb5:send_authenticator_checksum=false'], "samba4.rpc.lsa.secrets on %s with Kerberos - use raw-krb5-no-authenticator-checksum style login" % transport)
251     plansmbtorture4testsuite('rpc.lsa.secrets.none*', env, ["%s:$SERVER" % transport, '-k', 'yes', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', "--option=clientusespnegoprincipal=yes", '--option=gensec:fake_gssapi_krb5=yes', '--option=gensec:gssapi_krb5=no', '--option=gensec:target_hostname=$NETBIOSNAME'], "samba4.rpc.lsa.secrets on %s with Kerberos - use Samba3 style login, use target principal" % transport)
252
253     # Winreg tests test bulk Kerberos encryption of DCE/RPC
254     # We test rpc.winreg here too, because the winreg interface if
255     # handled by the source3/rpc_server code.
256     for bindoptions in ["connect", "packet", "krb5", "krb5,packet", "krb5,sign", "krb5,seal", "spnego", "spnego,packet", "spnego,sign", "spnego,seal"]:
257         plansmbtorture4testsuite('rpc.winreg', env, ["%s:$SERVER[%s]" % (transport, bindoptions), '-k', 'yes', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.winreg on %s with %s" % (transport, bindoptions))
258
259     for transport in transports:
260         plansmbtorture4testsuite('rpc.echo', env, ["%s:$SERVER[]" % (transport,), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.echo on %s" % (transport, ))
261
262         # Echo tests test bulk Kerberos encryption of DCE/RPC
263         for bindoptions in ["connect", "krb5", "krb5,sign", "krb5,seal", "spnego", "spnego,sign", "spnego,seal"] + validate_list + ["padcheck", "bigendian", "bigendian,seal"]:
264             echooptions = "--option=socket:testnonblock=True --option=torture:quick=yes -k yes"
265             plansmbtorture4testsuite('rpc.echo', env, ["%s:$SERVER[%s]" % (transport, bindoptions), echooptions, '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.echo on %s with %s and %s" % (transport, bindoptions, echooptions))
266
267 for env in ["fl2000dc", "fl2008r2dc"]:
268     plansmbtorture4testsuite("net.api.become.dc", env, '$SERVER[%s] -U$USERNAME%%$PASSWORD -W$DOMAIN' % validate)
269
270 for bindoptions in ["sign", "seal"]:
271     plansmbtorture4testsuite('rpc.backupkey', "ad_dc_ntvfs", ["ncacn_np:$SERVER[%s]" % ( bindoptions), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.backupkey with %s" % (bindoptions))
272
273 for transport in transports:
274     for bindoptions in ["sign", "seal"]:
275         for ntlmoptions in [
276         "--option=ntlmssp_client:ntlm2=yes --option=torture:quick=yes",
277         "--option=ntlmssp_client:ntlm2=no --option=torture:quick=yes",
278         "--option=ntlmssp_client:ntlm2=yes --option=ntlmssp_client:128bit=no --option=torture:quick=yes",
279         "--option=ntlmssp_client:ntlm2=no --option=ntlmssp_client:128bit=no --option=torture:quick=yes",
280         "--option=ntlmssp_client:ntlm2=yes --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes",
281         "--option=ntlmssp_client:ntlm2=no --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes",
282         "--option=clientntlmv2auth=yes --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes",
283         "--option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:keyexchange=yes --option=torture:quick=yes",
284         "--option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes"]:
285             if transport == "ncalrpc":
286                 env = "ad_dc_ntvfs:local"
287             else:
288                 env = "ad_dc_ntvfs"
289             plansmbtorture4testsuite('rpc.echo', env, ["%s:$SERVER[%s]" % (transport, bindoptions), ntlmoptions, '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.echo on %s with %s and %s" % (transport, bindoptions, ntlmoptions))
290
291 plansmbtorture4testsuite('rpc.echo', "ad_dc_ntvfs", ['ncacn_np:$SERVER[smb2]', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.echo on ncacn_np over smb2")
292 for env in ["ad_dc", "nt4_dc"]:
293     plansmbtorture4testsuite('rpc.echo', env, ['60a15ec5-4de8-11d7-a637-005056a20182@ncacn_np:$SERVER[]', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', '--option=torture:quick=yes'], "samba4.rpc.echo on ncacn_np with object")
294     plansmbtorture4testsuite('rpc.echo', env, ['60a15ec5-4de8-11d7-a637-005056a20182@ncacn_ip_tcp:$SERVER[]', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', '--option=torture:quick=yes'], "samba4.rpc.echo on ncacn_ip_tcp with object")
295
296 plansmbtorture4testsuite('ntp.signd', "ad_dc_ntvfs:local", ['ncacn_np:$SERVER', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.ntp.signd")
297
298 nbt_tests = smbtorture4_testsuites("nbt.")
299 for t in nbt_tests:
300     plansmbtorture4testsuite(t, "ad_dc_ntvfs", "//$SERVER/_none_ -U\"$USERNAME%$PASSWORD\"")
301
302 # Tests against the NTVFS POSIX backend
303 ntvfsargs = ["--option=torture:sharedelay=100000", "--option=torture:oplocktimeout=3", "--option=torture:writetimeupdatedelay=500000"]
304
305 # Filter smb2 tests that should not run against ad_dc_ntvfs
306 smb2_s3only = ["smb2.change_notify_disabled", "smb2.dosmode", "smb2.credits", "smb2.kernel-oplocks"]
307 smb2 = [x for x in smbtorture4_testsuites("smb2.") if x not in smb2_s3only]
308
309 #The QFILEINFO-IPC test needs to be on ipc$
310 raw = filter(lambda x: "raw.qfileinfo.ipc" not in x, smbtorture4_testsuites("raw."))
311 base = smbtorture4_testsuites("base.")
312
313 netapi = smbtorture4_testsuites("netapi.")
314
315 libsmbclient = smbtorture4_testsuites("libsmbclient.")
316 libsmbclient_testargs = ["--option=torture:replace_smbconf=%s/testdata/samba3/smb_new.conf" % srcdir()]
317
318 for t in base + raw + smb2 + netapi + libsmbclient:
319     plansmbtorture4testsuite(t, "ad_dc_ntvfs", ['//$SERVER/tmp', '-U$USERNAME%$PASSWORD'] + ntvfsargs + libsmbclient_testargs)
320
321 plansmbtorture4testsuite("raw.qfileinfo.ipc", "ad_dc_ntvfs", '//$SERVER/ipc\$ -U$USERNAME%$PASSWORD')
322
323 for t in smbtorture4_testsuites("rap."):
324     plansmbtorture4testsuite(t, "ad_dc_ntvfs", '//$SERVER/IPC\$ -U$USERNAME%$PASSWORD')
325
326 # Tests against the NTVFS CIFS backend
327 for t in base + raw:
328     plansmbtorture4testsuite(t, "ad_dc_ntvfs", ['//$NETBIOSNAME/cifs', '-U$USERNAME%$PASSWORD', '--kerberos=yes'] + ntvfsargs, modname="samba4.ntvfs.cifs.krb5.%s" % t)
329
330 # Test NTVFS CIFS backend with S4U2Self and S4U2Proxy
331 t = "base.unlink"
332 plansmbtorture4testsuite(t, "ad_dc_ntvfs", ['//$NETBIOSNAME/cifs', '-U$USERNAME%$PASSWORD', '--kerberos=no'] + ntvfsargs, "samba4.ntvfs.cifs.ntlm.%s" % t)
333 plansmbtorture4testsuite(t, "rpc_proxy", ['//$NETBIOSNAME/cifs_to_dc', '-U$DC_USERNAME%$DC_PASSWORD', '--kerberos=yes'] + ntvfsargs, "samba4.ntvfs.cifs.krb5.%s" % t)
334 plansmbtorture4testsuite(t, "rpc_proxy", ['//$NETBIOSNAME/cifs_to_dc', '-U$DC_USERNAME%$DC_PASSWORD', '--kerberos=no'] + ntvfsargs, "samba4.ntvfs.cifs.ntlm.%s" % t)
335
336 plansmbtorture4testsuite('echo.udp', 'ad_dc_ntvfs:local', '//$SERVER/whatever')
337
338 # Local tests
339 for t in smbtorture4_testsuites("local."):
340     #The local.resolve test needs a name to look up using real system (not emulated) name routines
341     plansmbtorture4testsuite(t, "none", "ncalrpc:localhost")
342
343 # Confirm these tests with the system iconv too
344 for t in ["local.convert_string_handle", "local.convert_string", "local.ndr"]:
345     options = "ncalrpc: --option='iconv:use_builtin_handlers=false'"
346     plansmbtorture4testsuite(t, "none", options,
347         modname="samba4.%s.system.iconv" % t)
348
349 tdbtorture4 = binpath("tdbtorture")
350 if os.path.exists(tdbtorture4):
351     plantestsuite("tdb.stress", "none", valgrindify(tdbtorture4))
352 else:
353     skiptestsuite("tdb.stress", "Using system TDB, tdbtorture not available")
354
355 plansmbtorture4testsuite("drs.unit", "none", "ncalrpc:")
356
357 # Pidl tests
358 for f in sorted(os.listdir(os.path.join(samba4srcdir, "../pidl/tests"))):
359     if f.endswith(".pl"):
360         planperltestsuite("pidl.%s" % f[:-3], os.path.normpath(os.path.join(samba4srcdir, "../pidl/tests", f)))
361
362 # DNS tests
363 plantestsuite_loadlist("samba.tests.dns", "fl2003dc:local", [python, os.path.join(srcdir(), "python/samba/tests/dns.py"), '$SERVER', '$SERVER_IP', '--machine-pass', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
364 plantestsuite_loadlist("samba.tests.dns", "rodc:local", [python, os.path.join(srcdir(), "python/samba/tests/dns.py"), '$SERVER', '$SERVER_IP', '--machine-pass', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
365 plantestsuite_loadlist("samba.tests.dns", "vampire_dc:local", [python, os.path.join(srcdir(), "python/samba/tests/dns.py"), '$SERVER', '$SERVER_IP', '--machine-pass', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
366
367 plantestsuite_loadlist("samba.tests.dns_forwarder", "fl2003dc:local", [python, os.path.join(srcdir(), "python/samba/tests/dns_forwarder.py"), '$SERVER', '$SERVER_IP', '$DNS_FORWARDER1', '$DNS_FORWARDER2', '--machine-pass', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
368
369 plantestsuite_loadlist("samba.tests.dns_tkey", "fl2008r2dc", [python, os.path.join(srcdir(), "python/samba/tests/dns_tkey.py"), '$SERVER', '$SERVER_IP', '--machine-pass', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
370 plantestsuite_loadlist("samba.tests.dns_wildcard", "ad_dc", [python, os.path.join(srcdir(), "python/samba/tests/dns_wildcard.py"), '$SERVER', '$SERVER_IP', '--machine-pass', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
371 for t in smbtorture4_testsuites("dns_internal."):
372     plansmbtorture4testsuite(t, "ad_dc_ntvfs:local", '//$SERVER/whavever')
373
374 # Local tests
375 for t in smbtorture4_testsuites("dlz_bind9."):
376     #The dlz_bind9 tests needs to look at the DNS database
377     plansmbtorture4testsuite(t, "chgdcpass:local", ["ncalrpc:$SERVER", '-U$USERNAME%$PASSWORD'])
378
379 planpythontestsuite("nt4_dc", "samba.tests.libsmb_samba_internal", py3_compatible=True);
380
381 # Blackbox Tests:
382 # tests that interact directly with the command-line tools rather than using
383 # the API. These mainly test that the various command-line options of commands
384 # work correctly.
385
386 for env in ["ad_member", "s4member", "ad_dc_ntvfs", "chgdcpass"]:
387     plantestsuite("samba4.blackbox.smbclient(%s:local)" % env, "%s:local" % env, [os.path.join(samba4srcdir, "utils/tests/test_smbclient.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$DOMAIN', smbclient4])
388
389 plantestsuite("samba4.blackbox.samba_tool(ad_dc_ntvfs:local)", "ad_dc_ntvfs:local", [os.path.join(samba4srcdir, "utils/tests/test_samba_tool.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$DOMAIN', smbclient4])
390 plantestsuite("samba4.blackbox.net_rpc_user(ad_dc)", "ad_dc", [os.path.join(bbdir, "test_net_rpc_user.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$DOMAIN'])
391
392 if have_heimdal_support:
393     for env in ["ad_dc_ntvfs", "ad_dc"]:
394         plantestsuite("samba4.blackbox.pkinit(%s:local)" % env, "%s:local" % env, [os.path.join(bbdir, "test_pkinit_heimdal.sh"), '$SERVER', 'pkinit', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX/%s' % env, "aes256-cts-hmac-sha1-96", smbclient4, configuration])
395         plantestsuite("samba4.blackbox.pkinit_pac(%s:local)" % env, "%s:local" % env, [os.path.join(bbdir, "test_pkinit_pac_heimdal.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX/%s' % env, "aes256-cts-hmac-sha1-96", configuration])
396     plantestsuite("samba4.blackbox.kinit(ad_dc_ntvfs:local)", "ad_dc_ntvfs:local", [os.path.join(bbdir, "test_kinit_heimdal.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', "aes256-cts-hmac-sha1-96", smbclient4, configuration])
397     plantestsuite("samba4.blackbox.kinit(fl2000dc:local)", "fl2000dc:local", [os.path.join(bbdir, "test_kinit_heimdal.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', "arcfour-hmac-md5", smbclient4, configuration])
398     plantestsuite("samba4.blackbox.kinit(fl2008r2dc:local)", "fl2008r2dc:local", [os.path.join(bbdir, "test_kinit_heimdal.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', "aes256-cts-hmac-sha1-96", smbclient4, configuration])
399     plantestsuite("samba4.blackbox.kinit_trust(fl2008r2dc:local)", "fl2008r2dc:local", [os.path.join(bbdir, "test_kinit_trusts_heimdal.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$TRUST_SERVER', '$TRUST_USERNAME', '$TRUST_PASSWORD', '$TRUST_REALM', '$TRUST_DOMAIN', '$PREFIX', "forest", "aes256-cts-hmac-sha1-96"])
400     plantestsuite("samba4.blackbox.kinit_trust(fl2003dc:local)", "fl2003dc:local", [os.path.join(bbdir, "test_kinit_trusts_heimdal.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$TRUST_SERVER', '$TRUST_USERNAME', '$TRUST_PASSWORD', '$TRUST_REALM', '$TRUST_DOMAIN', '$PREFIX', "external", "arcfour-hmac-md5"])
401     plantestsuite("samba4.blackbox.export.keytab(ad_dc_ntvfs:local)", "ad_dc_ntvfs:local", [os.path.join(bbdir, "test_export_keytab_heimdal.sh"), '$SERVER', '$USERNAME', '$REALM', '$DOMAIN', "$PREFIX", smbclient4])
402     plantestsuite("samba4.blackbox.kpasswd(ad_dc_ntvfs:local)", "ad_dc_ntvfs:local", [os.path.join(bbdir, "test_kpasswd_heimdal.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', "$PREFIX/ad_dc_ntvfs"])
403 else:
404     plantestsuite("samba4.blackbox.kinit(ad_dc_ntvfs:local)", "ad_dc_ntvfs:local", [os.path.join(bbdir, "test_kinit_mit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', smbclient4, configuration])
405     plantestsuite("samba4.blackbox.kinit(fl2000dc:local)", "fl2000dc:local", [os.path.join(bbdir, "test_kinit_mit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', smbclient4, configuration])
406     plantestsuite("samba4.blackbox.kinit(fl2008r2dc:local)", "fl2008r2dc:local", [os.path.join(bbdir, "test_kinit_mit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', smbclient4, configuration])
407     plantestsuite("samba4.blackbox.kinit_trust(fl2008r2dc:local)", "fl2008r2dc:local", [os.path.join(bbdir, "test_kinit_trusts_mit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$TRUST_SERVER', '$TRUST_USERNAME', '$TRUST_PASSWORD', '$TRUST_REALM', '$TRUST_DOMAIN', '$PREFIX', "forest"])
408     plantestsuite("samba4.blackbox.kinit_trust(fl2003dc:local)", "fl2003dc:local", [os.path.join(bbdir, "test_kinit_trusts_mit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$TRUST_SERVER', '$TRUST_USERNAME', '$TRUST_PASSWORD', '$TRUST_REALM', '$TRUST_DOMAIN', '$PREFIX', "external"])
409     plantestsuite("samba4.blackbox.export.keytab(ad_dc_ntvfs:local)", "ad_dc_ntvfs:local", [os.path.join(bbdir, "test_export_keytab_mit.sh"), '$SERVER', '$USERNAME', '$REALM', '$DOMAIN', "$PREFIX", smbclient4])
410     plantestsuite("samba4.blackbox.kpasswd(ad_dc_ntvfs:local)", "ad_dc_ntvfs:local", [os.path.join(bbdir, "test_kpasswd_mit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', "$PREFIX/ad_dc_ntvfs"])
411
412 plantestsuite("samba4.blackbox.trust_ntlm", "fl2008r2dc:local", [os.path.join(bbdir, "test_trust_ntlm.sh"), '$SERVER_IP', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$TRUST_USERNAME', '$TRUST_PASSWORD', '$TRUST_REALM', '$TRUST_DOMAIN', 'forest', 'auto', 'NT_STATUS_LOGON_FAILURE'])
413 plantestsuite("samba4.blackbox.trust_ntlm", "fl2003dc:local", [os.path.join(bbdir, "test_trust_ntlm.sh"), '$SERVER_IP', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$TRUST_USERNAME', '$TRUST_PASSWORD', '$TRUST_REALM', '$TRUST_DOMAIN', 'external', 'auto', 'NT_STATUS_LOGON_FAILURE'])
414 plantestsuite("samba4.blackbox.trust_ntlm", "ad_member:local", [os.path.join(bbdir, "test_trust_ntlm.sh"), '$SERVER_IP', '$USERNAME', '$PASSWORD', '$SERVER', '$SERVER', '$DC_USERNAME', '$DC_PASSWORD', '$REALM', '$DOMAIN', 'member', 'auto', 'NT_STATUS_LOGON_FAILURE'])
415 plantestsuite("samba4.blackbox.trust_ntlm", "nt4_member:local", [os.path.join(bbdir, "test_trust_ntlm.sh"), '$SERVER_IP', '$USERNAME', '$PASSWORD', '$SERVER', '$SERVER', '$DC_USERNAME', '$DC_PASSWORD', '$DOMAIN', '$DOMAIN', 'member', 'auto', 'NT_STATUS_LOGON_FAILURE'])
416
417 plantestsuite("samba4.blackbox.trust_utils(fl2008r2dc:local)", "fl2008r2dc:local", [os.path.join(bbdir, "test_trust_utils.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$TRUST_SERVER', '$TRUST_USERNAME', '$TRUST_PASSWORD', '$TRUST_REALM', '$TRUST_DOMAIN', '$PREFIX', "forest"])
418 plantestsuite("samba4.blackbox.trust_utils(fl2003dc:local)", "fl2003dc:local", [os.path.join(bbdir, "test_trust_utils.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$TRUST_SERVER', '$TRUST_USERNAME', '$TRUST_PASSWORD', '$TRUST_REALM', '$TRUST_DOMAIN', '$PREFIX', "external"])
419 plantestsuite("samba4.blackbox.trust_token", "fl2008r2dc", [os.path.join(bbdir, "test_trust_token.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$DOMSID', '$TRUST_USERNAME', '$TRUST_PASSWORD', '$TRUST_REALM', '$TRUST_DOMAIN', '$TRUST_DOMSID', 'forest'])
420 plantestsuite("samba4.blackbox.trust_token", "fl2003dc", [os.path.join(bbdir, "test_trust_token.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$DOMSID', '$TRUST_USERNAME', '$TRUST_PASSWORD', '$TRUST_REALM', '$TRUST_DOMAIN', '$TRUST_DOMSID', 'external'])
421 plantestsuite("samba4.blackbox.ktpass(ad_dc_ntvfs)", "ad_dc_ntvfs", [os.path.join(bbdir, "test_ktpass.sh"), '$PREFIX/ad_dc_ntvfs'])
422 plantestsuite("samba4.blackbox.password_settings(ad_dc_ntvfs:local)", "ad_dc_ntvfs:local", [os.path.join(bbdir, "test_password_settings.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', "$PREFIX/ad_dc_ntvfs"])
423 plantestsuite("samba4.blackbox.cifsdd(ad_dc_ntvfs)", "ad_dc_ntvfs", [os.path.join(samba4srcdir, "client/tests/test_cifsdd.sh"), '$SERVER', '$USERNAME', '$PASSWORD', "$DOMAIN"])
424 plantestsuite("samba4.blackbox.nmblookup(ad_dc_ntvfs)", "ad_dc_ntvfs", [os.path.join(samba4srcdir, "utils/tests/test_nmblookup.sh"), '$NETBIOSNAME', '$NETBIOSALIAS', '$SERVER', '$SERVER_IP', nmblookup4])
425 plantestsuite("samba4.blackbox.locktest(ad_dc_ntvfs)", "ad_dc_ntvfs", [os.path.join(samba4srcdir, "torture/tests/test_locktest.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$DOMAIN', '$PREFIX'])
426 plantestsuite("samba4.blackbox.masktest", "ad_dc_ntvfs", [os.path.join(samba4srcdir, "torture/tests/test_masktest.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$DOMAIN', '$PREFIX'])
427 plantestsuite("samba4.blackbox.gentest(ad_dc_ntvfs)", "ad_dc_ntvfs", [os.path.join(samba4srcdir, "torture/tests/test_gentest.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$DOMAIN', "$PREFIX"])
428 plantestsuite("samba4.blackbox.rfc2307_mapping(ad_dc_ntvfs:local)", "ad_dc_ntvfs:local", [os.path.join(samba4srcdir, "../nsswitch/tests/test_rfc2307_mapping.sh"), '$DOMAIN', '$USERNAME', '$PASSWORD', "$SERVER", "$UID_RFC2307TEST", "$GID_RFC2307TEST", configuration])
429 plantestsuite("samba4.blackbox.chgdcpass", "chgdcpass", [os.path.join(bbdir, "test_chgdcpass.sh"), '$SERVER', "CHGDCPASS\$", '$REALM', '$DOMAIN', '$PREFIX', "aes256-cts-hmac-sha1-96", '$SELFTEST_PREFIX/chgdcpass', smbclient4])
430 plantestsuite("samba4.blackbox.samba_upgradedns(chgdcpass:local)", "chgdcpass:local", [os.path.join(bbdir, "test_samba_upgradedns.sh"), '$SERVER', '$REALM', '$PREFIX', '$SELFTEST_PREFIX/chgdcpass'])
431 plantestsuite("samba4.blackbox.net_ads(ad_dc:client)", "ad_dc:client", [os.path.join(bbdir, "test_net_ads.sh"), '$DC_SERVER', '$DC_USERNAME', '$DC_PASSWORD', '$PREFIX_ABS'])
432 plantestsuite("samba4.blackbox.client_etypes_all(ad_dc:client)", "ad_dc:client", [os.path.join(bbdir, "test_client_etypes.sh"), '$DC_SERVER', '$DC_USERNAME', '$DC_PASSWORD', '$PREFIX_ABS', 'all', '17_18_23'])
433 plantestsuite("samba4.blackbox.client_etypes_legacy(ad_dc:client)", "ad_dc:client", [os.path.join(bbdir, "test_client_etypes.sh"), '$DC_SERVER', '$DC_USERNAME', '$DC_PASSWORD', '$PREFIX_ABS', 'legacy', '23'])
434 plantestsuite("samba4.blackbox.client_etypes_strong(ad_dc:client)", "ad_dc:client", [os.path.join(bbdir, "test_client_etypes.sh"), '$DC_SERVER', '$DC_USERNAME', '$DC_PASSWORD', '$PREFIX_ABS', 'strong', '17_18'])
435 plantestsuite("samba4.blackbox.net_ads_dns(ad_member:local)", "ad_member:local", [os.path.join(bbdir, "test_net_ads_dns.sh"), '$DC_SERVER', '$DC_USERNAME', '$DC_PASSWORD', '$REALM', '$USERNAME', '$PASSWORD'])
436 plantestsuite_loadlist("samba4.rpc.echo against NetBIOS alias", "ad_dc_ntvfs", [valgrindify(smbtorture4), "$LISTOPT", "$LOADLIST", 'ncacn_np:$NETBIOSALIAS', '-U$DOMAIN/$USERNAME%$PASSWORD', 'rpc.echo'])
437
438 # Tests using the "Simple" NTVFS backend
439 for t in ["base.rw1"]:
440     plansmbtorture4testsuite(t, "ad_dc_ntvfs", ["//$SERVER/simple", '-U$USERNAME%$PASSWORD'], modname="samba4.ntvfs.simple.%s" % t)
441
442 # Domain S4member Tests
443 plansmbtorture4testsuite('rpc.echo', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], "samba4.rpc.echo against s4member server with local creds")
444 plansmbtorture4testsuite('rpc.echo', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'], "samba4.rpc.echo against s4member server with domain creds")
445 plansmbtorture4testsuite('rpc.samr', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], "samba4.rpc.samr against s4member server with local creds")
446 plansmbtorture4testsuite('rpc.samr.users', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], "samba4.rpc.samr.users against s4member server with local creds",)
447 plansmbtorture4testsuite('rpc.samr.passwords', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], "samba4.rpc.samr.passwords against s4member server with local creds")
448 plantestsuite("samba4.blackbox.smbclient against s4member server with local creds", "s4member", [os.path.join(samba4srcdir, "client/tests/test_smbclient.sh"), '$NETBIOSNAME', '$USERNAME', '$PASSWORD', '$NETBIOSNAME', '$PREFIX', smbclient4])
449
450 # RPC Proxy
451 plansmbtorture4testsuite("rpc.echo", "rpc_proxy", ['ncacn_ip_tcp:$NETBIOSNAME', '-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'], modname="samba4.rpc.echo against rpc proxy with domain creds")
452
453 # Tests SMB signing
454 for mech in [
455     "-k no",
456     "-k no --option=clientusespnego=no",
457     "-k no --option=gensec:spengo=no",
458     "-k yes",
459     "-k yes --option=gensec:fake_gssapi_krb5=yes --option=gensec:gssapi_krb5=no"]:
460     for signing in ["--signing=on", "--signing=required"]:
461         signoptions = "%s %s" % (mech, signing)
462         name = "smb.signing on with %s" % signoptions
463         plansmbtorture4testsuite('base.xcopy', "ad_dc_ntvfs", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$USERNAME%$PASSWORD'], modname="samba4.%s" % name)
464
465 for mech in [
466     "-k no",
467     "-k no --option=clientusespnego=no",
468     "-k no --option=gensec:spengo=no",
469     "-k yes"]:
470     signoptions = "%s --signing=off" % mech
471     name = "smb.signing disabled on with %s" % signoptions
472     plansmbtorture4testsuite('base.xcopy', "s4member", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$DC_USERNAME%$DC_PASSWORD'], "samba4.%s domain-creds" % name)
473     plansmbtorture4testsuite('base.xcopy', "ad_member", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$DC_USERNAME%$DC_PASSWORD'], "samba4.%s domain-creds" % name)
474     plansmbtorture4testsuite('base.xcopy', "ad_dc", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$USERNAME%$PASSWORD'], "samba4.%s" % name)
475     plansmbtorture4testsuite('base.xcopy', "ad_dc",
476                             ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$DC_USERNAME%$DC_PASSWORD'], "samba4.%s administrator" % name)
477
478 plantestsuite("samba4.blackbox.bogusdomain", "ad_member", ["testprogs/blackbox/bogus.sh", "$NETBIOSNAME", "xcopy_share", '$USERNAME', '$PASSWORD', '$DC_USERNAME', '$DC_PASSWORD', smbclient4])
479 for mech in [
480     "-k no",
481     "-k no --option=clientusespnego=no",
482     "-k no --option=gensec:spengo=no"]:
483     signoptions = "%s --signing=off" % mech
484     plansmbtorture4testsuite('base.xcopy', "s4member", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], modname="samba4.smb.signing on with %s local-creds" % signoptions)
485
486 plansmbtorture4testsuite('base.xcopy', "ad_dc_ntvfs", ['//$NETBIOSNAME/xcopy_share', '-k', 'no', '--signing=yes', '-U%'], modname="samba4.smb.signing --signing=yes anon")
487 plansmbtorture4testsuite('base.xcopy', "ad_dc_ntvfs", ['//$NETBIOSNAME/xcopy_share', '-k', 'no', '--signing=required', '-U%'], modname="samba4.smb.signing --signing=required anon")
488 plansmbtorture4testsuite('base.xcopy', "s4member", ['//$NETBIOSNAME/xcopy_share', '-k', 'no', '--signing=no', '-U%'], modname="samba4.smb.signing --signing=no anon")
489
490
491 wb_opts_default = ["--option=\"torture:strict mode=no\"", "--option=\"torture:timelimit=1\"", "--option=\"torture:winbindd_separator=/\"", "--option=\"torture:winbindd_netbios_name=$SERVER\"", "--option=\"torture:winbindd_netbios_domain=$DOMAIN\""]
492
493 winbind_ad_client_tests = smbtorture4_testsuites("winbind.struct") + smbtorture4_testsuites("winbind.pac")
494 winbind_wbclient_tests = smbtorture4_testsuites("winbind.wbclient")
495 for env in ["ad_dc", "s4member", "ad_member", "nt4_member"]:
496     wb_opts = wb_opts_default[:]
497     if env in ["ad_member"]:
498         wb_opts += ["--option=\"torture:winbindd_domain_without_prefix=$DOMAIN\""]
499     for t in winbind_ad_client_tests:
500         plansmbtorture4testsuite(t, "%s:local" % env, wb_opts + ['//$SERVER/tmp', '--realm=$REALM', '--machine-pass', '--option=torture:addc=$DC_SERVER'])
501
502 for env in ["nt4_dc", "fl2003dc"]:
503     for t in winbind_wbclient_tests:
504         plansmbtorture4testsuite(t, "%s:local" % env, '//$SERVER/tmp -U$DC_USERNAME%$DC_PASSWORD')
505
506 for env in ["nt4_dc", "nt4_member", "ad_dc", "ad_member", "s4member", "chgdcpass", "rodc"]:
507     tests = ["--ping", "--separator",
508              "--own-domain",
509              "--all-domains",
510              "--trusted-domains",
511              "--domain-info=BUILTIN",
512              "--domain-info=$DOMAIN",
513              "--online-status",
514              "--online-status --domain=BUILTIN",
515              "--online-status --domain=$DOMAIN",
516              "--check-secret --domain=$DOMAIN",
517              "--change-secret --domain=$DOMAIN",
518              "--check-secret --domain=$DOMAIN",
519              "--online-status --domain=$DOMAIN",
520              "--domain-users",
521              "--domain-groups",
522              "--name-to-sid=$DC_USERNAME",
523              "--name-to-sid=$DOMAIN/$DC_USERNAME",
524              "--user-info=$DOMAIN/$DC_USERNAME",
525              "--user-groups=$DOMAIN/$DC_USERNAME",
526              "--authenticate=$DOMAIN/$DC_USERNAME%$DC_PASSWORD",
527              "--allocate-uid",
528              "--allocate-gid"]
529
530     for t in tests:
531         plantestsuite("samba.wbinfo_simple.%s" % (t.replace(" --", ".").replace("--", "")), "%s:local" % env, [os.path.join(srcdir(), "nsswitch/tests/test_wbinfo_simple.sh"), t])
532
533     plantestsuite(
534         "samba.wbinfo_sids2xids.(%s:local)" % env, "%s:local" % env,
535         [os.path.join(samba3srcdir, "script/tests/test_wbinfo_sids2xids.sh")])
536
537     plantestsuite(
538         "samba.ntlm_auth.diagnostics(%s:local)" % env, "%s:local" % env,
539         [os.path.join(samba3srcdir, "script/tests/test_ntlm_auth_diagnostics.sh"), ntlm_auth3, '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', configuration])
540
541     plantestsuite("samba.ntlm_auth.(%s:local)" % env, "%s:local" % env, [os.path.join(samba3srcdir, "script/tests/test_ntlm_auth_s3.sh"), valgrindify(python), samba3srcdir, ntlm_auth3,  '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', configuration])
542
543 for env in ["s4member_dflt_domain", "s4member"]:
544     for cmd in ["id", "getent"]:
545         users = ["$DC_USERNAME", "$DC_USERNAME@$REALM"]
546         if env == "s4member":
547             users = ["$DOMAIN/$DC_USERNAME", "$DC_USERNAME@$REALM"]
548         for usr in users:
549             plantestsuite("samba4.winbind.dom_name_parse.cmd", env, "%s/dom_parse.sh %s %s" % (bbdir,cmd,usr))
550
551 nsstest4 = binpath("nsstest")
552 for env in ["ad_dc:local", "s4member:local", "nt4_dc:local", "ad_member:local", "nt4_member:local"]:
553     if os.path.exists(nsstest4):
554         plantestsuite("samba.nss.test using winbind(%s)" % env, env, [os.path.join(bbdir, "nsstest.sh"), nsstest4, os.path.join(samba4bindir, "shared/libnss_wrapper_winbind.so.2")])
555     else:
556         skiptestsuite("samba.nss.test using winbind(%s)" % env, "nsstest not available")
557
558 subunitrun = valgrindify(python) + " " + os.path.join(samba4srcdir, "scripting/bin/subunitrun")
559 if extra_python is not None:
560     subunitrun3 = valgrindify(extra_python) + " " + os.path.join(samba4srcdir, "scripting/bin/subunitrun")
561 def planoldpythontestsuite(env, module, name=None, extra_path=[], environ={}, extra_args=[], py3_compatible=False):
562     environ = dict(environ)
563     py_path = list(extra_path)
564     if py_path:
565         environ["PYTHONPATH"] = ":".join(["$PYTHONPATH"] + py_path)
566     args = ["%s=%s" % item for item in environ.iteritems()]
567     args += [subunitrun, "$LISTOPT", "$LOADLIST", module]
568     args += extra_args
569     if name is None:
570         name = module
571     plantestsuite_loadlist(name, env, args)
572     if py3_compatible and extra_python is not None:
573         args[args.index(subunitrun)] = subunitrun3
574         plantestsuite_loadlist(name, env, args)
575
576
577 planoldpythontestsuite("ad_dc_ntvfs:local", "samba.tests.gensec", extra_args=['-U"$USERNAME%$PASSWORD"'], py3_compatible=True)
578 planoldpythontestsuite("none", "simple", extra_path=["%s/lib/tdb/python/tests" % srcdir()], name="tdb.python")
579 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dcerpc.sam")
580 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dsdb", py3_compatible=True)
581 planpythontestsuite("none", "samba.tests.dsdb_lock")
582 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dcerpc.bare")
583 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dcerpc.unix")
584 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dcerpc.srvsvc")
585 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.samba_tool.timecmd")
586 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.samba_tool.join")
587
588 planpythontestsuite("none", "samba.tests.samba_tool.visualize")
589
590
591 # test fsmo show
592 for env in ["ad_dc_ntvfs", "fl2000dc", "fl2003dc", "fl2008r2dc"]:
593     planpythontestsuite(env + ":local", "samba.tests.samba_tool.fsmo")
594
595 # test user.edit
596 for env in ["ad_dc:local", "ad_dc_ntvfs:local", "fl2000dc:local", "fl2003dc:local", "fl2008r2dc:local"]:
597     plantestsuite("samba.tests.samba_tool.edit", env, [os.path.join(srcdir(), "python/samba/tests/samba_tool/edit.sh"), '$SERVER', '$USERNAME', '$PASSWORD'])
598
599 # We run this test against both AD DC implemetnations because it is
600 # the only test we have of GPO get/set behaviour, and this involves
601 # the file server as well as the LDAP server.
602 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.samba_tool.gpo")
603 planpythontestsuite("ad_dc:local", "samba.tests.samba_tool.gpo")
604
605 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.samba_tool.processes")
606 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.samba_tool.user")
607 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.samba_tool.user_wdigest")
608 planpythontestsuite("ad_dc:local", "samba.tests.samba_tool.user")
609 planpythontestsuite("ad_dc:local", "samba.tests.samba_tool.user_virtualCryptSHA")
610 planpythontestsuite("chgdcpass:local", "samba.tests.samba_tool.user_check_password_script")
611 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.samba_tool.group")
612 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.samba_tool.ou")
613 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.samba_tool.computer")
614 planpythontestsuite("ad_dc:local", "samba.tests.samba_tool.ntacl")
615 planpythontestsuite("none", "samba.tests.samba_tool.provision_password_check")
616 planpythontestsuite("none", "samba.tests.samba_tool.help")
617
618 # Run these against chgdcpass to share the runtime load
619 planpythontestsuite("chgdcpass:local", "samba.tests.samba_tool.sites")
620 planpythontestsuite("chgdcpass:local", "samba.tests.samba_tool.dnscmd")
621
622 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dcerpc.rpcecho")
623
624 planoldpythontestsuite("nt4_dc", "samba.tests.netbios", extra_args=['-U"$USERNAME%$PASSWORD"'], py3_compatible=True)
625 planoldpythontestsuite("ad_dc:local", "samba.tests.gpo", extra_args=['-U"$USERNAME%$PASSWORD"'], py3_compatible=True)
626 planoldpythontestsuite("ad_dc:local", "samba.tests.dckeytab", extra_args=['-U"$USERNAME%$PASSWORD"'], py3_compatible=True)
627 planoldpythontestsuite("ad_dc:local", "samba.tests.smb", extra_args=['-U"$USERNAME%$PASSWORD"'], py3_compatible=True)
628
629 planoldpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dcerpc.registry", extra_args=['-U"$USERNAME%$PASSWORD"'])
630 planoldpythontestsuite("ad_dc_ntvfs", "samba.tests.dcerpc.dnsserver", extra_args=['-U"$USERNAME%$PASSWORD"'])
631 planoldpythontestsuite("ad_dc", "samba.tests.dcerpc.dnsserver", extra_args=['-U"$USERNAME%$PASSWORD"'])
632 planoldpythontestsuite("chgdcpass", "samba.tests.dcerpc.raw_protocol", extra_args=['-U"$USERNAME%$PASSWORD"'])
633 if have_heimdal_support:
634     planoldpythontestsuite("ad_dc:local", "samba.tests.auth_log", extra_args=['-U"$USERNAME%$PASSWORD"'],
635                            environ={'CLIENT_IP': '127.0.0.11',
636                                     'SOCKET_WRAPPER_DEFAULT_IFACE': 11})
637     planoldpythontestsuite("ad_dc_ntvfs:local", "samba.tests.auth_log", extra_args=['-U"$USERNAME%$PASSWORD"'],
638                            environ={'CLIENT_IP': '127.0.0.11',
639                                     'SOCKET_WRAPPER_DEFAULT_IFACE': 11})
640     planoldpythontestsuite("ad_dc:local", "samba.tests.auth_log_pass_change", extra_args=['-U"$USERNAME%$PASSWORD"'],
641                            environ={'CLIENT_IP': '127.0.0.11',
642                                     'SOCKET_WRAPPER_DEFAULT_IFACE': 11})
643     planoldpythontestsuite("ad_dc_ntvfs:local", "samba.tests.auth_log_pass_change", extra_args=['-U"$USERNAME%$PASSWORD"'],
644                            environ={'CLIENT_IP': '127.0.0.11',
645                                     'SOCKET_WRAPPER_DEFAULT_IFACE': 11})
646     planoldpythontestsuite("ad_dc_ntvfs:local", "samba.tests.auth_log_ncalrpc", extra_args=['-U"$USERNAME%$PASSWORD"'])
647     planoldpythontestsuite("ad_dc:local", "samba.tests.auth_log_ncalrpc", extra_args=['-U"$USERNAME%$PASSWORD"'])
648     planoldpythontestsuite("ad_dc:local", "samba.tests.auth_log_samlogon",
649                            extra_args=['-U"$USERNAME%$PASSWORD"'],
650                            environ={'CLIENT_IP': '127.0.0.11',
651                                     'SOCKET_WRAPPER_DEFAULT_IFACE': 11})
652     planoldpythontestsuite("ad_dc_ntvfs:local", "samba.tests.auth_log_samlogon",
653                            extra_args=['-U"$USERNAME%$PASSWORD"'],
654                            environ={'CLIENT_IP': '127.0.0.11',
655                                     'SOCKET_WRAPPER_DEFAULT_IFACE': 11})
656     planoldpythontestsuite("ad_dc:local", "samba.tests.auth_log_netlogon",
657                            extra_args=['-U"$USERNAME%$PASSWORD"'],
658                            environ={'CLIENT_IP': '127.0.0.11',
659                                     'SOCKET_WRAPPER_DEFAULT_IFACE': 11})
660     planoldpythontestsuite("ad_dc_ntvfs:local", "samba.tests.auth_log_netlogon",
661                            extra_args=['-U"$USERNAME%$PASSWORD"'],
662                            environ={'CLIENT_IP': '127.0.0.11',
663                                     'SOCKET_WRAPPER_DEFAULT_IFACE': 11})
664     planoldpythontestsuite("ad_dc:local",
665                            "samba.tests.auth_log_netlogon_bad_creds",
666                            extra_args=['-U"$USERNAME%$PASSWORD"'],
667                            environ={'CLIENT_IP': '127.0.0.11',
668                                     'SOCKET_WRAPPER_DEFAULT_IFACE': 11})
669     planoldpythontestsuite("ad_dc_ntvfs:local",
670                            "samba.tests.auth_log_netlogon_bad_creds",
671                            extra_args=['-U"$USERNAME%$PASSWORD"'],
672                            environ={'CLIENT_IP': '127.0.0.11',
673                                     'SOCKET_WRAPPER_DEFAULT_IFACE': 11})
674 planoldpythontestsuite("ad_dc",
675                        "samba.tests.net_join_no_spnego",
676                        extra_args=['-U"$USERNAME%$PASSWORD"'])
677 planoldpythontestsuite("ad_dc",
678                        "samba.tests.net_join",
679                        extra_args=['-U"$USERNAME%$PASSWORD"'])
680 # Need to test the password hashing in multiple environments to ensure that
681 # all the possible options are covered
682 #
683 # ad_dc:local functional_level >= 2008, gpg keys available
684 planoldpythontestsuite("ad_dc:local",
685                        "samba.tests.password_hash_gpgme",
686                        extra_args=['-U"$USERNAME%$PASSWORD"'])
687 # ad_dc_ntvfs:local functional level >= 2008, gpg keys not available
688 planoldpythontestsuite("ad_dc_ntvfs:local",
689                        "samba.tests.password_hash_fl2008",
690                        extra_args=['-U"$USERNAME%$PASSWORD"'])
691 # fl2003dc:local functional level < 2008, gpg keys not available
692 planoldpythontestsuite("fl2003dc:local",
693                        "samba.tests.password_hash_fl2003",
694                        extra_args=['-U"$USERNAME%$PASSWORD"'])
695 # ad_dc: wDigest values over ldap
696 planoldpythontestsuite("ad_dc",
697                        "samba.tests.password_hash_ldap",
698                        extra_args=['-U"$USERNAME%$PASSWORD"'])
699 # Encrypted secrets
700 # ensure default provision (ad_dc) and join (vampire_dc)
701 # encrypt secret values on disk.
702 planoldpythontestsuite("ad_dc:local",
703                        "samba.tests.encrypted_secrets",
704                        extra_args=['-U"$USERNAME%$PASSWORD"'])
705 planoldpythontestsuite("vampire_dc:local",
706                        "samba.tests.encrypted_secrets",
707                        extra_args=['-U"$USERNAME%$PASSWORD"'])
708 # The fl2000dc environment is provisioned with the --plaintext_secrets option
709 # so this test will fail, which proves the secrets are not being encrypted.
710 # There is an entry in known_fail.d.
711 planoldpythontestsuite("fl2000dc:local",
712                        "samba.tests.encrypted_secrets",
713                        extra_args=['-U"$USERNAME%$PASSWORD"'])
714
715 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.lsa_string")
716 planoldpythontestsuite("ad_dc_ntvfs",
717                        "samba.tests.krb5_credentials",
718                        extra_args=['-U"$USERNAME%$PASSWORD"'])
719 for env in ["ad_dc_ntvfs", "vampire_dc", "promoted_dc"]:
720     planoldpythontestsuite(env,
721                            "samba.tests.py_credentials",
722                            extra_args=['-U"$USERNAME%$PASSWORD"'])
723 planoldpythontestsuite("ad_dc_ntvfs",
724                        "samba.tests.emulate.traffic",
725                        extra_args=['-U"$USERNAME%$PASSWORD"'])
726 planoldpythontestsuite("ad_dc_ntvfs",
727                        "samba.tests.emulate.traffic_packet",
728                        extra_args=['-U"$USERNAME%$PASSWORD"'])
729 planoldpythontestsuite("ad_dc_ntvfs",
730                        "samba.tests.blackbox.traffic_replay",
731                        extra_args=['-U"$USERNAME%$PASSWORD"'])
732 planoldpythontestsuite("ad_dc_ntvfs",
733                        "samba.tests.blackbox.traffic_learner",
734                        extra_args=['-U"$USERNAME%$PASSWORD"'])
735 planoldpythontestsuite("ad_dc_ntvfs",
736                        "samba.tests.blackbox.traffic_summary",
737                        extra_args=['-U"$USERNAME%$PASSWORD"'])
738 #
739 # Want a selection of environments across the process models
740 #
741 for env in ["ad_dc_ntvfs:local", "ad_dc:local",
742             "fl2003dc:local", "fl2008r2dc:local",
743             "promoted_dc:local"]:
744     planoldpythontestsuite(env, "samba.tests.blackbox.smbcontrol")
745
746 plantestsuite_loadlist("samba4.ldap.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/ldap.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
747 plantestsuite_loadlist("samba4.tokengroups.krb5.python(ad_dc_ntvfs)", "ad_dc_ntvfs:local", [python, os.path.join(samba4srcdir, "dsdb/tests/python/token_group.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '-k', 'yes', '$LOADLIST', '$LISTOPT'])
748 plantestsuite_loadlist("samba4.tokengroups.ntlm.python(ad_dc_ntvfs)", "ad_dc_ntvfs:local", [python, os.path.join(samba4srcdir, "dsdb/tests/python/token_group.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '-k', 'no', '$LOADLIST', '$LISTOPT'])
749 plantestsuite("samba4.sam.python(fl2008r2dc)", "fl2008r2dc", [python, os.path.join(samba4srcdir, "dsdb/tests/python/sam.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
750 plantestsuite("samba4.sam.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/sam.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
751 plantestsuite("samba4.user_account_control.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/user_account_control.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
752 planoldpythontestsuite("ad_dc_ntvfs", "dsdb_schema_info",
753         extra_path=[os.path.join(samba4srcdir, 'dsdb/tests/python')],
754         name="samba4.schemaInfo.python(ad_dc_ntvfs)",
755         extra_args=['-U"$DOMAIN/$DC_USERNAME%$DC_PASSWORD"'])
756
757 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dsdb_schema_attributes")
758
759 plantestsuite_loadlist("samba4.urgent_replication.python(ad_dc_ntvfs)", "ad_dc_ntvfs:local", [python, os.path.join(samba4srcdir, "dsdb/tests/python/urgent_replication.py"), '$PREFIX_ABS/ad_dc_ntvfs/private/sam.ldb', '$LOADLIST', '$LISTOPT'])
760 plantestsuite_loadlist("samba4.ldap.dirsync.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/dirsync.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
761 plantestsuite_loadlist("samba4.ldap.match_rules.python", "ad_dc_ntvfs", [python, os.path.join(srcdir(), "lib/ldb-samba/tests/match_rules.py"), '$PREFIX_ABS/ad_dc_ntvfs/private/sam.ldb', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
762 plantestsuite_loadlist("samba4.ldap.notification.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/notification.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
763 plantestsuite_loadlist("samba4.ldap.sites.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/sites.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
764
765 plantestsuite_loadlist("samba4.ldap.sort.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/sort.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
766 plantestsuite_loadlist("samba4.ldap.vlv.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/vlv.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
767 plantestsuite_loadlist("samba4.ldap.linked_attributes.python(ad_dc_ntvfs)", "ad_dc_ntvfs:local", [python, os.path.join(samba4srcdir, "dsdb/tests/python/linked_attributes.py"), '$PREFIX_ABS/ad_dc_ntvfs/private/sam.ldb', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
768
769 plantestsuite_loadlist("samba4.ldap.rodc.python(rodc)", "rodc",
770                        [python,
771                         os.path.join(samba4srcdir, "dsdb/tests/python/rodc.py"),
772                         '$SERVER', '-U"$USERNAME%$PASSWORD"',
773                         '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
774
775 plantestsuite_loadlist("samba4.ldap.rodc_rwdc.python(rodc)", "rodc:local",
776                        [python,
777                         os.path.join(samba4srcdir,
778                                      "dsdb/tests/python/rodc_rwdc.py"),
779                         '$SERVER', '$DC_SERVER', '-U"$USERNAME%$PASSWORD"',
780                         '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
781
782 planoldpythontestsuite("rodc:local", "replica_sync_rodc",
783                        extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
784                        name="samba4.drs.replica_sync_rodc.python(rodc)",
785                        environ={'DC1': '$DC_SERVER', 'DC2': '$RODC_DC_SERVER'},
786                        extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
787
788 for env in ["ad_dc_ntvfs", "fl2000dc", "fl2003dc", "fl2008r2dc"]:
789     plantestsuite_loadlist("samba4.ldap_schema.python(%s)" % env, env, [python, os.path.join(samba4srcdir, "dsdb/tests/python/ldap_schema.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
790     plantestsuite("samba4.ldap.possibleInferiors.python(%s)" % env, env, [python, os.path.join(samba4srcdir, "dsdb/samdb/ldb_modules/tests/possibleinferiors.py"), "ldap://$SERVER", '-U"$USERNAME%$PASSWORD"', "-W$DOMAIN"])
791     plantestsuite_loadlist("samba4.ldap.secdesc.python(%s)" % env, env, [python, os.path.join(samba4srcdir, "dsdb/tests/python/sec_descriptor.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
792     plantestsuite_loadlist("samba4.ldap.acl.python(%s)" % env, env, [python, os.path.join(samba4srcdir, "dsdb/tests/python/acl.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
793     if env != "fl2000dc":
794         # This test makes excessive use of the "userPassword" attribute which
795         # isn't available on DCs with Windows 2000 domain function level -
796         # therefore skip it in that configuration
797         plantestsuite_loadlist("samba4.ldap.passwords.python(%s)" % env, env, [python, os.path.join(samba4srcdir, "dsdb/tests/python/passwords.py"), "$SERVER", '-U"$USERNAME%$PASSWORD"', "-W$DOMAIN", '$LOADLIST', '$LISTOPT'])
798
799 for env in ["ad_dc_ntvfs"]:
800     # This test takes a lot of time, so we run it against a minimum of
801     # environments, please only add new ones if there's really a
802     # difference we need to test
803     plantestsuite_loadlist("samba4.ldap.password_lockout.python(%s)" % env, env, [python, os.path.join(samba4srcdir, "dsdb/tests/python/password_lockout.py"), "$SERVER", '-U"$USERNAME%$PASSWORD"', "-W$DOMAIN", "--realm=$REALM", '$LOADLIST', '$LISTOPT'])
804     planoldpythontestsuite(env, "tombstone_reanimation",
805                            name="samba4.tombstone_reanimation.python",
806                            environ={'TEST_SERVER': '$SERVER', 'TEST_USERNAME': '$USERNAME', 'TEST_PASSWORD': '$PASSWORD'},
807                            extra_path=[os.path.join(samba4srcdir, 'dsdb/tests/python')]
808                            )
809
810 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.upgradeprovisionneeddc")
811 planpythontestsuite("ad_dc:local", "samba.tests.posixacl", py3_compatible=True)
812 planpythontestsuite("ad_dc_no_nss:local", "samba.tests.posixacl", py3_compatible=True)
813 plantestsuite_loadlist("samba4.deletetest.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/deletetest.py"),
814                                                      '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
815 plantestsuite("samba4.blackbox.samba3dump", "none", [os.path.join(samba4srcdir, "selftest/test_samba3dump.sh")])
816 plantestsuite("samba4.blackbox.upgrade", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_s3upgrade.sh"), '$PREFIX/provision'])
817 plantestsuite("samba4.blackbox.provision.py", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_provision.sh"), '$PREFIX/provision'])
818 plantestsuite("samba4.blackbox.supported_features", "none",
819               ["PYTHON=%s" % python,
820                os.path.join(samba4srcdir,
821                             "setup/tests/blackbox_supported_features.sh"),
822                '$PREFIX/provision'])
823 plantestsuite("samba4.blackbox.upgradeprovision.current", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_upgradeprovision.sh"), '$PREFIX/provision'])
824 plantestsuite("samba4.blackbox.setpassword.py", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_setpassword.sh"), '$PREFIX/provision'])
825 plantestsuite("samba4.blackbox.newuser.py", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_newuser.sh"), '$PREFIX/provision'])
826 plantestsuite("samba4.blackbox.group.py", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_group.sh"), '$PREFIX/provision'])
827 plantestsuite("samba4.blackbox.spn.py(ad_dc_ntvfs:local)", "ad_dc_ntvfs:local", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_spn.sh"), '$PREFIX/ad_dc_ntvfs'])
828 plantestsuite_loadlist("samba4.ldap.bind(fl2008r2dc)", "fl2008r2dc", [python, os.path.join(srcdir(), "auth/credentials/tests/bind.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '$LOADLIST', '$LISTOPT'])
829
830 # This makes sure we test the rid allocation code
831 t = "rpc.samr.large-dc"
832 plansmbtorture4testsuite(t, "vampire_dc", ['$SERVER', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], modname=("samba4.%s.one" % t))
833 plansmbtorture4testsuite(t, "vampire_dc", ['$SERVER', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], modname="samba4.%s.two" % t)
834
835 # some RODC testing
836 for env in ['rodc']:
837     plansmbtorture4testsuite('rpc.echo', env, ['ncacn_np:$SERVER', "-k", "yes", '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], modname="samba4.rpc.echo")
838     plansmbtorture4testsuite('rpc.echo', "%s:local" % env, ['ncacn_np:$SERVER', "-k", "yes", '-P', '--workgroup=$DOMAIN'], modname="samba4.rpc.echo")
839     plansmbtorture4testsuite('rpc.echo', "%s:local" % env, ['ncacn_np:$SERVER', "-k", "no", '-Utestallowed\ account%$DC_PASSWORD', '--workgroup=$DOMAIN'], modname="samba4.rpc.echo.testallowed")
840     plansmbtorture4testsuite('rpc.echo', "%s:local" % env, ['ncacn_np:$SERVER', "-k", "no", '-Utestdenied%$DC_PASSWORD', '--workgroup=$DOMAIN'], modname="samba4.rpc.echo.testdenied")
841     plantestsuite("samba4.blackbox.smbclient(%s:local)" % env, "%s:local" % env, [os.path.join(samba4srcdir, "utils/tests/test_smbclient.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$DOMAIN', smbclient4])
842
843 planpythontestsuite("rodc:local", "samba.tests.samba_tool.rodc")
844
845 plantestsuite("samba.blackbox.rpcclient_samlogon", "rodc:local", [os.path.join(samba3srcdir, "script/tests/test_rpcclient_samlogon.sh"),
846                                                                   "$DC_USERNAME", "$DC_PASSWORD", "ncacn_np:$SERVER", configuration])
847
848 plantestsuite("samba.blackbox.rpcclient_samlogon_testallowed", "rodc:local", [os.path.join(samba3srcdir, "script/tests/test_rpcclient_samlogon.sh"),
849                                                                               "testallowed\ account", "$DC_PASSWORD", "ncacn_np:$SERVER", configuration])
850
851 plantestsuite("samba.blackbox.rpcclient_samlogon_testdenied", "rodc:local", [os.path.join(samba3srcdir, "script/tests/test_rpcclient_samlogon.sh"),
852                                                                              "testdenied", "$DC_PASSWORD", "ncacn_np:$SERVER", configuration])
853
854
855
856 plantestsuite("samba4.blackbox.provision-backend", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_provision-backend.sh"), '$PREFIX/provision'])
857
858 # Test renaming the DC
859 plantestsuite("samba4.blackbox.renamedc.sh", "none", ["PYTHON=%s" % python, os.path.join(bbdir, "renamedc.sh"), '$PREFIX/provision'])
860
861 # DRS python tests
862
863 env = 'vampire_dc'
864 planoldpythontestsuite(env, "ridalloc_exop",
865                        extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
866                        name="samba4.drs.ridalloc_exop.python(%s)" % env,
867                        environ={'DC1': "$DC_SERVER", 'DC2': '$%s_SERVER' % env.upper()},
868                        extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
869
870 for env in ['vampire_dc', 'promoted_dc']:
871     planoldpythontestsuite("%s:local" % env, "samba_tool_drs",
872                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
873                            name="samba4.drs.samba_tool_drs.python(%s)" % env,
874                            environ={'DC1': '$DC_SERVER', 'DC2': '$%s_SERVER' % env.upper()},
875                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
876     planoldpythontestsuite("%s:local" % env, "samba_tool_drs_showrepl",
877                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
878                            name="samba4.drs.samba_tool_drs_showrepl.python(%s)" % env,
879                            environ={'DC1': '$DC_SERVER', 'DC2': '$%s_SERVER' % env.upper()},
880                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
881     planoldpythontestsuite("%s:local" % env, "replica_sync",
882                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
883                            name="samba4.drs.replica_sync.python(%s)" % env,
884                            environ={'DC1': '$DC_SERVER', 'DC2': '$%s_SERVER' % env.upper()},
885                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
886     planoldpythontestsuite(env, "delete_object",
887                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
888                            name="samba4.drs.delete_object.python(%s)" % env,
889                            environ={'DC1': '$DC_SERVER', 'DC2': '$%s_SERVER' % env.upper()},
890                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
891     planoldpythontestsuite(env, "fsmo",
892                            name="samba4.drs.fsmo.python(%s)" % env,
893                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
894                            environ={'DC1': "$DC_SERVER", 'DC2': '$%s_SERVER' % env.upper()},
895                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
896     planoldpythontestsuite(env, "repl_move",
897                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
898                            name="samba4.drs.repl_move.python(%s)" % env,
899                            environ={'DC1': "$DC_SERVER", 'DC2': '$%s_SERVER' % env.upper()},
900                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
901     planoldpythontestsuite(env, "getnc_exop",
902                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
903                            name="samba4.drs.getnc_exop.python(%s)" % env,
904                            environ={'DC1': "$DC_SERVER", 'DC2': '$%s_SERVER' % env.upper()},
905                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
906     planoldpythontestsuite(env, "getnc_unpriv",
907                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
908                            name="samba4.drs.getnc_unpriv.python(%s)" % env,
909                            environ={'DC1': "$DC_SERVER", 'DC2': '$%s_SERVER' % env.upper()},
910                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
911     planoldpythontestsuite(env, "linked_attributes_drs",
912                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
913                            name="samba4.drs.linked_attributes_drs.python(%s)" % env,
914                            environ={'DC1': "$DC_SERVER", 'DC2': '$%s_SERVER' % env.upper()},
915                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
916     planoldpythontestsuite(env, "link_conflicts",
917                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
918                            name="samba4.drs.link_conflicts.python(%s)" % env,
919                            environ={'DC1': "$DC_SERVER", 'DC2': '$%s_SERVER' % env.upper()},
920                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
921
922 for env in ['vampire_dc', 'promoted_dc', 'vampire_2000_dc']:
923     planoldpythontestsuite(env, "repl_schema",
924                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
925                            name="samba4.drs.repl_schema.python(%s)" % env,
926                            environ={'DC1': "$DC_SERVER", 'DC2': '$%s_SERVER' % env.upper()},
927                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
928
929 # A side-effect of the getncchanges tests is that they will create hundreds of
930 # tombstone objects, so run them last to avoid interferring with (and slowing
931 # down) the other DRS tests
932 for env in ['vampire_dc', 'promoted_dc']:
933     planoldpythontestsuite(env, "getncchanges",
934                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
935                            name="samba4.drs.getncchanges.python(%s)" % env,
936                            environ={'DC1': "$DC_SERVER", 'DC2': '$%s_SERVER' % env.upper()},
937                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
938
939 for env in ['ad_dc_ntvfs']:
940     planoldpythontestsuite(env, "repl_rodc",
941                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
942                            name="samba4.drs.repl_rodc.python(%s)" % env,
943                            environ={'DC1': "$DC_SERVER", 'DC2': '$DC_SERVER'},
944                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
945     planoldpythontestsuite(env, "samba.tests.join",
946                            name="samba.tests.join.python(%s)" % env,
947                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
948     planoldpythontestsuite(env, "cracknames",
949                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
950                            name="samba4.drs.cracknames.python(%s)" % env,
951                            environ={'DC1': "$DC_SERVER", 'DC2': '$DC_SERVER'},
952                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
953
954 planoldpythontestsuite("chgdcpass:local", "samba.tests.blackbox.samba_dnsupdate",
955                        environ={'DNS_SERVER_IP': '$SERVER_IP'})
956
957 for env in ["ad_dc_ntvfs", "s4member", "rodc", "promoted_dc", "ad_dc", "ad_member"]:
958     plantestsuite("samba.blackbox.wbinfo(%s:local)" % env, "%s:local" % env, [os.path.join(samba4srcdir, "../nsswitch/tests/test_wbinfo.sh"), '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', env])
959
960 #
961 # KDC Tests
962 #
963
964 # This test is for users cached at the RODC
965 plansmbtorture4testsuite('krb5.kdc', "rodc", ['ncacn_np:$SERVER_IP', "-k", "yes", '-Utestdenied%$PASSWORD',
966                                               '--workgroup=$DOMAIN', '--realm=$REALM',
967                                               '--option=torture:krb5-upn=testdenied_upn@$REALM.upn',
968                                               '--option=torture:expect_rodc=true'],
969                          "samba4.krb5.kdc with account DENIED permission to replicate to an RODC")
970 plansmbtorture4testsuite('krb5.kdc', "rodc", ['ncacn_np:$SERVER_IP', "-k", "yes", '-Utestallowed\ account%$PASSWORD',
971                                               '--workgroup=$DOMAIN', '--realm=$REALM',
972                                               '--option=torture:expect_machine_account=true',
973                                               '--option=torture:krb5-upn=testallowed\ upn@$REALM',
974                                               '--option=torture:krb5-hostname=testallowed',
975                                               '--option=torture:expect_rodc=true',
976                                               '--option=torture:expect_cached_at_rodc=true'],
977                          "samba4.krb5.kdc with account ALLOWED permission to replicate to an RODC")
978
979 # This ensures we have correct behaviour on a server that is not not the PDC emulator
980 env="promoted_dc"
981 plansmbtorture4testsuite('krb5.kdc', env, ['ncacn_np:$SERVER_IP', "-k", "yes", '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', '--realm=$REALM'],
982                          "samba4.krb5.kdc with specified account")
983
984
985 for env in ["rodc", "promoted_dc", "fl2000dc", "fl2008r2dc"]:
986     if env == "rodc":
987         # The machine account is cached at the RODC, as it is the local account
988         extra_options = ['--option=torture:expect_rodc=true', '--option=torture:expect_cached_at_rodc=true']
989     else:
990         extra_options = []
991
992     plansmbtorture4testsuite('krb5.kdc', "%s:local" % env, ['ncacn_np:$SERVER_IP', "-k", "yes", '-P',
993                                             '--workgroup=$DOMAIN', '--realm=$REALM',
994                                             '--option=torture:krb5-hostname=$SERVER',
995                                             '--option=torture:run_removedollar_test=true',
996                                             '--option=torture:expect_machine_account=true'] + extra_options,
997                              "samba4.krb5.kdc with machine account")
998
999
1000 for env in [
1001         'vampire_dc',
1002         'promoted_dc']:
1003     planoldpythontestsuite(env, "samba.tests.kcc",
1004                            name="samba.tests.kcc",
1005                            environ={'TEST_SERVER': '$SERVER', 'TEST_USERNAME': '$USERNAME',
1006                                     'TEST_PASSWORD': '$PASSWORD',
1007                                     'TEST_ENV': env
1008                                 },
1009                            extra_path=[os.path.join(srcdir(), "samba/python"), ]
1010                            )
1011     planpythontestsuite(env, "samba.tests.samba_tool.visualize_drs")
1012
1013 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.kcc.kcc_utils")
1014
1015 for env in [ "simpleserver", "fileserver", "nt4_dc", "ad_dc", "ad_dc_ntvfs", "ad_member"]:
1016     planoldpythontestsuite(env, "netlogonsvc",
1017                            extra_path=[os.path.join(srcdir(), 'python/samba/tests')],
1018                            name="samba.tests.netlogonsvc.python(%s)" % env)
1019
1020 for env in [ "ktest", "ad_member", "ad_dc_no_ntlm" ]:
1021     planoldpythontestsuite(env, "ntlmdisabled",
1022                            extra_path=[os.path.join(srcdir(), 'python/samba/tests')],
1023                            name="samba.tests.ntlmdisabled.python(%s)" % env)
1024
1025 # Demote the vampire DC, it must be the last test each DC, before the dbcheck
1026 for env in ['vampire_dc', 'promoted_dc', 'rodc']:
1027     plantestsuite("samba4.blackbox.samba_tool_demote(%s)" % env, env, [os.path.join(samba4srcdir, "utils/tests/test_demote.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$DOMAIN', '$DC_SERVER', '$PREFIX/%s' % env, smbclient4])
1028
1029 # TODO: Verifying the databases really should be a part of the
1030 # environment teardown.
1031 # check the databases are all OK. PLEASE LEAVE THIS AS THE LAST TEST
1032 for env in ["ad_dc_ntvfs", "ad_dc", "fl2000dc", "fl2003dc", "fl2008r2dc", 'vampire_dc', 'promoted_dc']:
1033     plantestsuite("samba4.blackbox.dbcheck(%s)" % env, env + ":local" , ["PYTHON=%s" % python, os.path.join(bbdir, "dbcheck.sh"), '$PREFIX/provision', configuration])
1034
1035 # cmocka tests not requiring a specific encironment
1036 #
1037 plantestsuite("samba4.dsdb.samdb.ldb_modules.unique_object_sids" , "none",
1038               [os.path.join(bindir(), "test_unique_object_sids")])
1039 plantestsuite("samba4.dsdb.samdb.ldb_modules.encrypted_secrets", "none",
1040                   [os.path.join(bindir(), "test_encrypted_secrets")])