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