774b874edbd412e0b66bef12139539ef172cdee1
[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
21 import os
22 import sys
23 sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../../selftest"))
24 import selftesthelpers
25 from selftesthelpers import bindir, srcdir, binpath, python
26 from selftesthelpers import configuration, plantestsuite
27 from selftesthelpers import planpythontestsuite, planperltestsuite
28 from selftesthelpers import plantestsuite_loadlist
29 from selftesthelpers import skiptestsuite, source4dir, valgrindify
30 from selftesthelpers import smbtorture4_options, smbtorture4_testsuites
31 from selftesthelpers import smbtorture4, ntlm_auth3, samba3srcdir
32
33
34 print("OPTIONS %s" % " ".join(smbtorture4_options), file=sys.stderr)
35
36
37 def plansmbtorture4testsuite(name, env, options, modname=None, environ={}):
38     return selftesthelpers.plansmbtorture4testsuite(name,
39                                                     env,
40                                                     options,
41                                                     target='samba4',
42                                                     modname=modname,
43                                                     environ=environ)
44
45
46 samba4srcdir = source4dir()
47 DSDB_PYTEST_DIR = os.path.join(samba4srcdir, "dsdb/tests/python/")
48
49 samba4bindir = bindir()
50 validate = os.getenv("VALIDATE", "")
51 if validate:
52     validate_list = [validate]
53 else:
54     validate_list = []
55
56 nmblookup4 = binpath('nmblookup4')
57 smbclient4 = binpath('smbclient4')
58 smbclient3 = binpath('smbclient')
59
60 bbdir = os.path.join(srcdir(), "testprogs/blackbox")
61
62 # alias to highlight what tests we want to run against a DC with SMBv1 disabled
63 smbv1_disabled_testenv = "restoredc"
64
65 all_fl_envs = ["fl2000dc", "fl2003dc", "fl2008dc", "fl2008r2dc"]
66
67 # Simple tests for LDAP and CLDAP
68 for auth_type in ['', '-k no', '-k yes']:
69     for auth_level in ['--option=clientldapsaslwrapping=plain', '--client-protection=sign', '--client-protection=encrypt']:
70         creds = '-U"$USERNAME%$PASSWORD"'
71         options = creds + ' ' + auth_type + ' ' + auth_level
72         plantestsuite("samba4.ldb.ldap with options %r(ad_dc_default)" % options, "ad_dc_default", "%s/test_ldb.sh ldap $SERVER %s" % (bbdir, options))
73
74 # see if we support ADS on the Samba3 side
75 try:
76     config_h = os.environ["CONFIG_H"]
77 except KeyError:
78     config_h = os.path.join(samba4bindir, "default/include/config.h")
79
80 # check available features
81 config_hash = dict()
82 f = open(config_h, 'r')
83 try:
84     lines = f.readlines()
85     config_hash = dict((x[0], ' '.join(x[1:]))
86                        for x in map(lambda line: line.strip().split(' ')[1:],
87                                     list(filter(lambda line: (line[0:7] == '#define') and (len(line.split(' ')) > 2), lines))))
88 finally:
89     f.close()
90
91 have_heimdal_support = ("SAMBA4_USES_HEIMDAL" in config_hash)
92 have_gnutls_fips_mode_support = ("HAVE_GNUTLS_FIPS_MODE_SUPPORTED" in config_hash)
93
94 for options in ['-U"$USERNAME%$PASSWORD"']:
95     plantestsuite("samba4.ldb.ldaps with options %s(ad_dc_ntvfs)" % options, "ad_dc_ntvfs",
96                   "%s/test_ldb.sh ldaps $SERVER_IP %s" % (bbdir, options))
97
98 creds_options = [
99     '--simple-bind-dn=$USERNAME@$REALM --password=$PASSWORD',
100 ]
101 peer_options = {
102     'SERVER_IP': '$SERVER_IP',
103     'SERVER_NAME': '$SERVER',
104     'SERVER.REALM': '$SERVER.$REALM',
105 }
106 tls_verify_options = [
107     '--option="tlsverifypeer=no_check"',
108     '--option="tlsverifypeer=ca_only"',
109     '--option="tlsverifypeer=ca_and_name_if_available"',
110     '--option="tlsverifypeer=ca_and_name"',
111     '--option="tlsverifypeer=as_strict_as_possible"',
112 ]
113
114 # we use :local for fl2008r2dc because of the self-signed certificate
115 for env in ["ad_dc_ntvfs", "fl2008r2dc:local"]:
116     for peer_key in peer_options.keys():
117         peer_val = peer_options[peer_key]
118         for creds in creds_options:
119             for tls_verify in tls_verify_options:
120                 options = creds + ' ' + tls_verify
121                 plantestsuite("samba4.ldb.simple.ldaps with options %s %s(%s)" % (
122                               peer_key, options, env), env,
123                               "%s/test_ldb_simple.sh ldaps %s %s" % (bbdir, peer_val, options))
124
125 # test all "ldap server require strong auth" combinations
126 for env in ["ad_dc_ntvfs", "fl2008r2dc", "fl2003dc"]:
127     options = '--simple-bind-dn="$USERNAME@$REALM" --password="$PASSWORD"'
128     plantestsuite("samba4.ldb.simple.ldap with SIMPLE-BIND %s(%s)" % (options, env),
129                   env, "%s/test_ldb_simple.sh ldap $SERVER %s" % (bbdir, options))
130     options += ' --option="tlsverifypeer=no_check"'
131     plantestsuite("samba4.ldb.simple.ldaps with SIMPLE-BIND %s(%s)" % (options, env),
132                   env, "%s/test_ldb_simple.sh ldaps $SERVER %s" % (bbdir, options))
133
134     auth_options = [
135         '--option=clientldapsaslwrapping=plain',
136         '--client-protection=sign',
137         '--client-protection=encrypt',
138         '--use-kerberos=required --option=clientldapsaslwrapping=plain',
139         '--use-kerberos=required --client-protection=sign',
140         '--use-kerberos=required --client-protection=encrypt',
141         '--use-kerberos=disabled --option=clientldapsaslwrapping=plain',
142         '--use-kerberos=disabled --client-protection=sign --option=ntlmssp_client:ldap_style_send_seal=no',
143         '--use-kerberos=disabled --client-protection=sign',
144         '--use-kerberos=disabled --client-protection=encrypt',
145     ]
146
147     for auth_option in auth_options:
148         options = '-U"$USERNAME%$PASSWORD"' + ' ' + auth_option
149         plantestsuite("samba4.ldb.simple.ldap with SASL-BIND %s(%s)" % (options, env),
150                       env, "%s/test_ldb_simple.sh ldap $SERVER %s" % (bbdir, options))
151     options = '-U"$USERNAME%$PASSWORD" --option="tlsverifypeer=no_check"'
152     plantestsuite("samba4.ldb.simple.ldaps with SASL-BIND %s(%s)" % (options, env),
153                   env, "%s/test_ldb_simple.sh ldaps $SERVER %s" % (bbdir, options))
154
155 for options in ['-U"$USERNAME%$PASSWORD"']:
156     plantestsuite("samba4.ldb.ldapi with options %s(ad_dc_ntvfs:local)" % options, "ad_dc_ntvfs:local",
157                   "%s/test_ldb.sh ldapi $PREFIX_ABS/ad_dc_ntvfs/private/ldapi %s" % (bbdir, options))
158
159 for t in smbtorture4_testsuites("ldap."):
160     if t == "ldap.nested-search":
161         plansmbtorture4testsuite(t, "ad_dc_default_smb1", '-U"$USERNAME%$PASSWORD" //$SERVER_IP/_none_')
162     elif t == "ldap.session-expiry":
163         # This requires kerberos and thus the server name
164         plansmbtorture4testsuite(
165             t, "ad_dc_default", '-U"$USERNAME%$PASSWORD" //$DC_SERVER/_none_')
166     else:
167         plansmbtorture4testsuite(
168             t,
169             "ad_dc_default",
170             '-U"$USERNAME%$PASSWORD" //$SERVER_IP/_none_ -D "$USERNAME"@"$REALM"##"$PASSWORD"')
171
172 for t in smbtorture4_testsuites("dsdb."):
173     plansmbtorture4testsuite(t, "ad_dc:local", "localhost")
174
175 ldbdir = os.path.join(srcdir(), "lib/ldb")
176 # Don't run LDB tests when using system ldb, as we won't have ldbtest installed
177 if os.path.exists(os.path.join(samba4bindir, "ldbtest")):
178     plantestsuite("ldb.base", "none", "%s/tests/test-tdb-subunit.sh %s" % (ldbdir, samba4bindir))
179 else:
180     skiptestsuite("ldb.base", "Using system LDB, ldbtest not available")
181
182 plantestsuite_loadlist("samba4.tests.attr_from_server.python(ad_dc_ntvfs)",
183                        "ad_dc_ntvfs:local",
184                        [python, os.path.join(DSDB_PYTEST_DIR, "attr_from_server.py"),
185                         '$PREFIX_ABS/ad_dc_ntvfs/private/sam.ldb', '$LOADLIST', '$LISTOPT'])
186
187 # Tests for RPC
188
189 # add tests to this list as they start passing, so we test
190 # that they stay passing
191 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"]
192 ncalrpc_tests = ["rpc.schannel", "rpc.join", "rpc.lsa", "rpc.dssetup", "rpc.altercontext", "rpc.netlogon", "rpc.netlogon.admin", "rpc.netlogon.zerologon", "rpc.asyncbind", "rpc.lsalookup", "rpc.lsa-getuser", "rpc.schannel2", "rpc.authcontext"]
193 drs_rpc_tests = smbtorture4_testsuites("drs.rpc")
194 ncacn_ip_tcp_tests = ["rpc.schannel", "rpc.join", "rpc.lsa", "rpc.dssetup", "rpc.drsuapi", "rpc.drsuapi_w2k8", "rpc.netlogon", "rpc.netlogon.admin", "rpc.netlogon.zerologon", "rpc.asyncbind", "rpc.lsalookup", "rpc.lsa-getuser", "rpc.schannel2", "rpc.authcontext", "rpc.samr.passwords.validate"] + drs_rpc_tests
195 slow_ncacn_np_tests = ["rpc.samlogon",
196                        "rpc.samr",
197                        "rpc.samr.users",
198                        "rpc.samr.large-dc",
199                        "rpc.samr.users.privileges",
200                        "rpc.samr.passwords.default",
201                        "rpc.samr.passwords.pwdlastset",
202                        "rpc.samr.passwords.lockout",
203                        "rpc.samr.passwords.badpwdcount"]
204 slow_ncacn_ip_tcp_tests = ["rpc.cracknames"]
205
206 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"]
207
208 # Filter RPC tests that should not run against ad_dc_ntvfs
209 rpc_s3only = [
210     "rpc.mdssvc",
211 ]
212 rpc_fipsonly = [
213     "rpc.fips.netlogon.crypto",
214 ]
215 rpc_exclude = rpc_s3only + rpc_fipsonly
216 rpc_tests = [x for x in smbtorture4_testsuites("rpc.") if x not in rpc_exclude]
217 auto_rpc_tests = list(filter(lambda t: t not in all_rpc_tests, rpc_tests))
218
219 for bindoptions in ["seal,padcheck"] + validate_list + ["bigendian"]:
220     for transport in ["ncalrpc", "ncacn_np", "ncacn_ip_tcp"]:
221         env = "ad_dc_default"
222         local = ""
223         if transport == "ncalrpc":
224             tests = ncalrpc_tests
225             local = ":local"
226         elif transport == "ncacn_np":
227             tests = ncacn_np_tests
228         elif transport == "ncacn_ip_tcp":
229             tests = ncacn_ip_tcp_tests
230         else:
231             raise AssertionError("invalid transport %r" % transport)
232         for t in tests:
233             if t == "rpc.netlogon":
234                 env = "ad_dc_ntvfs"
235             elif t == "rpc.join":
236                 env = "ad_dc_default_smb1"
237             plansmbtorture4testsuite(t, env + local, ["%s:$SERVER[%s]" % (transport, bindoptions), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.%s on %s with %s" % (t, transport, bindoptions))
238         plansmbtorture4testsuite('rpc.samba3-sharesec', env + local, ["%s:$SERVER[%s]" % (transport, bindoptions), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', '--option=torture:share=tmp'], "samba4.rpc.samba3.sharesec on %s with %s" % (transport, bindoptions))
239
240 # Plugin S4 DC tests (confirms named pipe auth forwarding).  This can be expanded once kerberos is supported in the plugin DC
241 #
242 for bindoptions in ["seal,padcheck"] + validate_list + ["bigendian"]:
243     for t in ncacn_np_tests:
244         env = "ad_dc"
245         transport = "ncacn_np"
246         if t in ["rpc.authcontext", "rpc.join"]:
247             env = "ad_dc_smb1"
248         plansmbtorture4testsuite(t, env, ["%s:$SERVER[%s]" % (transport, bindoptions), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.%s with %s" % (t, bindoptions))
249
250 for bindoptions in [""] + validate_list + ["bigendian"]:
251     for t in auto_rpc_tests:
252         env = "ad_dc_default"
253         if t in ["rpc.srvsvc", "rpc.mgmt"]:
254             env = "ad_dc_ntvfs"
255         elif t == "rpc.join":
256             env = "ad_dc_default_smb1"
257         plansmbtorture4testsuite(t, env, ["$SERVER[%s]" % bindoptions, '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.%s with %s" % (t, bindoptions))
258
259 t = "rpc.countcalls"
260 plansmbtorture4testsuite(t, "ad_dc_default:local", ["$SERVER[%s]" % bindoptions, '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], modname="samba4.%s" % t)
261
262 for transport in ["ncacn_np", "ncacn_ip_tcp"]:
263     env = "ad_dc_slowtests"
264     if transport == "ncacn_np":
265         tests = slow_ncacn_np_tests
266     elif transport == "ncacn_ip_tcp":
267         tests = slow_ncacn_ip_tcp_tests
268     else:
269         raise AssertionError("Invalid transport %r" % transport)
270     for t in tests:
271         bindoptions = ''
272         if t == 'rpc.cracknames':
273             bindoptions = 'seal'
274         plansmbtorture4testsuite(t, env, ["%s:$SERVER[%s]" % (transport, bindoptions), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.%s on %s with %s" % (t, transport, bindoptions))
275
276 # Tests for the DFS referral calls implementation
277 for t in smbtorture4_testsuites("dfs."):
278     plansmbtorture4testsuite(t, "ad_dc_ntvfs", '//$SERVER/ipc\$ -U$USERNAME%$PASSWORD')
279     plansmbtorture4testsuite(t, "ad_dc_smb1", '//$SERVER/ipc\$ -U$USERNAME%$PASSWORD')
280
281 # Tests for the NET API (net.api.become.dc tested below against all the roles)
282 net_tests = list(filter(lambda x: "net.api.become.dc" not in x, smbtorture4_testsuites("net.")))
283 for t in net_tests:
284     plansmbtorture4testsuite(t, "ad_dc_default", '$SERVER[%s] -U$USERNAME%%$PASSWORD -W$DOMAIN' % validate)
285
286 # Tests for session keys and encryption of RPC pipes
287 # FIXME: Integrate these into a single smbtorture test
288
289 transport = "ncacn_np"
290 for env in ["ad_dc_default", "nt4_dc"]:
291     for ntlmoptions in [
292         "-k no --option=clientusespnego=yes",
293         "-k no --option=clientusespnego=yes --option=ntlmssp_client:128bit=no",
294         "-k no --option=clientusespnego=yes --option=ntlmssp_client:56bit=yes",
295         "-k no --option=clientusespnego=yes --option=ntlmssp_client:56bit=no",
296         "-k no --option=clientusespnego=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=yes",
297         "-k no --option=clientusespnego=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=no",
298         "-k no --option=clientusespnego=yes --option=clientntlmv2auth=yes",
299         "-k no --option=clientusespnego=yes --option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no",
300         "-k no --option=clientusespnego=yes --option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=yes",
301         "-k no --option=clientusespnego=no --option=clientntlmv2auth=yes",
302         "-k no --option=gensec:spnego=no --option=clientntlmv2auth=yes",
303         "-k no --option=clientusespnego=no"]:
304         name = "rpc.lsa.secrets on %s with with %s" % (transport, ntlmoptions)
305         plansmbtorture4testsuite('rpc.lsa.secrets', env, ["%s:$SERVER[]" % (transport), ntlmoptions, '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', '--option=gensec:target_hostname=$NETBIOSNAME'], "samba4.%s" % name)
306     plantestsuite("samba.blackbox.pdbtest(%s)" % env, "%s:local" % env, [os.path.join(bbdir, "test_pdbtest.sh"), '$SERVER', "$PREFIX", "pdbtest", smbclient3, '$SMB_CONF_PATH', configuration])
307
308 gpo = smbtorture4_testsuites("gpo.")
309 for t in gpo:
310     plansmbtorture4testsuite(t, 'ad_dc:local', ['//$SERVER/sysvol', '-U$USERNAME%$PASSWORD'])
311
312 transports = ["ncacn_np", "ncacn_ip_tcp"]
313
314 # Kerberos varies between functional levels, so it is important to check this on all of them
315 for env in all_fl_envs:
316     transport = "ncacn_np"
317     plansmbtorture4testsuite('rpc.pac', env, ["%s:$SERVER[]" % (transport, ), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.pac on %s" % (transport,))
318     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,))
319     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,))
320     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,))
321     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,))
322     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,))
323     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)
324     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)
325     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)
326
327     # Winreg tests test bulk Kerberos encryption of DCE/RPC
328     # We test rpc.winreg here too, because the winreg interface if
329     # handled by the source3/rpc_server code.
330     for bindoptions in ["connect", "packet", "krb5", "krb5,packet", "krb5,sign", "krb5,seal", "spnego", "spnego,packet", "spnego,sign", "spnego,seal"]:
331         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))
332
333     for transport in transports:
334         plansmbtorture4testsuite('rpc.echo', env, ["%s:$SERVER[]" % (transport,), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.echo on %s" % (transport, ))
335
336         # Echo tests test bulk Kerberos encryption of DCE/RPC
337         for bindoptions in ["connect", "krb5", "krb5,sign", "krb5,seal", "spnego", "spnego,sign", "spnego,seal"] + validate_list + ["padcheck", "bigendian", "bigendian,seal"]:
338             echooptions = "--option=socket:testnonblock=True --option=torture:quick=yes -k yes"
339             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))
340
341 for env in ["fl2000dc", "fl2008r2dc"]:
342     plansmbtorture4testsuite("net.api.become.dc", env, '$SERVER[%s] -U$USERNAME%%$PASSWORD -W$DOMAIN' % validate)
343
344 for bindoptions in ["sign", "seal"]:
345     plansmbtorture4testsuite('rpc.backupkey', "ad_dc_default", ["ncacn_np:$SERVER[%s]" % (bindoptions), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.backupkey with %s" % (bindoptions))
346
347 for transport in transports:
348     for bindoptions in ["sign", "seal"]:
349         for ntlmoptions in [
350             "--option=ntlmssp_client:ntlm2=yes --option=torture:quick=yes",
351             "--option=ntlmssp_client:ntlm2=no --option=torture:quick=yes",
352             "--option=ntlmssp_client:ntlm2=yes --option=ntlmssp_client:128bit=no --option=torture:quick=yes",
353             "--option=ntlmssp_client:ntlm2=no --option=ntlmssp_client:128bit=no --option=torture:quick=yes",
354             "--option=ntlmssp_client:ntlm2=yes --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes",
355             "--option=ntlmssp_client:ntlm2=no --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes",
356             "--option=clientntlmv2auth=yes --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes",
357             "--option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:keyexchange=yes --option=torture:quick=yes",
358             "--option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes"]:
359             if transport == "ncalrpc":
360                 env = "ad_dc_default:local"
361             else:
362                 env = "ad_dc_default"
363             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))
364
365 plansmbtorture4testsuite('rpc.echo', "ad_dc_default", ['ncacn_np:$SERVER[smb2]', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.echo on ncacn_np over smb2")
366 for env in ["ad_dc", "nt4_dc"]:
367     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")
368     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")
369
370 plansmbtorture4testsuite('ntp.signd', "ad_dc_default:local", ['ncacn_np:$SERVER', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.ntp.signd")
371
372 nbt_tests = smbtorture4_testsuites("nbt.")
373 for t in nbt_tests:
374     plansmbtorture4testsuite(t, "ad_dc_ntvfs", "//$SERVER/_none_ -U\"$USERNAME%$PASSWORD\"")
375
376 # Tests against the NTVFS POSIX backend
377 ntvfsargs = ["--option=torture:sharedelay=100000", "--option=torture:oplocktimeout=3", "--option=torture:writetimeupdatedelay=500000"]
378
379 # Filter smb2 tests that should not run against ad_dc_ntvfs
380 smb2_s3only = [
381     "smb2.change_notify_disabled",
382     "smb2.dosmode",
383     "smb2.credits",
384     "smb2.kernel-oplocks",
385     "smb2.durable-v2-delay",
386     "smb2.aio_delay",
387     "smb2.fileid",
388     "smb2.timestamps",
389     "smb2.async_dosmode",
390     "smb2.twrp",
391     "smb2.ea",
392     "smb2.create_no_streams",
393 ]
394 smb2 = [x for x in smbtorture4_testsuites("smb2.") if x not in smb2_s3only]
395
396 # The QFILEINFO-IPC test needs to be on ipc$
397 raw = list(filter(lambda x: "raw.qfileinfo.ipc" not in x, smbtorture4_testsuites("raw.")))
398 base = smbtorture4_testsuites("base.")
399
400 netapi = smbtorture4_testsuites("netapi.")
401
402 for t in base + raw + smb2 + netapi:
403     plansmbtorture4testsuite(t, "ad_dc_ntvfs", ['//$SERVER/tmp', '-U$USERNAME%$PASSWORD'] + ntvfsargs)
404
405 libsmbclient = smbtorture4_testsuites("libsmbclient.")
406 protocols = [ 'NT1', 'SMB3' ]
407 for t in libsmbclient:
408     url = "smb://$USERNAME:$PASSWORD@$SERVER/tmp"
409     if t == "libsmbclient.list_shares":
410         url = "smb://$USERNAME:$PASSWORD@$SERVER"
411     if t == "libsmbclient.utimes":
412         url += "/utimes.txt"
413
414     libsmbclient_testargs = [
415         '//$SERVER/tmp',
416         '-U$USERNAME%$PASSWORD',
417         "--option=torture:smburl=" + url,
418         "--option=torture:replace_smbconf="
419         "%s/testdata/samba3/smb_new.conf" % srcdir()
420         ]
421
422     for proto in protocols:
423         plansmbtorture4testsuite(
424             t,
425             "nt4_dc" if proto == "SMB3" else "nt4_dc_smb1_done",
426             libsmbclient_testargs +
427             [ "--option=torture:clientprotocol=%s" % proto],
428             "samba4.%s.%s" % (t, proto))
429
430 url = "smb://baduser:invalidpw@$SERVER/tmpguest"
431 t = "libsmbclient.noanon_list"
432 libsmbclient_testargs = [
433     '//$SERVER/tmpguest',
434     '-U$USERNAME%$PASSWORD',
435     "--option=torture:smburl=" + url,
436     "--option=torture:replace_smbconf="
437     "%s/testdata/samba3/smb_new.conf" % srcdir()
438     ]
439 for proto in protocols:
440     plansmbtorture4testsuite(t,
441         "maptoguest",
442         libsmbclient_testargs +
443         [ "--option=torture:clientprotocol=%s" % proto],
444         "samba4.%s.baduser.%s" % (t, proto))
445
446 plansmbtorture4testsuite("raw.qfileinfo.ipc", "ad_dc_ntvfs", '//$SERVER/ipc\$ -U$USERNAME%$PASSWORD')
447
448 for t in smbtorture4_testsuites("rap."):
449     plansmbtorture4testsuite(t, "ad_dc_ntvfs", '//$SERVER/IPC\$ -U$USERNAME%$PASSWORD')
450
451 # Tests against the NTVFS CIFS backend
452 for t in base + raw:
453     plansmbtorture4testsuite(t, "ad_dc_ntvfs", ['//$NETBIOSNAME/cifs', '-U$USERNAME%$PASSWORD', '--kerberos=yes'] + ntvfsargs, modname="samba4.ntvfs.cifs.krb5.%s" % t)
454
455 # Test NTVFS CIFS backend with S4U2Self and S4U2Proxy
456 t = "base.unlink"
457 plansmbtorture4testsuite(t, "ad_dc_ntvfs", ['//$NETBIOSNAME/cifs', '-U$USERNAME%$PASSWORD', '--kerberos=no'] + ntvfsargs, "samba4.ntvfs.cifs.ntlm.%s" % t)
458 plansmbtorture4testsuite(t, "rpc_proxy", ['//$NETBIOSNAME/cifs_to_dc', '-U$DC_USERNAME%$DC_PASSWORD', '--kerberos=yes'] + ntvfsargs, "samba4.ntvfs.cifs.krb5.%s" % t)
459 plansmbtorture4testsuite(t, "rpc_proxy", ['//$NETBIOSNAME/cifs_to_dc', '-U$DC_USERNAME%$DC_PASSWORD', '--kerberos=no'] + ntvfsargs, "samba4.ntvfs.cifs.ntlm.%s" % t)
460
461 plansmbtorture4testsuite('echo.udp', 'ad_dc_ntvfs:local', '//$SERVER/whatever')
462
463 # Local tests
464 for t in smbtorture4_testsuites("local."):
465     # The local.resolve test needs a name to look up using real system (not emulated) name routines
466     plansmbtorture4testsuite(t, "none", "ncalrpc:localhost")
467
468 # Confirm these tests with the system iconv too
469 for t in ["local.convert_string_handle", "local.convert_string", "local.ndr"]:
470     options = "ncalrpc: --option='iconv:use_builtin_handlers=false'"
471     plansmbtorture4testsuite(t, "none", options,
472                              modname="samba4.%s.system.iconv" % t)
473
474 tdbtorture4 = binpath("tdbtorture")
475 if os.path.exists(tdbtorture4):
476     plantestsuite("tdb.stress", "none", valgrindify(tdbtorture4))
477 else:
478     skiptestsuite("tdb.stress", "Using system TDB, tdbtorture not available")
479
480 plansmbtorture4testsuite("drs.unit", "none", "ncalrpc:")
481
482 # Pidl tests
483 for f in sorted(os.listdir(os.path.join(samba4srcdir, "../pidl/tests"))):
484     if f.endswith(".pl"):
485         planperltestsuite("pidl.%s" % f[:-3], os.path.normpath(os.path.join(samba4srcdir, "../pidl/tests", f)))
486
487 # DNS tests
488 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'])
489 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'])
490 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'])
491
492 plantestsuite_loadlist("samba.tests.dns_aging", "fl2003dc:local",
493                        [python,
494                         f"{srcdir()}/python/samba/tests/dns_aging.py",
495                         '$SERVER',
496                         '$SERVER_IP',
497                         '--machine-pass',
498                         '-U"$USERNAME%$PASSWORD"',
499                         '--workgroup=$DOMAIN',
500                         '$LOADLIST', '$LISTOPT'])
501
502 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'])
503
504 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'])
505 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'])
506
507 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'])
508
509 plantestsuite_loadlist("samba.tests.dns_packet",
510                        "ad_dc",
511                        [python,
512                         '-msamba.subunit.run',
513                         '$LOADLIST',
514                         "$LISTOPT"
515                         "samba.tests.dns_packet"
516                        ])
517
518 plantestsuite_loadlist("samba.tests.sddl",
519                        "none",
520                        [python,
521                         '-msamba.subunit.run',
522                         '$LOADLIST',
523                         "$LISTOPT"
524                         "samba.tests.sddl"
525                        ])
526
527 for t in smbtorture4_testsuites("dns_internal."):
528     plansmbtorture4testsuite(t, "ad_dc_default:local", '//$SERVER/whavever')
529
530 # Local tests
531 for t in smbtorture4_testsuites("dlz_bind9."):
532     # The dlz_bind9 tests needs to look at the DNS database
533     plansmbtorture4testsuite(t, "chgdcpass:local", ["ncalrpc:$SERVER", '-U$USERNAME%$PASSWORD'])
534
535 planpythontestsuite("nt4_dc_smb1", "samba.tests.libsmb-basic")
536
537 planpythontestsuite("ad_member", "samba.tests.smb-notify",
538                     environ={'USERNAME':'$DC_USERNAME',
539                              'PASSWORD':'$DC_PASSWORD',
540                              'USERNAME_UNPRIV':'alice',
541                              'PASSWORD_UNPRIV':'Secret007',
542                              'STRICT_CHECKING':'0',
543                              'NOTIFY_SHARE':'notify_priv'})
544
545 # Blackbox Tests:
546 # tests that interact directly with the command-line tools rather than using
547 # the API. These mainly test that the various command-line options of commands
548 # work correctly.
549
550 # smbtorture --fullname parameter test
551 plantestsuite("samba4.blackbox.smbtorture_subunit_names", "none",
552               [
553                  os.path.join(bbdir, "test_smbtorture_test_names.sh"),
554                  smbtorture4
555               ])
556
557 for env in ["ad_member", "ad_dc_ntvfs", "chgdcpass"]:
558     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])
559
560 plantestsuite("samba4.blackbox.samba_tool(ad_dc_default:local)", "ad_dc_default:local", [os.path.join(samba4srcdir, "utils/tests/test_samba_tool.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$DOMAIN', smbclient3])
561 plantestsuite("samba4.blackbox.net_rpc_user(ad_dc)", "ad_dc", [os.path.join(bbdir, "test_net_rpc_user.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$DOMAIN'])
562
563 plantestsuite("samba4.blackbox.test_primary_group", "ad_dc:local", [os.path.join(bbdir, "test_primary_group.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$DOMAIN', '$PREFIX_ABS'])
564
565 plantestsuite("samba4.blackbox.test_old_enctypes", "fl2003dc:local", [os.path.join(bbdir, "test_old_enctypes.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$NETBIOSNAME', '$PREFIX_ABS'])
566
567 if have_heimdal_support:
568     plantestsuite("samba4.blackbox.kinit", "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])
569     plantestsuite("samba4.blackbox.kinit", "fl2000dc:local", [os.path.join(bbdir, "test_kinit_heimdal.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', "arcfour-hmac-md5", smbclient3, configuration])
570     plantestsuite("samba4.blackbox.kinit", "fl2008r2dc:local", [os.path.join(bbdir, "test_kinit_heimdal.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', "aes256-cts-hmac-sha1-96", smbclient3, configuration])
571     plantestsuite("samba4.blackbox.kinit_trust", "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"])
572     plantestsuite("samba4.blackbox.kinit_trust", "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"])
573     plantestsuite("samba4.blackbox.kinit_trust", "fl2000dc: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"])
574     plantestsuite("samba4.blackbox.export.keytab", "ad_dc_ntvfs:local", [os.path.join(bbdir, "test_export_keytab_heimdal.sh"), '$SERVER', '$USERNAME', '$REALM', '$DOMAIN', "$PREFIX", smbclient4])
575     plantestsuite("samba4.blackbox.kpasswd", "ad_dc_ntvfs:local", [os.path.join(bbdir, "test_kpasswd_heimdal.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', "$PREFIX/ad_dc_ntvfs"])
576     plantestsuite("samba4.blackbox.krb5.s4u", "fl2008r2dc:local", [os.path.join(bbdir, "test_s4u_heimdal.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$TRUST_SERVER', '$TRUST_USERNAME', '$TRUST_PASSWORD', '$TRUST_REALM', '$TRUST_DOMAIN', '$PREFIX', configuration])
577 else:
578     plantestsuite("samba4.blackbox.kinit", "ad_dc_ntvfs:local", [os.path.join(bbdir, "test_kinit_mit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', smbclient4, configuration])
579     plantestsuite("samba4.blackbox.kinit", "fl2000dc:local", [os.path.join(bbdir, "test_kinit_mit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', smbclient3, configuration])
580     plantestsuite("samba4.blackbox.kinit", "fl2008r2dc:local", [os.path.join(bbdir, "test_kinit_mit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', smbclient3, configuration])
581     plantestsuite("samba4.blackbox.kinit_trust", "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"])
582     plantestsuite("samba4.blackbox.kinit_trust", "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"])
583     plantestsuite("samba4.blackbox.kinit_trust", "fl2000dc: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"])
584     plantestsuite("samba4.blackbox.export.keytab", "ad_dc_ntvfs:local", [os.path.join(bbdir, "test_export_keytab_mit.sh"), '$SERVER', '$USERNAME', '$REALM', '$DOMAIN', "$PREFIX", smbclient4])
585     plantestsuite("samba4.blackbox.kpasswd", "ad_dc_ntvfs:local", [os.path.join(bbdir, "test_kpasswd_mit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', "$PREFIX/ad_dc_ntvfs"])
586
587 plantestsuite("samba4.blackbox.pkinit_simple",
588               "ad_dc:local",
589               [os.path.join(bbdir, "test_pkinit_simple.sh"),
590                '$SERVER',
591                'pkinit',
592                '$PASSWORD',
593                '$REALM',
594                '$DOMAIN',
595                '$PREFIX/ad_dc',
596                smbclient3,
597                configuration])
598 plantestsuite("samba4.blackbox.pkinit_pac",
599               "ad_dc:local",
600               [os.path.join(bbdir, "test_pkinit_pac.sh"),
601                '$SERVER',
602                '$USERNAME',
603                '$PASSWORD',
604                '$REALM',
605                '$DOMAIN',
606                '$PREFIX/ad_dc',
607                configuration])
608
609 plantestsuite("samba.blackbox.client_kerberos", "ad_dc", [os.path.join(bbdir, "test_client_kerberos.sh"), '$DOMAIN', '$REALM', '$USERNAME', '$PASSWORD', '$SERVER', '$PREFIX_ABS', '$SMB_CONF_PATH'])
610
611 env="ad_member:local"
612 plantestsuite("samba.blackbox.rpcclient_schannel",
613               env,
614               [os.path.join(bbdir, "test_rpcclient_schannel.sh"),
615                '$DOMAIN',
616                '$REALM',
617                '$DC_USERNAME',
618                '$DC_PASSWORD',
619                '$DC_SERVER',
620                '$PREFIX_ABS',
621                '$SMB_CONF_PATH',
622                env])
623 env="ad_member_fips:local"
624 plantestsuite("samba.blackbox.rpcclient_schannel",
625               env,
626               [os.path.join(bbdir, "test_rpcclient_schannel.sh"),
627                '$DOMAIN',
628                '$REALM',
629                '$DC_USERNAME',
630                '$DC_PASSWORD',
631                '$DC_SERVER',
632                '$PREFIX_ABS',
633                '$SMB_CONF_PATH',
634                env],
635               environ={'GNUTLS_FORCE_FIPS_MODE': '1',
636                        'OPENSSL_FORCE_FIPS_MODE': '1'})
637
638 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'])
639 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'])
640 plantestsuite("samba4.blackbox.trust_ntlm", "fl2000dc: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'])
641 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'])
642 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'])
643
644 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"])
645 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"])
646 plantestsuite("samba4.blackbox.trust_utils(fl2000dc:local)", "fl2000dc: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"])
647 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'])
648 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'])
649 plantestsuite("samba4.blackbox.trust_token", "fl2000dc", [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'])
650 plantestsuite("samba4.blackbox.ktpass(ad_dc_ntvfs)", "ad_dc_ntvfs", [os.path.join(bbdir, "test_ktpass.sh"), '$PREFIX/ad_dc_ntvfs'])
651 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"])
652 plantestsuite("samba4.blackbox.trust_user_account", "fl2008r2dc:local", [os.path.join(bbdir, "test_trust_user_account.sh"), '$PREFIX', '$REALM', '$DOMAIN', '$TRUST_REALM', '$TRUST_DOMAIN'])
653 plantestsuite("samba4.blackbox.cifsdd(ad_dc_ntvfs)", "ad_dc_ntvfs", [os.path.join(samba4srcdir, "client/tests/test_cifsdd.sh"), '$SERVER', '$USERNAME', '$PASSWORD', "$DOMAIN"])
654 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])
655 plantestsuite("samba4.blackbox.locktest(ad_dc_ntvfs)", "ad_dc_ntvfs", [os.path.join(samba4srcdir, "torture/tests/test_locktest.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$DOMAIN', '$PREFIX'])
656 plantestsuite("samba4.blackbox.masktest", "ad_dc_ntvfs", [os.path.join(samba4srcdir, "torture/tests/test_masktest.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$DOMAIN', '$PREFIX'])
657 plantestsuite("samba4.blackbox.gentest(ad_dc_ntvfs)", "ad_dc_ntvfs", [os.path.join(samba4srcdir, "torture/tests/test_gentest.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$DOMAIN', "$PREFIX"])
658 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])
659 plantestsuite("samba4.blackbox.chgdcpass", "chgdcpass", [os.path.join(bbdir, "test_chgdcpass.sh"), '$SERVER', "CHGDCPASS\$", '$REALM', '$DOMAIN', '$PREFIX/chgdcpass', "aes256-cts-hmac-sha1-96", '$PREFIX/chgdcpass', smbclient3])
660 plantestsuite("samba4.blackbox.samba_upgradedns(chgdcpass:local)", "chgdcpass:local", [os.path.join(bbdir, "test_samba_upgradedns.sh"), '$SERVER', '$REALM', '$PREFIX', '$SELFTEST_PREFIX/chgdcpass'])
661 plantestsuite("samba4.blackbox.net_ads", "ad_dc:client", [os.path.join(bbdir, "test_net_ads.sh"), '$DC_SERVER', '$DC_USERNAME', '$DC_PASSWORD', '$PREFIX_ABS'])
662 plantestsuite("samba4.blackbox.net_offlinejoin", "ad_dc:client", [os.path.join(bbdir, "test_net_offline.sh"), '$DC_SERVER', '$DC_USERNAME', '$DC_PASSWORD', '$PREFIX_ABS'])
663 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'])
664 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'])
665 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'])
666 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'])
667 plantestsuite("samba4.blackbox.samba-tool_ntacl(ad_member:local)", "ad_member:local", [os.path.join(bbdir, "test_samba-tool_ntacl.sh"), '$PREFIX', '$DOMSID'])
668
669 if have_gnutls_fips_mode_support:
670     plantestsuite("samba4.blackbox.weak_crypto.client", "ad_dc", [os.path.join(bbdir, "test_weak_crypto.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', "$PREFIX/ad_dc"])
671     plantestsuite("samba4.blackbox.test_weak_disable_ntlmssp_ldap", "ad_member:local", [os.path.join(bbdir, "test_weak_disable_ntlmssp_ldap.sh"),'$DC_USERNAME', '$DC_PASSWORD'])
672
673     for env in ["ad_dc_fips", "ad_member_fips"]:
674         plantestsuite("samba4.blackbox.weak_crypto.server",
675                       env,
676                       [os.path.join(bbdir, "test_weak_crypto_server.sh"),
677                        '$SERVER',
678                        '$USERNAME',
679                        '$PASSWORD',
680                        '$REALM',
681                        '$DOMAIN',
682                        "$PREFIX/ad_dc_fips",
683                        configuration],
684                       environ={'GNUTLS_FORCE_FIPS_MODE': '1',
685                                'OPENSSL_FORCE_FIPS_MODE': '1'})
686
687     plantestsuite("samba4.blackbox.net_ads_fips",
688                   "ad_dc_fips:client",
689                   [os.path.join(bbdir, "test_net_ads_fips.sh"),
690                    '$DC_SERVER',
691                    '$DC_USERNAME',
692                    '$DC_PASSWORD',
693                    '$PREFIX_ABS'],
694                   environ={'GNUTLS_FORCE_FIPS_MODE': '1',
695                            'OPENSSL_FORCE_FIPS_MODE': '1'})
696
697     t = "--krb5auth=$DOMAIN/$DC_USERNAME%$DC_PASSWORD"
698     plantestsuite("samba3.wbinfo_simple.fips.%s" % t,
699                   "ad_member_fips:local",
700                   [os.path.join(srcdir(), "nsswitch/tests/test_wbinfo_simple.sh"), t],
701                   environ={'GNUTLS_FORCE_FIPS_MODE': '1',
702                            'OPENSSL_FORCE_FIPS_MODE': '1'})
703     plantestsuite("samba4.wbinfo_name_lookup.fips",
704                   "ad_member_fips",
705                   [os.path.join(srcdir(), "nsswitch/tests/test_wbinfo_name_lookup.sh"),
706                    '$DOMAIN',
707                    '$REALM',
708                    '$DC_USERNAME'],
709                   environ={'GNUTLS_FORCE_FIPS_MODE': '1',
710                            'OPENSSL_FORCE_FIPS_MODE': '1'})
711
712     plansmbtorture4testsuite('rpc.fips.netlogon.crypto',
713                              'ad_dc_fips',
714                              ['ncacn_np:$SERVER[krb5]',
715                               '-U$USERNAME%$PASSWORD',
716                               '--workgroup=$DOMAIN',
717                               '--client-protection=encrypt'],
718                              'samba4.rpc.fips.netlogon.crypto',
719                              environ={'GNUTLS_FORCE_FIPS_MODE': '1',
720                                       'OPENSSL_FORCE_FIPS_MODE': '1'})
721
722 plansmbtorture4testsuite('rpc.echo', "ad_dc_ntvfs", ['ncacn_np:$NETBIOSALIAS', '-U$DOMAIN/$USERNAME%$PASSWORD'], "samba4.rpc.echo against NetBIOS alias")
723
724 # Test wbinfo trust auth
725 for env in ["ad_member_oneway:local", "fl2000dc:local", "fl2003dc:local", "fl2008r2dc:local"]:
726     for t in ["--krb5auth=$TRUST_REALM/$TRUST_USERNAME%$TRUST_PASSWORD",
727               "--krb5auth=$TRUST_DOMAIN/$TRUST_USERNAME%$TRUST_PASSWORD",
728               "--authenticate=$TRUST_REALM/$TRUST_USERNAME%$TRUST_PASSWORD",
729               "--authenticate=$TRUST_DOMAIN/$TRUST_USERNAME%$TRUST_PASSWORD"]:
730         plantestsuite("samba3.wbinfo_simple.trust:%s" % t, env, [os.path.join(srcdir(), "nsswitch/tests/test_wbinfo_simple.sh"), t])
731
732 # json tests hook into ``chgdcpass'' to make them run in contributor CI on
733 # gitlab
734 planpythontestsuite("chgdcpass", "samba.tests.blackbox.netads_json")
735
736 # Tests using the "Simple" NTVFS backend
737 for t in ["base.rw1"]:
738     plansmbtorture4testsuite(t, "ad_dc_ntvfs", ["//$SERVER/simple", '-U$USERNAME%$PASSWORD'], modname="samba4.ntvfs.simple.%s" % t)
739
740 # Domain S4member Tests
741 plansmbtorture4testsuite('rpc.echo', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], "samba4.rpc.echo against s4member server with local creds")
742 plansmbtorture4testsuite('rpc.echo', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'], "samba4.rpc.echo against s4member server with domain creds")
743 plansmbtorture4testsuite('rpc.samr', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], "samba4.rpc.samr against s4member server with local creds")
744 plansmbtorture4testsuite('rpc.samr.users', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], "samba4.rpc.samr.users against s4member server with local creds",)
745 plansmbtorture4testsuite('rpc.samr.passwords.default',
746                          "s4member",
747                          ['ncacn_np:$NETBIOSNAME',
748                           '-U$NETBIOSNAME/$USERNAME%$PASSWORD'],
749                          "samba4.rpc.samr.passwords.default against s4member server with local creds")
750 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])
751
752 # RPC Proxy
753 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")
754
755 # Tests SMB signing
756 for mech in [
757     "-k no",
758     "-k no --option=clientusespnego=no",
759     "-k no --option=gensec:spengo=no",
760     "-k yes",
761     "-k yes --option=gensec:fake_gssapi_krb5=yes --option=gensec:gssapi_krb5=no"]:
762     for signing in ["--option=clientsigning=desired", "--option=clientsigning=required"]:
763         signoptions = "%s %s" % (mech, signing)
764         name = "smb.signing on with %s" % signoptions
765         plansmbtorture4testsuite('base.xcopy', "ad_dc_ntvfs", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$USERNAME%$PASSWORD'], modname="samba4.%s" % name)
766
767 for mech in [
768     "-k no",
769     "-k no --option=clientusespnego=no",
770     "-k no --option=gensec:spengo=no",
771     "-k yes"]:
772     signoptions = "%s --client-protection=off" % mech
773     name = "smb.signing disabled on with %s" % signoptions
774     plansmbtorture4testsuite('base.xcopy', "ad_member", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$DC_USERNAME%$DC_PASSWORD'], "samba4.%s domain-creds" % name)
775     plansmbtorture4testsuite('base.xcopy', "ad_dc", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$USERNAME%$PASSWORD'], "samba4.%s" % name)
776     plansmbtorture4testsuite('base.xcopy', "ad_dc",
777                              ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$DC_USERNAME%$DC_PASSWORD'], "samba4.%s administrator" % name)
778
779 plantestsuite("samba4.blackbox.bogusdomain", "ad_member", ["testprogs/blackbox/bogus.sh", "$NETBIOSNAME", "xcopy_share", '$USERNAME', '$PASSWORD', '$DC_USERNAME', '$DC_PASSWORD', smbclient3])
780 for mech in [
781     "-k no",
782     "-k no --option=clientusespnego=no",
783     "-k no --option=gensec:spengo=no"]:
784     signoptions = "%s --client-protection=off" % mech
785     plansmbtorture4testsuite('base.xcopy', "s4member", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], modname="samba4.smb.signing on with %s local-creds" % signoptions)
786
787 plansmbtorture4testsuite('base.xcopy', "ad_dc_ntvfs", ['//$NETBIOSNAME/xcopy_share', '-k', 'no', '--option=clientsigning=desired', '-U%'], modname="samba4.smb.signing --option=clientsigning=desired anon")
788 plansmbtorture4testsuite('base.xcopy', "ad_dc_ntvfs", ['//$NETBIOSNAME/xcopy_share', '-k', 'no', '--option=clientsigning=required', '-U%'], modname="samba4.smb.signing --option=clientsigning=required anon")
789 plansmbtorture4testsuite('base.xcopy', "s4member", ['//$NETBIOSNAME/xcopy_share', '-k', 'no', '--option=clientsigning=disabled', '-U%'], modname="samba4.smb.signing --option=clientsigning=disabled anon")
790
791 # Test SPNEGO without issuing an optimistic token
792 opt='--option=spnego:client_no_optimistic=yes'
793 plansmbtorture4testsuite('base.xcopy', "ad_dc_smb1", ['//$NETBIOSNAME/xcopy_share', '-U$USERNAME%$PASSWORD', opt, '-k', 'no'], modname="samba4.smb.spnego.ntlmssp.no_optimistic")
794 plansmbtorture4testsuite('base.xcopy', "ad_dc_smb1", ['//$NETBIOSNAME/xcopy_share', '-U$USERNAME%$PASSWORD', opt, '-k', 'yes'], modname="samba4.smb.spnego.krb5.no_optimistic")
795
796 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\""]
797
798 winbind_ad_client_tests = smbtorture4_testsuites("winbind.struct") + smbtorture4_testsuites("winbind.pac")
799 winbind_wbclient_tests = smbtorture4_testsuites("winbind.wbclient")
800 for env in ["ad_dc", "ad_member", "nt4_member"]:
801     wb_opts = wb_opts_default[:]
802     if env in ["ad_member"]:
803         wb_opts += ["--option=\"torture:winbindd_domain_without_prefix=$DOMAIN\""]
804     for t in winbind_ad_client_tests:
805         plansmbtorture4testsuite(t, "%s:local" % env, wb_opts + ['//$SERVER/tmp', '--realm=$REALM', '--machine-pass', '--option=torture:addc=$DC_SERVER'])
806
807 for env in ["nt4_dc", "fl2003dc"]:
808     for t in winbind_wbclient_tests:
809         plansmbtorture4testsuite(t, "%s:local" % env, '//$SERVER/tmp -U$DC_USERNAME%$DC_PASSWORD')
810
811 for env in ["nt4_dc", "nt4_member", "ad_dc", "ad_member", "chgdcpass", "rodc"]:
812     tests = ["--ping", "--separator",
813              "--own-domain",
814              "--all-domains",
815              "--trusted-domains",
816              "--domain-info=BUILTIN",
817              "--domain-info=$DOMAIN",
818              "--online-status",
819              "--online-status --domain=BUILTIN",
820              "--online-status --domain=$DOMAIN",
821              "--check-secret --domain=$DOMAIN",
822              "--change-secret --domain=$DOMAIN",
823              "--check-secret --domain=$DOMAIN",
824              "--online-status --domain=$DOMAIN",
825              "--domain-users",
826              "--domain-groups",
827              "--name-to-sid=$DC_USERNAME",
828              "--name-to-sid=$DOMAIN/$DC_USERNAME",
829              "--user-info=$DOMAIN/$DC_USERNAME",
830              "--user-groups=$DOMAIN/$DC_USERNAME",
831              "--authenticate=$DOMAIN/$DC_USERNAME%$DC_PASSWORD",
832              "--allocate-uid",
833              "--allocate-gid"]
834
835     for t in tests:
836         plantestsuite("samba.wbinfo_simple.%s" % (t.replace(" --", ".").replace("--", "")), "%s:local" % env, [os.path.join(srcdir(), "nsswitch/tests/test_wbinfo_simple.sh"), t])
837
838     plantestsuite(
839         "samba.wbinfo_sids2xids.(%s:local)" % env, "%s:local" % env,
840         [os.path.join(samba3srcdir, "script/tests/test_wbinfo_sids2xids.sh")])
841
842     planpythontestsuite(env + ":local", "samba.tests.ntlm_auth")
843
844 for env in ["ktest"]:
845     planpythontestsuite(env + ":local", "samba.tests.ntlm_auth_krb5")
846
847 for env in ["s4member_dflt_domain", "s4member"]:
848     for cmd in ["id", "getent"]:
849         users = ["$DC_USERNAME", "$DC_USERNAME@$REALM"]
850         if env == "s4member":
851             users = ["$DOMAIN/$DC_USERNAME", "$DC_USERNAME@$REALM"]
852         for usr in users:
853             plantestsuite("samba4.winbind.dom_name_parse.cmd", env, "%s/dom_parse.sh %s %s" % (bbdir, cmd, usr))
854
855 nsstest4 = binpath("nsstest")
856 for env in ["ad_dc:local", "s4member:local", "nt4_dc:local", "ad_member:local", "nt4_member:local"]:
857     if os.path.exists(nsstest4):
858         plantestsuite("samba.nss.test using winbind(%s)" % env, env, [os.path.join(bbdir, "nsstest.sh"), nsstest4, os.path.join(samba4bindir, "plugins/libnss_wrapper_winbind.so.2")])
859     else:
860         skiptestsuite("samba.nss.test using winbind(%s)" % env, "nsstest not available")
861
862 subunitrun = valgrindify(python) + " " + os.path.join(samba4srcdir, "scripting/bin/subunitrun")
863
864
865 def planoldpythontestsuite(env, module, name=None, extra_path=[], environ={}, extra_args=[]):
866     environ = dict(environ)
867     py_path = list(extra_path)
868     if py_path:
869         environ["PYTHONPATH"] = ":".join(["$PYTHONPATH"] + py_path)
870     args = ["%s=%s" % item for item in environ.items()]
871     args += [subunitrun, "$LISTOPT", "$LOADLIST", module]
872     args += extra_args
873     if name is None:
874         name = module
875     plantestsuite_loadlist(name, env, args)
876
877 if have_gnutls_fips_mode_support:
878     planoldpythontestsuite("ad_dc",
879                            "samba.tests.dcerpc.createtrustrelax",
880                            environ={'GNUTLS_FORCE_FIPS_MODE': '1',
881                                     'OPENSSL_FORCE_FIPS_MODE': '1'})
882     planoldpythontestsuite("ad_dc_fips",
883                            "samba.tests.dcerpc.createtrustrelax",
884                            environ={'GNUTLS_FORCE_FIPS_MODE': '1',
885                                     'OPENSSL_FORCE_FIPS_MODE': '1'})
886
887 # Run complex search expressions test once for each database backend.
888 # Right now ad_dc has mdb and ad_dc_ntvfs has tdb
889 mdb_testenv = "ad_dc"
890 tdb_testenv = "ad_dc_ntvfs"
891 for testenv in [mdb_testenv, tdb_testenv]:
892     planoldpythontestsuite(testenv, "samba.tests.complex_expressions", extra_args=['-U"$USERNAME%$PASSWORD"'])
893
894 planoldpythontestsuite("ad_dc_default:local", "samba.tests.gensec", extra_args=['-U"$USERNAME%$PASSWORD"'])
895 planoldpythontestsuite("none", "simple", extra_path=["%s/lib/tdb/python/tests" % srcdir()], name="tdb.python")
896 planpythontestsuite("ad_dc_default:local", "samba.tests.dcerpc.sam")
897 planpythontestsuite("ad_dc_default:local", "samba.tests.dsdb")
898 planpythontestsuite("none", "samba.tests.dsdb_lock")
899 planpythontestsuite("ad_dc_default:local", "samba.tests.dcerpc.bare")
900 planpythontestsuite("ad_dc_default:local", "samba.tests.dcerpc.lsa")
901 planpythontestsuite("ad_dc_default:local", "samba.tests.dcerpc.unix")
902 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dcerpc.srvsvc")
903 planpythontestsuite("ad_dc_default:local", "samba.tests.samba_tool.timecmd")
904 planpythontestsuite("ad_dc_default:local", "samba.tests.samba_tool.join")
905 planpythontestsuite("ad_member_s3_join", "samba.tests.samba_tool.join_member")
906 planpythontestsuite("ad_dc_default",
907                     "samba.tests.samba_tool.join_lmdb_size")
908 planpythontestsuite("ad_dc_default",
909                     "samba.tests.samba_tool.drs_clone_dc_data_lmdb_size")
910 planpythontestsuite("ad_dc_default",
911                     "samba.tests.samba_tool.promote_dc_lmdb_size")
912
913 planpythontestsuite("none", "samba.tests.samba_tool.visualize")
914
915
916 # test fsmo show
917 for env in all_fl_envs:
918     planpythontestsuite(env + ":local", "samba.tests.samba_tool.fsmo")
919
920 # test samba-tool user, group, contact and computer edit command
921 for env in all_fl_envs:
922     env += ":local"
923     plantestsuite("samba.tests.samba_tool.user_edit", env, [os.path.join(srcdir(), "python/samba/tests/samba_tool/user_edit.sh"), '$SERVER', '$USERNAME', '$PASSWORD'])
924     plantestsuite("samba.tests.samba_tool.group_edit", env, [os.path.join(srcdir(), "python/samba/tests/samba_tool/group_edit.sh"), '$SERVER', '$USERNAME', '$PASSWORD'])
925     plantestsuite("samba.tests.samba_tool.contact_edit", env, [os.path.join(srcdir(), "python/samba/tests/samba_tool/contact_edit.sh"), '$SERVER', '$USERNAME', '$PASSWORD'])
926     plantestsuite("samba.tests.samba_tool.computer_edit", env, [os.path.join(srcdir(), "python/samba/tests/samba_tool/computer_edit.sh"), '$SERVER', '$USERNAME', '$PASSWORD'])
927
928 # We run this test against both AD DC implementations because it is
929 # the only test we have of GPO get/set behaviour, and this involves
930 # the file server as well as the LDAP server.
931 # It's also a good sanity-check that sysvol backup worked correctly.
932 for env in ["ad_dc_ntvfs", "ad_dc", "offlinebackupdc", "renamedc",
933             smbv1_disabled_testenv]:
934     planpythontestsuite(env + ":local", "samba.tests.samba_tool.gpo")
935 for env in ["ad_dc_ntvfs", "ad_dc"]:
936     planpythontestsuite(env + ":local", "samba.tests.samba_tool.gpo_exts")
937
938 planpythontestsuite("ad_dc_default:local", "samba.tests.samba_tool.processes")
939
940 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.samba_tool.user")
941 for env in ["ad_dc_default:local", "ad_dc_no_ntlm:local"]:
942     planpythontestsuite(env, "samba.tests.samba_tool.user_wdigest")
943 for env, nt_hash in [("ad_dc:local", True),
944                      ("ad_dc_no_ntlm:local", False)]:
945     planpythontestsuite(env, "samba.tests.samba_tool.user",
946                         environ={"EXPECT_NT_HASH": int(nt_hash)})
947     planpythontestsuite(env, "samba.tests.samba_tool.user_virtualCryptSHA_userPassword")
948     planpythontestsuite(env, "samba.tests.samba_tool.user_virtualCryptSHA_gpg")
949 planpythontestsuite("chgdcpass:local", "samba.tests.samba_tool.user_check_password_script")
950
951 planpythontestsuite("ad_dc_default:local", "samba.tests.samba_tool.group")
952 planpythontestsuite("ad_dc_default:local", "samba.tests.samba_tool.ou")
953 planpythontestsuite("ad_dc_default:local", "samba.tests.samba_tool.computer")
954 planpythontestsuite("ad_dc_default:local", "samba.tests.samba_tool.contact")
955 planpythontestsuite("ad_dc_default:local", "samba.tests.samba_tool.forest")
956 planpythontestsuite("ad_dc_default:local", "samba.tests.samba_tool.schema")
957 planpythontestsuite("schema_dc:local", "samba.tests.samba_tool.schema")
958 planpythontestsuite("ad_dc:local", "samba.tests.samba_tool.ntacl")
959 planpythontestsuite("none", "samba.tests.samba_tool.provision_password_check")
960 planpythontestsuite("none", "samba.tests.samba_tool.provision_lmdb_size")
961 planpythontestsuite("none", "samba.tests.samba_tool.provision_userPassword_crypt")
962 planpythontestsuite("none", "samba.tests.samba_tool.help")
963 # Make sure samba-tool can execute without import failures when run
964 # without the ad-dc built. The fileserver test environment runs against
965 # the samba-h5l-build autobuild. This build was chosen because it's
966 # configured with --without-ad-dc and does not disable ads, which is
967 # required to run some samba-tool commands.
968 planpythontestsuite("fileserver", "samba.tests.samba_tool.help")
969
970 planpythontestsuite("ad_dc_default:local", "samba.tests.samba_tool.passwordsettings")
971 planpythontestsuite("ad_dc:local", "samba.tests.samba_tool.dsacl")
972
973 planpythontestsuite("none", "samba.tests.samba_upgradedns_lmdb")
974
975 # Run these against chgdcpass to share the runtime load
976 planpythontestsuite("chgdcpass:local", "samba.tests.samba_tool.sites")
977 planpythontestsuite("chgdcpass:local", "samba.tests.samba_tool.dnscmd")
978
979 # Run this against chgdcpass to ensure at least one python3 test
980 # against this autobuild target (samba-ad-dc-2)
981 planpythontestsuite("chgdcpass:local", "samba.tests.dcerpc.rpcecho")
982
983 planoldpythontestsuite("nt4_dc", "samba.tests.netbios", extra_args=['-U"$USERNAME%$PASSWORD"'])
984 test_bin = os.path.abspath(os.path.join(os.getenv('BINDIR', './bin'), '../python/samba/tests/bin'))
985 planoldpythontestsuite("ad_dc:local", "samba.tests.gpo", extra_args=['-U"$USERNAME%$PASSWORD"'],
986                        environ={'PATH':':'.join([test_bin, os.getenv('PATH', '')])})
987 planoldpythontestsuite("ad_member", "samba.tests.gpo_member", extra_args=['-U"$USERNAME%$PASSWORD"'])
988 planoldpythontestsuite("ad_dc:local", "samba.tests.dckeytab", extra_args=['-U"$USERNAME%$PASSWORD"'])
989
990 planoldpythontestsuite("ad_dc", "samba.tests.sid_strings")
991
992 # Run the import test in environments that may not have the ad-dc built
993 for env in ['fileserver_smb1', 'nt4_member', 'clusteredmember', 'ktest', 'nt4_dc', 'nt4_dc_smb1_done', 'nt4_dc_smb1', 'simpleserver', 'fileserver_smb1_done', 'fileserver', 'maptoguest', 'nt4_dc_schannel']:
994     planoldpythontestsuite(env, "samba.tests.imports")
995
996 have_fast_support = 1
997 claims_support = 0
998 compound_id_support = 0
999 if ('SAMBA4_USES_HEIMDAL' in config_hash or
1000     'HAVE_MIT_KRB5_1_20' in config_hash):
1001     tkt_sig_support = 1
1002 else:
1003     tkt_sig_support = 0
1004
1005 if 'SAMBA4_USES_HEIMDAL' in config_hash:
1006     full_sig_support = 1
1007 else:
1008     full_sig_support = 0
1009
1010 gnutls_pbkdf2_support = int('HAVE_GNUTLS_PBKDF2' in config_hash)
1011
1012 if 'HAVE_MIT_KRB5_1_20' in config_hash:
1013     kadmin_is_tgs = 1
1014 else:
1015     kadmin_is_tgs = 0
1016
1017 expect_pac = int('SAMBA4_USES_HEIMDAL' in config_hash)
1018 extra_pac_buffers = int('SAMBA4_USES_HEIMDAL' in config_hash)
1019 check_cname = int('SAMBA4_USES_HEIMDAL' in config_hash)
1020 check_padata = int('SAMBA4_USES_HEIMDAL' in config_hash)
1021 krb5_environ = {
1022     'SERVICE_USERNAME': '$SERVER',
1023     'ADMIN_USERNAME': '$DC_USERNAME',
1024     'ADMIN_PASSWORD': '$DC_PASSWORD',
1025     'ADMIN_KVNO': '1',
1026     'FOR_USER': '$DC_USERNAME',
1027     'STRICT_CHECKING':'0',
1028     'FAST_SUPPORT': have_fast_support,
1029     'CLAIMS_SUPPORT': claims_support,
1030     'COMPOUND_ID_SUPPORT': compound_id_support,
1031     'TKT_SIG_SUPPORT': tkt_sig_support,
1032     'FULL_SIG_SUPPORT': full_sig_support,
1033     'GNUTLS_PBKDF2_SUPPORT': gnutls_pbkdf2_support,
1034     'EXPECT_PAC': expect_pac,
1035     'EXPECT_EXTRA_PAC_BUFFERS': extra_pac_buffers,
1036     'CHECK_CNAME': check_cname,
1037     'CHECK_PADATA': check_padata,
1038     'KADMIN_IS_TGS': kadmin_is_tgs,
1039 }
1040 planoldpythontestsuite("none", "samba.tests.krb5.kcrypto")
1041 planoldpythontestsuite("ad_dc_default", "samba.tests.krb5.simple_tests",
1042                        environ=krb5_environ)
1043 for env, fast_support in [("ad_dc_default:local", True),
1044                           ("fl2003dc:local", False)]:
1045     planoldpythontestsuite(env, "samba.tests.krb5.s4u_tests",
1046                            environ={
1047                                **krb5_environ,
1048                                'FAST_SUPPORT': int(fast_support),
1049                            })
1050 planoldpythontestsuite("rodc:local", "samba.tests.krb5.rodc_tests",
1051                        environ=krb5_environ)
1052
1053 planoldpythontestsuite("ad_dc_default", "samba.tests.dsdb_dns")
1054
1055 planoldpythontestsuite("fl2008r2dc:local", "samba.tests.krb5.xrealm_tests",
1056                        environ=krb5_environ)
1057
1058 planoldpythontestsuite("ad_dc_default", "samba.tests.krb5.test_ccache",
1059                        environ=krb5_environ)
1060 planoldpythontestsuite("ad_dc_default", "samba.tests.krb5.test_ldap",
1061                        environ=krb5_environ)
1062 for env in ['ad_dc_default', 'ad_member']:
1063     planoldpythontestsuite(env, "samba.tests.krb5.test_rpc",
1064                            environ=krb5_environ)
1065 planoldpythontestsuite("ad_dc_smb1", "samba.tests.krb5.test_smb",
1066                        environ=krb5_environ)
1067 planoldpythontestsuite("ad_member_idmap_nss:local",
1068                        "samba.tests.krb5.test_min_domain_uid",
1069                        environ=krb5_environ)
1070 planoldpythontestsuite("ad_member_idmap_nss:local",
1071                        "samba.tests.krb5.test_idmap_nss",
1072                        environ={
1073                            **krb5_environ,
1074                            'MAPPED_USERNAME': 'bob',
1075                            'MAPPED_PASSWORD': 'Secret007',
1076                            'UNMAPPED_USERNAME': 'jane',
1077                            'UNMAPPED_PASSWORD': 'Secret007',
1078                            'INVALID_USERNAME': 'joe',
1079                            'INVALID_PASSWORD': 'Secret007',
1080                        })
1081
1082 for env in ["ad_dc", smbv1_disabled_testenv]:
1083     planoldpythontestsuite(env, "samba.tests.smb", extra_args=['-U"$USERNAME%$PASSWORD"'])
1084     planoldpythontestsuite(env + ":local", "samba.tests.ntacls_backup",
1085         extra_args=['-U"$USERNAME%$PASSWORD"'])
1086
1087 planoldpythontestsuite(
1088     "ad_dc_ntvfs:local", "samba.tests.dcerpc.registry",
1089     extra_args=['-U"$USERNAME%$PASSWORD"'])
1090
1091 planoldpythontestsuite("ad_dc_ntvfs", "samba.tests.dcerpc.dnsserver", extra_args=['-U"$USERNAME%$PASSWORD"'])
1092 planoldpythontestsuite("ad_dc", "samba.tests.dcerpc.dnsserver", extra_args=['-U"$USERNAME%$PASSWORD"'])
1093
1094 for env in ["chgdcpass", "ad_member"]:
1095     planoldpythontestsuite(env, "samba.tests.dcerpc.raw_protocol",
1096                            environ={"MAX_NUM_AUTH": "8",
1097                                     "USERNAME": "$DC_USERNAME",
1098                                     "PASSWORD": "$DC_PASSWORD"})
1099
1100 if have_heimdal_support:
1101     planoldpythontestsuite("ad_dc_smb1:local", "samba.tests.auth_log", extra_args=['-U"$USERNAME%$PASSWORD"'],
1102                            environ={'CLIENT_IP': '10.53.57.11',
1103                                     'SOCKET_WRAPPER_DEFAULT_IFACE': 11})
1104     planoldpythontestsuite("ad_dc_ntvfs:local", "samba.tests.auth_log", extra_args=['-U"$USERNAME%$PASSWORD"'],
1105                            environ={'CLIENT_IP': '10.53.57.11',
1106                                     'SOCKET_WRAPPER_DEFAULT_IFACE': 11})
1107     planoldpythontestsuite("ad_dc_smb1", "samba.tests.auth_log_pass_change",
1108                            extra_args=['-U"$USERNAME%$PASSWORD"'],
1109                            environ={'GNUTLS_PBKDF2_SUPPORT': gnutls_pbkdf2_support})
1110     planoldpythontestsuite("ad_dc_ntvfs", "samba.tests.auth_log_pass_change",
1111                            extra_args=['-U"$USERNAME%$PASSWORD"'],
1112                            environ={'GNUTLS_PBKDF2_SUPPORT': gnutls_pbkdf2_support})
1113
1114     # these tests use a NCA local RPC connection, so always run on the
1115     # :local testenv, and so don't need to fake a client connection
1116     for env in ["ad_dc_ntvfs:local", "ad_dc:local"]:
1117         planoldpythontestsuite(env, "samba.tests.auth_log_ncalrpc", extra_args=['-U"$USERNAME%$PASSWORD"'])
1118         planoldpythontestsuite(env, "samba.tests.auth_log_samlogon",
1119                                extra_args=['-U"$USERNAME%$PASSWORD"'])
1120         planoldpythontestsuite(env, "samba.tests.auth_log_netlogon",
1121                                extra_args=['-U"$USERNAME%$PASSWORD"'])
1122         planoldpythontestsuite(env, "samba.tests.auth_log_netlogon_bad_creds",
1123                                extra_args=['-U"$USERNAME%$PASSWORD"'])
1124
1125     planoldpythontestsuite("ad_member:local",
1126                            "samba.tests.auth_log_winbind",
1127                            extra_args=['-U"$DC_USERNAME%$DC_PASSWORD"'])
1128     planoldpythontestsuite("ad_dc", "samba.tests.audit_log_pass_change",
1129                            extra_args=['-U"$USERNAME%$PASSWORD"'],
1130                            environ={'GNUTLS_PBKDF2_SUPPORT': gnutls_pbkdf2_support})
1131     planoldpythontestsuite("ad_dc", "samba.tests.audit_log_dsdb",
1132                            extra_args=['-U"$USERNAME%$PASSWORD"'])
1133     planoldpythontestsuite("ad_dc", "samba.tests.group_audit",
1134                            extra_args=['-U"$USERNAME%$PASSWORD"'])
1135
1136 planoldpythontestsuite("fl2008r2dc:local",
1137                        "samba.tests.getdcname",
1138                        extra_args=['-U"$USERNAME%$PASSWORD"'])
1139
1140 planoldpythontestsuite("ad_dc_smb1",
1141                        "samba.tests.net_join_no_spnego",
1142                        extra_args=['-U"$USERNAME%$PASSWORD"'])
1143 planoldpythontestsuite("ad_dc",
1144                        "samba.tests.net_join",
1145                        extra_args=['-U"$USERNAME%$PASSWORD"'])
1146 planoldpythontestsuite("ad_dc",
1147                        "samba.tests.s3_net_join",
1148                        extra_args=['-U"$USERNAME%$PASSWORD"'])
1149 planoldpythontestsuite("ad_dc",
1150                        "samba.tests.segfault",
1151                        extra_args=['-U"$USERNAME%$PASSWORD"'])
1152 # Need to test the password hashing in multiple environments to ensure that
1153 # all the possible options are covered
1154 #
1155 # ad_dc:local functional_level >= 2008, gpg keys available
1156 planoldpythontestsuite("ad_dc:local",
1157                        "samba.tests.password_hash_gpgme",
1158                        extra_args=['-U"$USERNAME%$PASSWORD"'])
1159 # ad_dc_ntvfs:local functional level >= 2008, gpg keys not available
1160 planoldpythontestsuite("ad_dc_ntvfs:local",
1161                        "samba.tests.password_hash_fl2008",
1162                        extra_args=['-U"$USERNAME%$PASSWORD"'])
1163 # fl2003dc:local functional level < 2008, gpg keys not available
1164 planoldpythontestsuite("fl2003dc:local",
1165                        "samba.tests.password_hash_fl2003",
1166                        extra_args=['-U"$USERNAME%$PASSWORD"'])
1167 # ad_dc: wDigest values over ldap
1168 planoldpythontestsuite("ad_dc",
1169                        "samba.tests.password_hash_ldap",
1170                        extra_args=['-U"$USERNAME%$PASSWORD"'])
1171
1172 for env in ["ad_dc_backup", smbv1_disabled_testenv]:
1173     planoldpythontestsuite(env + ":local", "samba.tests.domain_backup",
1174                            extra_args=['-U"$USERNAME%$PASSWORD"'])
1175
1176 planoldpythontestsuite("ad_dc",
1177                        "samba.tests.domain_backup_offline")
1178 # Encrypted secrets
1179 # ensure default provision (ad_dc) and join (vampire_dc)
1180 # encrypt secret values on disk.
1181 planoldpythontestsuite("ad_dc:local",
1182                        "samba.tests.encrypted_secrets",
1183                        extra_args=['-U"$USERNAME%$PASSWORD"'])
1184 planoldpythontestsuite("vampire_dc:local",
1185                        "samba.tests.encrypted_secrets",
1186                        extra_args=['-U"$USERNAME%$PASSWORD"'])
1187 # The fl2000dc environment is provisioned with the --plaintext_secrets option
1188 # so this test will fail, which proves the secrets are not being encrypted.
1189 # There is an entry in known_fail.d.
1190 planoldpythontestsuite("fl2000dc:local",
1191                        "samba.tests.encrypted_secrets",
1192                        extra_args=['-U"$USERNAME%$PASSWORD"'])
1193
1194 planpythontestsuite("none",
1195                     "samba.tests.lsa_string")
1196
1197 planoldpythontestsuite("ad_dc_ntvfs",
1198                        "samba.tests.krb5_credentials",
1199                        extra_args=['-U"$USERNAME%$PASSWORD"'])
1200
1201 for env in ["ad_dc_ntvfs", "vampire_dc", "promoted_dc"]:
1202     planoldpythontestsuite(env,
1203                            "samba.tests.py_credentials",
1204                            extra_args=['-U"$USERNAME%$PASSWORD"'])
1205 planoldpythontestsuite("ad_dc_ntvfs",
1206                        "samba.tests.emulate.traffic",
1207                        extra_args=['-U"$USERNAME%$PASSWORD"'])
1208 planoldpythontestsuite("ad_dc_ntvfs",
1209                        "samba.tests.emulate.traffic_packet",
1210                        extra_args=['-U"$USERNAME%$PASSWORD"'])
1211 planoldpythontestsuite("ad_dc_ntvfs",
1212                        "samba.tests.blackbox.traffic_replay",
1213                        extra_args=['-U"$USERNAME%$PASSWORD"'])
1214 planoldpythontestsuite("ad_dc_ntvfs",
1215                        "samba.tests.blackbox.traffic_learner",
1216                        extra_args=['-U"$USERNAME%$PASSWORD"'])
1217 planoldpythontestsuite("ad_dc_ntvfs",
1218                        "samba.tests.blackbox.traffic_summary",
1219                        extra_args=['-U"$USERNAME%$PASSWORD"'])
1220 planoldpythontestsuite("none", "samba.tests.loadparm")
1221 planoldpythontestsuite("fileserver",
1222                        "samba.tests.blackbox.mdsearch",
1223                        extra_args=['-U"$USERNAME%$PASSWORD"'])
1224 planoldpythontestsuite("fileserver",
1225                        "samba.tests.blackbox.smbcacls_basic")
1226 planoldpythontestsuite("fileserver",
1227                        "samba.tests.blackbox.smbcacls_basic",
1228                        "samba.tests.blackbox.smbcacls_basic(DFS)",
1229                        environ={'SHARE': 'msdfs-share',
1230                                  'TESTDIR': 'smbcacls_sharedir_dfs'})
1231 # Run smbcacls_propagate_inhertance tests on non msdfs root share
1232 planoldpythontestsuite("fileserver",
1233                        "samba.tests.blackbox.smbcacls_propagate_inhertance")
1234 #
1235 # A) Run the smbcacls_propagate_inhertance tests on a msdfs root share
1236 #    *without* any nested dfs links
1237 # B) Run the smbcacls_propagate_inhertance tests on a msdfs root share
1238 #    *with* a nested dfs link
1239 #
1240 planoldpythontestsuite("fileserver",
1241                        "samba.tests.blackbox.smbcacls_dfs_propagate_inherit",
1242                        "samba.tests.blackbox.smbcacls_dfs_propagate_inherit(DFS-msdfs-root)",
1243                        environ={'SHARE': 'smbcacls_share'})
1244 #
1245 # Want a selection of environments across the process models
1246 #
1247 for env in ["ad_dc_ntvfs:local", "ad_dc:local",
1248             "fl2003dc:local", "fl2008r2dc:local",
1249             "promoted_dc:local"]:
1250     planoldpythontestsuite(env, "samba.tests.blackbox.smbcontrol")
1251
1252 planoldpythontestsuite("none", "samba.tests.blackbox.downgradedatabase")
1253
1254 planpythontestsuite("ad_member:local", "samba.tests.blackbox.netads_dns")
1255
1256 plantestsuite_loadlist("samba4.ldap.python(ad_dc_default)", "ad_dc_default", [python, os.path.join(DSDB_PYTEST_DIR, "ldap.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
1257
1258 plantestsuite_loadlist("samba4.ldap_modify_order.python(ad_dc_default)",
1259                        "ad_dc_default",
1260                        [python, os.path.join(samba4srcdir,
1261                                              "dsdb/tests/python/"
1262                                              "ldap_modify_order.py"),
1263                         # add "-v" here to diagnose
1264                         '$SERVER',
1265                         '-U"$USERNAME%$PASSWORD"',
1266                         '--workgroup=$DOMAIN',
1267                         '$LOADLIST',
1268                         '$LISTOPT'])
1269
1270 plantestsuite_loadlist("samba4.ldap_modify_order.normal_user.python(ad_dc_default)",
1271                        "ad_dc_default",
1272                        [python, os.path.join(samba4srcdir,
1273                                              "dsdb/tests/python/"
1274                                              "ldap_modify_order.py"),
1275                         '--normal-user',
1276                         # add "-v" here to diagnose
1277                         '$SERVER',
1278                         '-U"$USERNAME%$PASSWORD"',
1279                         '--workgroup=$DOMAIN',
1280                         '$LOADLIST',
1281                         '$LISTOPT'])
1282
1283 planoldpythontestsuite("ad_dc",
1284                        "samba.tests.ldap_raw",
1285                        extra_args=['-U"$USERNAME%$PASSWORD"'],
1286                        environ={'TEST_ENV': 'ad_dc'})
1287
1288 plantestsuite_loadlist("samba.tests.ldap_spn", "ad_dc",
1289                        [python,
1290                         f"{srcdir()}/python/samba/tests/ldap_spn.py",
1291                         '$SERVER',
1292                         '-U"$USERNAME%$PASSWORD"',
1293                         '--workgroup=$DOMAIN',
1294                         '$LOADLIST', '$LISTOPT'])
1295
1296 plantestsuite_loadlist("samba.tests.ldap_upn_sam_account", "ad_dc_ntvfs",
1297                        [python,
1298                         f"{srcdir()}/python/samba/tests/ldap_upn_sam_account.py",
1299                         '$SERVER',
1300                         '-U"$USERNAME%$PASSWORD"',
1301                         '--workgroup=$DOMAIN',
1302                         '$LOADLIST', '$LISTOPT'])
1303
1304
1305 plantestsuite_loadlist("samba4.tokengroups.krb5.python", "ad_dc_default:local", [python, os.path.join(DSDB_PYTEST_DIR, "token_group.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '-k', 'yes', '$LOADLIST', '$LISTOPT'])
1306 plantestsuite_loadlist("samba4.tokengroups.ntlm.python", "ad_dc_default:local", [python, os.path.join(DSDB_PYTEST_DIR, "token_group.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '-k', 'no', '$LOADLIST', '$LISTOPT'])
1307 plantestsuite("samba4.sam.python(fl2008r2dc)", "fl2008r2dc", [python, os.path.join(DSDB_PYTEST_DIR, "sam.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
1308 plantestsuite("samba4.sam.python(ad_dc_default)", "ad_dc_default", [python, os.path.join(DSDB_PYTEST_DIR, "sam.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
1309 plantestsuite("samba4.asq.python(ad_dc_default)", "ad_dc_default", [python, os.path.join(DSDB_PYTEST_DIR, "asq.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
1310 plantestsuite("samba4.user_account_control.python(ad_dc_default)", "ad_dc_default", [python, os.path.join(DSDB_PYTEST_DIR, "user_account_control.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
1311 plantestsuite("samba4.priv_attrs.python(ad_dc_default)", "ad_dc_default", ["STRICT_CHECKING=0", python, os.path.join(DSDB_PYTEST_DIR, "priv_attrs.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
1312 plantestsuite("samba4.priv_attrs.strict.python(ad_dc_default)", "ad_dc_default", [python, os.path.join(DSDB_PYTEST_DIR, "priv_attrs.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
1313
1314 for env in ['ad_dc_default:local', 'schema_dc:local']:
1315     planoldpythontestsuite(env, "dsdb_schema_info",
1316                            extra_path=[os.path.join(samba4srcdir, 'dsdb/tests/python')],
1317                            name="samba4.schemaInfo.python(%s)" % (env),
1318             extra_args=['-U"$DOMAIN/$DC_USERNAME%$DC_PASSWORD"'])
1319
1320     planpythontestsuite(env, "samba.tests.dsdb_schema_attributes")
1321
1322 plantestsuite_loadlist("samba4.urgent_replication.python(ad_dc_ntvfs)", "ad_dc_ntvfs:local", [python, os.path.join(DSDB_PYTEST_DIR, "urgent_replication.py"), '$PREFIX_ABS/ad_dc_ntvfs/private/sam.ldb', '$LOADLIST', '$LISTOPT'])
1323 plantestsuite_loadlist("samba4.ldap.dirsync.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(DSDB_PYTEST_DIR, "dirsync.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
1324 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'])
1325 plantestsuite("samba4.ldap.index.python", "none", [python, os.path.join(srcdir(), "lib/ldb-samba/tests/index.py")])
1326 plantestsuite_loadlist("samba4.ldap.notification.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(DSDB_PYTEST_DIR, "notification.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
1327 plantestsuite_loadlist("samba4.ldap.sites.python(ad_dc_default)", "ad_dc_default", [python, os.path.join(DSDB_PYTEST_DIR, "sites.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
1328
1329 env = 'vampire_dc'
1330 # Test with LMDB (GSSAPI/SASL bind)
1331 plantestsuite_loadlist("samba4.ldap.large_ldap.gssapi.python(%s)" % env, env, [python, os.path.join(DSDB_PYTEST_DIR, "large_ldap.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--kerberos=yes', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
1332
1333 env = 'ad_dc_default'
1334 # Test with TDB (NTLMSSP bind)
1335 plantestsuite_loadlist("samba4.ldap.large_ldap.ntlmssp.python(%s)" % env, env, [python, os.path.join(DSDB_PYTEST_DIR, "large_ldap.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--kerberos=no', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
1336
1337 env = 'ad_dc_ntvfs'
1338 # Test with ldaps://
1339 plantestsuite_loadlist("samba4.ldap.large_ldap.ldaps.python(%s)" % env, env, [python, os.path.join(DSDB_PYTEST_DIR, "large_ldap.py"), 'ldaps://$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
1340
1341 env = 'fl2008r2dc'
1342 # Test with straight ldap
1343 plantestsuite_loadlist("samba4.ldap.large_ldap.straight_ldap.python(%s)" % env, env, [python, os.path.join(DSDB_PYTEST_DIR, "large_ldap.py"), 'ldap://$SERVER',     '--simple-bind-dn=$USERNAME@$REALM', '--password=$PASSWORD', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
1344
1345 planoldpythontestsuite("ad_dc_default", "sort", environ={'SERVER' : '$SERVER', 'DATA_DIR' : os.path.join(samba4srcdir, 'dsdb/tests/python/testdata/')}, name="samba4.ldap.sort.python", extra_path=[os.path.join(samba4srcdir, 'dsdb/tests/python')], extra_args=['-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
1346
1347 plantestsuite_loadlist("samba4.ldap.linked_attributes.python(ad_dc_ntvfs)", "ad_dc_ntvfs:local", [python, os.path.join(DSDB_PYTEST_DIR, "linked_attributes.py"), '$PREFIX_ABS/ad_dc_ntvfs/private/sam.ldb', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
1348
1349 plantestsuite_loadlist("samba4.ldap.subtree_rename.python(ad_dc_ntvfs)",
1350                        "ad_dc_ntvfs:local",
1351                        [python, os.path.join(samba4srcdir,
1352                                              "dsdb/tests/python/subtree_rename.py"),
1353                         '$PREFIX_ABS/ad_dc_ntvfs/private/sam.ldb',
1354                         '-U"$USERNAME%$PASSWORD"',
1355                         '--workgroup=$DOMAIN',
1356                         '$LOADLIST',
1357                         '$LISTOPT'])
1358
1359 planoldpythontestsuite(
1360     "ad_dc_ntvfs",
1361     "samba.tests.ldap_referrals",
1362     environ={
1363         'SERVER': '$SERVER',
1364     },
1365     name="samba.ldap.referrals",
1366     extra_args=['-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
1367
1368 # These should be the first tests run against testenvs created by backup/restore
1369 for env in ['offlinebackupdc', 'restoredc', 'renamedc', 'labdc']:
1370     # check that a restored DC matches the original DC (backupfromdc)
1371     plantestsuite("samba4.blackbox.ldapcmp_restore", env,
1372                   ["PYTHON=%s" % python,
1373                    os.path.join(bbdir, "ldapcmp_restoredc.sh"),
1374                    '$PREFIX_ABS/backupfromdc', '$PREFIX_ABS/%s' % env])
1375
1376 # we also test joining backupfromdc here, as it's a bit special in that it
1377 # doesn't have Default-First-Site-Name
1378 for env in ['backupfromdc', 'offlinebackupdc', 'restoredc', 'renamedc',
1379             'labdc']:
1380     # basic test that we can join the testenv DC
1381     plantestsuite("samba4.blackbox.join_ldapcmp", env,
1382                   ["PYTHON=%s" % python, os.path.join(bbdir, "join_ldapcmp.sh")])
1383
1384 env = 'backupfromdc'
1385 planoldpythontestsuite("%s:local" % env, "samba_tool_drs_no_dns",
1386                        extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
1387                        name="samba4.drs.samba_tool_drs_no_dns.python(%s)" % env,
1388                        environ={'DC1': '$DC_SERVER', 'DC2': '$DC_SERVER'},
1389                        extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
1390
1391 plantestsuite_loadlist("samba4.ldap.rodc.python(rodc)", "rodc",
1392                        [python,
1393                         os.path.join(DSDB_PYTEST_DIR, "rodc.py"),
1394                         '$SERVER', '-U"$USERNAME%$PASSWORD"',
1395                         '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
1396
1397 plantestsuite_loadlist("samba4.ldap.rodc_rwdc.python(rodc)", "rodc:local",
1398                        [python,
1399                         os.path.join(samba4srcdir,
1400                                      "dsdb/tests/python/rodc_rwdc.py"),
1401                         '$SERVER', '$DC_SERVER', '-U"$USERNAME%$PASSWORD"',
1402                         '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
1403
1404 planoldpythontestsuite("rodc:local", "replica_sync_rodc",
1405                        extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
1406                        name="samba4.drs.replica_sync_rodc.python(rodc)",
1407                        environ={'DC1': '$DC_SERVER', 'DC2': '$SERVER'},
1408                        extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
1409
1410 planoldpythontestsuite("ad_dc_default_smb1", "password_settings",
1411                        extra_path=[os.path.join(samba4srcdir, 'dsdb/tests/python')],
1412                        name="samba4.ldap.passwordsettings.python",
1413                        extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
1414
1415 for env in all_fl_envs + ["schema_dc"]:
1416     plantestsuite_loadlist("samba4.ldap_schema.python(%s)" % env, env, [python, os.path.join(DSDB_PYTEST_DIR, "ldap_schema.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
1417     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"])
1418     plantestsuite_loadlist("samba4.ldap.secdesc.python(%s)" % env, env, [python, os.path.join(DSDB_PYTEST_DIR, "sec_descriptor.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
1419     plantestsuite_loadlist("samba4.ldap.acl.python(%s)" % env, env, ["STRICT_CHECKING=0", python, os.path.join(DSDB_PYTEST_DIR, "acl.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
1420
1421 for env in all_fl_envs + ["schema_dc", "ad_dc_no_ntlm"]:
1422     if env != "fl2000dc":
1423         # This test makes excessive use of the "userPassword" attribute which
1424         # isn't available on DCs with Windows 2000 domain function level -
1425         # therefore skip it in that configuration
1426         plantestsuite_loadlist("samba4.ldap.passwords.python(%s)" % env, env, [python, os.path.join(DSDB_PYTEST_DIR, "passwords.py"), "$SERVER", '-U"$USERNAME%$PASSWORD"', "-W$DOMAIN", '$LOADLIST', '$LISTOPT'])
1427
1428 for env in ["ad_dc_slowtests"]:
1429     # This test takes a lot of time, so we run it against a minimum of
1430     # environments, please only add new ones if there's really a
1431     # difference we need to test
1432     plantestsuite_loadlist("samba4.ldap.vlv.python(%s)" % env, env, [python, os.path.join(DSDB_PYTEST_DIR, "vlv.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
1433     plantestsuite_loadlist("samba4.ldap.confidential_attr.python(%s)" % env, env, [python, os.path.join(DSDB_PYTEST_DIR, "confidential_attr.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
1434     plantestsuite_loadlist("samba4.ldap.password_lockout.python(%s)" % env, env, [python, os.path.join(DSDB_PYTEST_DIR, "password_lockout.py"), "$SERVER", '-U"$USERNAME%$PASSWORD"', "-W$DOMAIN", "--realm=$REALM", '$LOADLIST', '$LISTOPT'])
1435     planoldpythontestsuite(env, "tombstone_reanimation",
1436                            name="samba4.tombstone_reanimation.python",
1437                            environ={'TEST_SERVER': '$SERVER', 'TEST_USERNAME': '$USERNAME', 'TEST_PASSWORD': '$PASSWORD'},
1438                            extra_path=[os.path.join(samba4srcdir, 'dsdb/tests/python')]
1439                            )
1440     planoldpythontestsuite(env, "samba.tests.join",
1441                            name="samba.tests.join.python(%s)" % env,
1442                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
1443
1444 # this is a basic sanity-check of Kerberos/NTLM user login
1445 for env in ["offlinebackupdc", "restoredc", "renamedc", "labdc", "ad_dc_no_ntlm"]:
1446     plantestsuite_loadlist("samba4.ldap.login_basics.python(%s)" % env, env,
1447                            [python, os.path.join(DSDB_PYTEST_DIR, "login_basics.py"),
1448                             "$SERVER", '-U"$USERNAME%$PASSWORD"', "-W$DOMAIN", "--realm=$REALM",
1449                             '$LOADLIST', '$LISTOPT'])
1450
1451 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.upgradeprovisionneeddc")
1452 planpythontestsuite("ad_dc:local", "samba.tests.posixacl")
1453 planpythontestsuite("ad_dc_no_nss:local", "samba.tests.posixacl")
1454 plantestsuite_loadlist("samba4.deletetest.python(ad_dc_default)", "ad_dc_default", [python, os.path.join(DSDB_PYTEST_DIR, "deletetest.py"),
1455                                                                                 '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
1456 plantestsuite("samba4.blackbox.samba3dump", "none", [os.path.join(samba4srcdir, "selftest/test_samba3dump.sh")])
1457 plantestsuite("samba4.blackbox.upgrade", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_s3upgrade.sh"), '$PREFIX/provision'])
1458 plantestsuite("samba4.blackbox.provision.py", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_provision.sh"), '$PREFIX/provision'])
1459 plantestsuite("samba4.blackbox.provision_fileperms", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/provision_fileperms.sh"), '$PREFIX/provision'])
1460 plantestsuite("samba4.blackbox.supported_features", "none",
1461               ["PYTHON=%s" % python,
1462                os.path.join(samba4srcdir,
1463                             "setup/tests/blackbox_supported_features.sh"),
1464                '$PREFIX/provision'])
1465 plantestsuite("samba4.blackbox.start_backup", "none",
1466               ["PYTHON=%s" % python,
1467                os.path.join(samba4srcdir,
1468                             "setup/tests/blackbox_start_backup.sh"),
1469                '$PREFIX/provision'])
1470 plantestsuite("samba4.blackbox.upgradeprovision.current", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_upgradeprovision.sh"), '$PREFIX/provision'])
1471 plantestsuite("samba4.blackbox.setpassword.py", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_setpassword.sh"), '$PREFIX/provision'])
1472 plantestsuite("samba4.blackbox.newuser.py", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_newuser.sh"), '$PREFIX/provision'])
1473 plantestsuite("samba4.blackbox.group.py", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_group.sh"), '$PREFIX/provision'])
1474 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'])
1475 plantestsuite_loadlist("samba4.ldap.bind(fl2008r2dc)", "fl2008r2dc", [python, os.path.join(srcdir(), "auth/credentials/tests/bind.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '$LOADLIST', '$LISTOPT'])
1476
1477 # This makes sure we test the rid allocation code
1478 t = "rpc.samr.large-dc"
1479 plansmbtorture4testsuite(t, "vampire_dc", ['$SERVER', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], modname=("samba4.%s.one" % t))
1480 plansmbtorture4testsuite(t, "vampire_dc", ['$SERVER', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], modname="samba4.%s.two" % t)
1481
1482 # RPC smoke-tests for testenvs of interest (RODC, etc)
1483 for env in ['rodc', 'offlinebackupdc', 'restoredc', 'renamedc', 'labdc']:
1484     plansmbtorture4testsuite('rpc.echo', env, ['ncacn_np:$SERVER', "-k", "yes", '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], modname="samba4.rpc.echo")
1485     plansmbtorture4testsuite('rpc.echo', "%s:local" % env, ['ncacn_np:$SERVER', "-k", "yes", '-P', '--workgroup=$DOMAIN'], modname="samba4.rpc.echo")
1486     plansmbtorture4testsuite('rpc.echo', "%s:local" % env, ['ncacn_np:$SERVER', "-k", "no", '-Utestallowed\ account%$DC_PASSWORD', '--workgroup=$DOMAIN'], modname="samba4.rpc.echo.testallowed")
1487     plansmbtorture4testsuite('rpc.echo', "%s:local" % env, ['ncacn_np:$SERVER', "-k", "no", '-Utestdenied%$DC_PASSWORD', '--workgroup=$DOMAIN'], modname="samba4.rpc.echo.testdenied")
1488     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', binpath('smbclient')])
1489
1490 planpythontestsuite("rodc:local", "samba.tests.samba_tool.rodc")
1491
1492 plantestsuite("samba.blackbox.rpcclient_samlogon", "rodc:local", [os.path.join(samba3srcdir, "script/tests/test_rpcclient_samlogon.sh"),
1493                                                                   "$DC_USERNAME", "$DC_PASSWORD", "ncacn_np:$SERVER", configuration])
1494
1495 plantestsuite("samba.blackbox.rpcclient_samlogon_testallowed", "rodc:local", [os.path.join(samba3srcdir, "script/tests/test_rpcclient_samlogon.sh"),
1496                                                                               "testallowed\ account", "$DC_PASSWORD", "ncacn_np:$SERVER", configuration])
1497
1498 plantestsuite("samba.blackbox.rpcclient_samlogon_testdenied", "rodc:local", [os.path.join(samba3srcdir, "script/tests/test_rpcclient_samlogon.sh"),
1499                                                                              "testdenied", "$DC_PASSWORD", "ncacn_np:$SERVER", configuration])
1500
1501
1502 # Test renaming the DC
1503 plantestsuite("samba4.blackbox.renamedc.sh", "none", ["PYTHON=%s" % python, os.path.join(bbdir, "renamedc.sh"), '$PREFIX/provision'])
1504
1505 # DRS python tests
1506 # Note that $DC_SERVER is the PDC (e.g. ad_dc_ntvfs) and $SERVER is
1507 # the 2nd DC (e.g. vampire_dc).
1508
1509 env = 'vampire_dc'
1510 planoldpythontestsuite(env, "ridalloc_exop",
1511                        extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
1512                        name="samba4.drs.ridalloc_exop.python(%s)" % env,
1513                        environ={'DC1': "$DC_SERVER", 'DC2': '$SERVER'},
1514                        extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
1515
1516 # This test can pollute the environment a little by creating and
1517 # deleting DCs which can get into the replication state for a while.
1518 #
1519 # The setting of DC1 to $DC_SERVER means that it will join towards and
1520 # operate on schema_dc.  This matters most when running
1521 # test_samba_tool_replicate_local as this sets up a full temp DC and
1522 # does new replication to it, which can show up in the replication
1523 # topology.
1524 #
1525 # That is why this test is run on the isolated environment and not on
1526 # those connected with ad_dc (vampiredc/promoteddc)
1527 #
1528 # The chgdcpass enviroment is likewise isolated and emulates Samba 4.5
1529 # with regard to GET_ANC
1530
1531 env = 'schema_pair_dc'
1532 planoldpythontestsuite("%s:local" % env, "samba_tool_drs",
1533                        extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
1534                        name="samba4.drs.samba_tool_drs.python(%s)" % env,
1535                        environ={'DC1': '$DC_SERVER', 'DC2': '$SERVER'},
1536                        extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
1537 for env in ['chgdcpass', 'schema_pair_dc']:
1538     planoldpythontestsuite("%s:local" % env, "samba_tool_drs_critical",
1539                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
1540                            name="samba4.drs.samba_tool_drs_critical.python(%s)" % env,
1541                            environ={'DC1': '$DC_SERVER', 'DC2': '$SERVER'},
1542                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
1543 planoldpythontestsuite(env, "getnc_schema",
1544                        extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
1545                        name="samba4.drs.getnc_schema.python(%s)" % env,
1546                        environ={'DC1': "$DC_SERVER", 'DC2': '$SERVER',
1547                                 "PLEASE_BREAK_MY_WINDOWS": "1"},
1548                        extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
1549
1550 # This test can be sensitive to the DC joins and replications don in
1551 # "samba_tool_drs" so run this is run against scheam_pair_dc/schema_dc
1552 # not the set of environments connected with ad_dc.
1553
1554 # This will show the replication state of ad_dc
1555 planoldpythontestsuite("promoted_dc:local", "samba_tool_drs_showrepl",
1556                        extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
1557                        name="samba4.drs.samba_tool_drs_showrepl.python(%s)" % env,
1558                        environ={'DC1': '$DC_SERVER', 'DC2': '$SERVER'},
1559                        extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
1560
1561 for env in ['vampire_dc', 'promoted_dc']:
1562     planoldpythontestsuite("%s:local" % env, "replica_sync",
1563                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
1564                            name="samba4.drs.replica_sync.python(%s)" % env,
1565                            environ={'DC1': '$DC_SERVER', 'DC2': '$SERVER'},
1566                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
1567     planoldpythontestsuite(env, "delete_object",
1568                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
1569                            name="samba4.drs.delete_object.python(%s)" % env,
1570                            environ={'DC1': '$DC_SERVER', 'DC2': '$SERVER'},
1571                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
1572     planoldpythontestsuite(env, "fsmo",
1573                            name="samba4.drs.fsmo.python(%s)" % env,
1574                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
1575                            environ={'DC1': "$DC_SERVER", 'DC2': '$SERVER'},
1576                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
1577     planoldpythontestsuite(env, "repl_secdesc",
1578                            name="samba4.drs.repl_secdesc.python(%s)" % env,
1579                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
1580                            environ={'DC1': "$DC_SERVER", 'DC2': '$SERVER'},
1581                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
1582     planoldpythontestsuite(env, "repl_move",
1583                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
1584                            name="samba4.drs.repl_move.python(%s)" % env,
1585                            environ={'DC1': "$DC_SERVER", 'DC2': '$SERVER'},
1586                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
1587     planoldpythontestsuite(env, "getnc_unpriv",
1588                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
1589                            name="samba4.drs.getnc_unpriv.python(%s)" % env,
1590                            environ={'DC1': "$DC_SERVER", 'DC2': '$SERVER'},
1591                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
1592     planoldpythontestsuite(env, "linked_attributes_drs",
1593                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
1594                            name="samba4.drs.linked_attributes_drs.python(%s)" % env,
1595                            environ={'DC1': "$DC_SERVER", 'DC2': '$SERVER'},
1596                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
1597     planoldpythontestsuite(env, "link_conflicts",
1598                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
1599                            name="samba4.drs.link_conflicts.python(%s)" % env,
1600                            environ={'DC1': "$DC_SERVER", 'DC2': '$SERVER'},
1601                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
1602
1603 # Environment chgdcpass has the Samba 4.5 GET_ANC behaviour, which we
1604 # set a knownfail to expect
1605 for env in ['vampire_dc', 'promoted_dc', 'chgdcpass']:
1606     planoldpythontestsuite(env, "getnc_exop",
1607                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
1608                            name="samba4.drs.getnc_exop.python(%s)" % env,
1609                            environ={'DC1': "$DC_SERVER", 'DC2': '$SERVER'},
1610                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
1611
1612 for env in ['vampire_dc', 'promoted_dc', 'vampire_2000_dc']:
1613     planoldpythontestsuite(env, "repl_schema",
1614                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
1615                            name="samba4.drs.repl_schema.python(%s)" % env,
1616                            environ={'DC1': "$DC_SERVER", 'DC2': '$SERVER'},
1617                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
1618
1619 # A side-effect of the getncchanges tests is that they will create hundreds of
1620 # tombstone objects, so run them last to avoid interferring with (and slowing
1621 # down) the other DRS tests
1622 for env in ['vampire_dc', 'promoted_dc']:
1623     planoldpythontestsuite(env, "getncchanges",
1624                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
1625                            name="samba4.drs.getncchanges.python(%s)" % env,
1626                            environ={'DC1': "$DC_SERVER", 'DC2': '$SERVER'},
1627                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
1628
1629 for env in ['ad_dc_ntvfs']:
1630     planoldpythontestsuite(env, "repl_rodc",
1631                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
1632                            name="samba4.drs.repl_rodc.python(%s)" % env,
1633                            environ={'DC1': "$DC_SERVER", 'DC2': '$DC_SERVER'},
1634                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
1635     planoldpythontestsuite(env, "cracknames",
1636                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
1637                            name="samba4.drs.cracknames.python(%s)" % env,
1638                            environ={'DC1': "$DC_SERVER", 'DC2': '$DC_SERVER'},
1639                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
1640
1641 planoldpythontestsuite("chgdcpass:local", "samba.tests.blackbox.samba_dnsupdate",
1642                        environ={'DNS_SERVER_IP': '$SERVER_IP'})
1643
1644 for env in ["s4member", "rodc", "promoted_dc", "ad_dc", "ad_member"]:
1645     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])
1646
1647 # Offline logon (ad_member)
1648 plantestsuite("samba.blackbox.offline_logon",
1649               "ad_member_offlogon",
1650               [os.path.join(bbdir, "test_offline_logon.sh"),
1651                '$DOMAIN',
1652                'alice', 'Secret007',
1653                'bob', 'Secret007',
1654                'jane', 'Secret007',
1655                'joe', 'Secret007'])
1656
1657 #
1658 # KDC Tests
1659 #
1660
1661 # This test is for users cached at the RODC
1662 plansmbtorture4testsuite('krb5.kdc', "rodc", ['ncacn_np:$SERVER_IP', "-k", "yes", '-Utestdenied%$PASSWORD',
1663                                               '--workgroup=$DOMAIN', '--realm=$REALM',
1664                                               '--option=torture:krb5-upn=testdenied_upn@$REALM.upn',
1665                                               '--option=torture:expect_rodc=true'],
1666                          "samba4.krb5.kdc with account DENIED permission to replicate to an RODC")
1667 plansmbtorture4testsuite('krb5.kdc', "rodc", ['ncacn_np:$SERVER_IP', "-k", "yes", '-Utestallowed\ account%$PASSWORD',
1668                                               '--workgroup=$DOMAIN', '--realm=$REALM',
1669                                               '--option=torture:expect_machine_account=true',
1670                                               '--option=torture:krb5-upn=testallowed\ upn@$REALM',
1671                                               '--option=torture:krb5-hostname=testallowed',
1672                                               '--option=torture:expect_rodc=true',
1673                                               '--option=torture:expect_cached_at_rodc=true'],
1674                          "samba4.krb5.kdc with account ALLOWED permission to replicate to an RODC")
1675
1676 # This ensures we have correct behaviour on a server that is not not the PDC emulator
1677 env = "promoted_dc"
1678 plansmbtorture4testsuite('krb5.kdc', env, ['ncacn_np:$SERVER_IP', "-k", "yes", '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', '--realm=$REALM'],
1679                          "samba4.krb5.kdc with specified account")
1680 plansmbtorture4testsuite('krb5.kdc', env, ['ncacn_np:$SERVER_IP', "-k", "yes", '-Utestupnspn%$PASSWORD', '--workgroup=$DOMAIN', '--realm=$REALM',
1681                                            '--option=torture:expect_machine_account=true',
1682                                            '--option=torture:krb5-upn=http/testupnspn.$DNSNAME@$REALM',
1683                                            '--option=torture:krb5-hostname=testupnspn.$DNSNAME',
1684                                            '--option=torture:krb5-service=http'],
1685                          "samba4.krb5.kdc with account having identical UPN and SPN")
1686 for env in ["fl2008r2dc", "fl2003dc"]:
1687     fast_support = have_fast_support
1688     if env in ["fl2003dc"]:
1689         fast_support = 0
1690     planoldpythontestsuite(env, "samba.tests.krb5.as_req_tests",
1691                            environ={
1692                                **krb5_environ,
1693                                'FAST_SUPPORT': fast_support,
1694                            })
1695
1696 planoldpythontestsuite('fl2008r2dc', 'samba.tests.krb5.salt_tests',
1697                        environ=krb5_environ)
1698
1699 for env in ["rodc", "promoted_dc", "fl2000dc", "fl2008r2dc"]:
1700     if env == "rodc":
1701         # The machine account is cached at the RODC, as it is the local account
1702         extra_options = ['--option=torture:expect_rodc=true', '--option=torture:expect_cached_at_rodc=true']
1703     else:
1704         extra_options = []
1705
1706     plansmbtorture4testsuite('krb5.kdc', "%s:local" % env, ['ncacn_np:$SERVER_IP', "-k", "yes", '-P',
1707                                                             '--workgroup=$DOMAIN', '--realm=$REALM',
1708                                                             '--option=torture:krb5-hostname=$SERVER',
1709                                                             '--option=torture:run_removedollar_test=true',
1710                                                             '--option=torture:expect_machine_account=true'] + extra_options,
1711                              "samba4.krb5.kdc with machine account")
1712
1713 planpythontestsuite("ad_dc", "samba.tests.krb5.as_canonicalization_tests",
1714                     environ=krb5_environ)
1715 for env, fast_support in [("ad_dc", True),
1716                           ("fl2003dc", False)]:
1717     planpythontestsuite(env, "samba.tests.krb5.compatability_tests",
1718                         environ={
1719                             **krb5_environ,
1720                             'FAST_SUPPORT': int(fast_support),
1721                         })
1722 planpythontestsuite("ad_dc", "samba.tests.krb5.kdc_tests",
1723                     environ=krb5_environ)
1724 planpythontestsuite(
1725     "ad_dc",
1726     "samba.tests.krb5.kdc_tgs_tests",
1727     environ=krb5_environ)
1728 planpythontestsuite(
1729     "ad_dc",
1730     "samba.tests.krb5.fast_tests",
1731     environ=krb5_environ)
1732 planpythontestsuite(
1733     "ad_dc",
1734     "samba.tests.krb5.ms_kile_client_principal_lookup_tests",
1735     environ=krb5_environ)
1736 planpythontestsuite(
1737     "ad_dc",
1738     "samba.tests.krb5.spn_tests",
1739     environ=krb5_environ)
1740 planpythontestsuite(
1741     "ad_dc",
1742     "samba.tests.krb5.alias_tests",
1743     environ=krb5_environ)
1744 planoldpythontestsuite(
1745     'ad_dc',
1746     'samba.tests.krb5.pac_align_tests',
1747     environ=krb5_environ)
1748 planoldpythontestsuite(
1749     'ad_dc',
1750     'samba.tests.krb5.protected_users_tests',
1751     environ=krb5_environ)
1752 for env, nt_hash in [("ad_dc:local", True),
1753                      ("ad_dc_no_ntlm:local", False)]:
1754     planoldpythontestsuite(
1755         env,
1756         'samba.tests.krb5.nt_hash_tests',
1757         environ={
1758             **krb5_environ,
1759             'EXPECT_NT_HASH': int(nt_hash),
1760     })
1761 planoldpythontestsuite(
1762     'ad_dc',
1763     'samba.tests.krb5.kpasswd_tests',
1764     environ=krb5_environ)
1765 planoldpythontestsuite(
1766     'ad_dc',
1767     'samba.tests.krb5.claims_tests',
1768     environ=krb5_environ)
1769 planoldpythontestsuite(
1770     'ad_dc:local',
1771     'samba.tests.krb5.lockout_tests',
1772     environ=krb5_environ)
1773 planoldpythontestsuite(
1774     'ad_dc',
1775     'samba.tests.krb5.group_tests',
1776     environ=krb5_environ)
1777 for env, forced_rc4 in [('ad_dc', False),
1778                         ('promoted_dc', True)]:
1779     planoldpythontestsuite(
1780         env,
1781         'samba.tests.krb5.etype_tests',
1782         environ={
1783             **krb5_environ,
1784             'DC_SERVER': '$SERVER',
1785             'DC_SERVER_IP': '$SERVER_IP',
1786             'DC_SERVER_IPV6': '$SERVER_IPV6',
1787             'FORCED_RC4': int(forced_rc4),
1788         })
1789
1790 for env in [
1791         'vampire_dc',
1792         'promoted_dc']:
1793     planoldpythontestsuite(env, "samba.tests.kcc",
1794                            name="samba.tests.kcc",
1795                            environ={'TEST_SERVER': '$SERVER', 'TEST_USERNAME': '$USERNAME',
1796                                     'TEST_PASSWORD': '$PASSWORD',
1797                                     'TEST_ENV': env
1798                                     },
1799                            extra_path=[os.path.join(srcdir(), "samba/python"), ])
1800     planpythontestsuite(env, "samba.tests.samba_tool.visualize_drs")
1801
1802 planpythontestsuite("ad_dc_default:local", "samba.tests.kcc.kcc_utils")
1803
1804 for env in ["simpleserver", "fileserver", "nt4_dc", "ad_dc",
1805             "ad_member", "offlinebackupdc", "restoredc", "renamedc", "labdc", 'schema_pair_dc']:
1806     planoldpythontestsuite(env, "netlogonsvc",
1807                            extra_path=[os.path.join(srcdir(), 'python/samba/tests')],
1808                            name="samba.tests.netlogonsvc.python(%s)" % env)
1809
1810 for env in ["ktest", "ad_member", "ad_dc_no_ntlm"]:
1811     planoldpythontestsuite(env, "ntlmdisabled",
1812                            extra_path=[os.path.join(srcdir(), 'python/samba/tests')],
1813                            name="samba.tests.ntlmdisabled.python(%s)" % env)
1814
1815 # Demote the vampire DC, it must be the last test each DC, before the dbcheck
1816 for env in ['vampire_dc', 'promoted_dc', 'rodc']:
1817     planoldpythontestsuite(env, "samba.tests.samba_tool.demote",
1818                            name="samba.tests.samba_tool.demote",
1819                            environ={
1820                                'CONFIGFILE': '$PREFIX/%s/etc/smb.conf' % env
1821                            },
1822                            extra_args=['-U"$USERNAME%$PASSWORD"'],
1823                            extra_path=[os.path.join(srcdir(), "samba/python")]
1824                            )
1825 # TODO: Verifying the databases really should be a part of the
1826 # environment teardown.
1827 # check the databases are all OK. PLEASE LEAVE THIS AS THE LAST TEST
1828 for env in ["ad_dc", "fl2000dc", "fl2003dc", "fl2008r2dc",
1829             'vampire_dc', 'promoted_dc', 'backupfromdc', 'restoredc',
1830             'renamedc', 'offlinebackupdc', 'labdc']:
1831     plantestsuite("samba4.blackbox.dbcheck(%s)" % env, env + ":local", ["PYTHON=%s" % python, os.path.join(bbdir, "dbcheck.sh"), '$PREFIX/provision', configuration])
1832
1833 #
1834 # Tests to verify bug 13653 https://bugzilla.samba.org/show_bug.cgi?id=13653
1835 # ad_dc has an lmdb backend, ad_dc_ntvfs has a tdb backend.
1836 #
1837 planoldpythontestsuite("ad_dc_ntvfs:local",
1838                        "samba.tests.blackbox.bug13653",
1839                        extra_args=['-U"$USERNAME%$PASSWORD"'],
1840                        environ={'TEST_ENV': 'ad_dc_ntvfs'})
1841 planoldpythontestsuite("ad_dc:local",
1842                        "samba.tests.blackbox.bug13653",
1843                        extra_args=['-U"$USERNAME%$PASSWORD"'],
1844                        environ={'TEST_ENV': 'ad_dc'})
1845 # cmocka tests not requiring a specific environment
1846 #
1847 plantestsuite("samba4.dsdb.samdb.ldb_modules.unique_object_sids", "none",
1848               [os.path.join(bindir(), "test_unique_object_sids")])
1849 plantestsuite("samba4.dsdb.samdb.ldb_modules.encrypted_secrets.tdb", "none",
1850               [os.path.join(bindir(), "test_encrypted_secrets_tdb")])
1851 plantestsuite("samba4.dsdb.samdb.ldb_modules.encrypted_secrets.mdb", "none",
1852               [os.path.join(bindir(), "test_encrypted_secrets_mdb")])
1853 plantestsuite("lib.audit_logging.audit_logging", "none",
1854               [os.path.join(bindir(), "audit_logging_test")])
1855 plantestsuite("lib.audit_logging.audit_logging.errors", "none",
1856               [os.path.join(bindir(), "audit_logging_error_test")])
1857 plantestsuite("samba4.dsdb.samdb.ldb_modules.audit_util", "none",
1858               [os.path.join(bindir(), "test_audit_util")])
1859 plantestsuite("samba4.dsdb.samdb.ldb_modules.audit_log", "none",
1860               [os.path.join(bindir(), "test_audit_log")])
1861 plantestsuite("samba4.dsdb.samdb.ldb_modules.audit_log.errors", "none",
1862               [os.path.join(bindir(), "test_audit_log_errors")])
1863 plantestsuite("samba4.dsdb.samdb.ldb_modules.group_audit", "none",
1864               [os.path.join(bindir(), "test_group_audit")])
1865 plantestsuite("samba4.dsdb.samdb.ldb_modules.group_audit.errors", "none",
1866               [os.path.join(bindir(), "test_group_audit_errors")])
1867 plantestsuite("samba4.dcerpc.dnsserver.dnsutils", "none",
1868               [os.path.join(bindir(), "test_rpc_dns_server_dnsutils")])
1869 plantestsuite("libcli.drsuapi.repl_decrypt", "none",
1870               [os.path.join(bindir(), "test_repl_decrypt")])
1871 plantestsuite("librpc.ndr.ndr_string", "none",
1872               [os.path.join(bindir(), "test_ndr_string")])
1873 plantestsuite("librpc.ndr.ndr", "none",
1874               [os.path.join(bindir(), "test_ndr")])
1875 plantestsuite("librpc.ndr.ndr_macros", "none",
1876               [os.path.join(bindir(), "test_ndr_macros")])
1877 plantestsuite("librpc.ndr.ndr_dns_nbt", "none",
1878               [os.path.join(bindir(), "test_ndr_dns_nbt")])
1879 plantestsuite("libcli.ldap.ldap_message", "none",
1880               [os.path.join(bindir(), "test_ldap_message")])
1881
1882 # process restart and limit tests, these break the environment so need to run
1883 # in their own specific environment
1884 planoldpythontestsuite("preforkrestartdc:local",
1885                        "samba.tests.prefork_restart",
1886                        extra_path=[
1887                            os.path.join(srcdir(), 'python/samba/tests')],
1888                        extra_args=['-U"$USERNAME%$PASSWORD"'],
1889                        name="samba.tests.prefork_restart")
1890 planoldpythontestsuite("preforkrestartdc:local",
1891                        "samba.tests.blackbox.smbcontrol_process",
1892                        extra_path=[
1893                            os.path.join(srcdir(), 'python/samba/tests')],
1894                        extra_args=['-U"$USERNAME%$PASSWORD"'],
1895                        name="samba.tests.blackbox.smbcontrol_process")
1896 planoldpythontestsuite("proclimitdc",
1897                        "samba.tests.process_limits",
1898                        extra_path=[
1899                            os.path.join(srcdir(), 'python/samba/tests')],
1900                        extra_args=['-U"$USERNAME%$PASSWORD"'],
1901                        name="samba.tests.process_limits")
1902
1903 planoldpythontestsuite("none", "samba.tests.usage")
1904 planpythontestsuite("fileserver", "samba.tests.dcerpc.mdssvc")
1905 planoldpythontestsuite("none", "samba.tests.compression")