76b8ad980ee0ddea3f7c43b389795216f9f2e8af
[samba.git] / source3 / 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 3 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 3, 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/samba3-knownfail. This makes it
12 # very easy to see what functionality is still missing in Samba 3 and makes
13 # it possible to run the testsuite against other servers, such as Samba 4 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 import re
24 import platform
25 sys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), "../../selftest")))
26 import selftesthelpers
27 from selftesthelpers import bindir, srcdir, scriptdir, binpath
28 from selftesthelpers import plantestsuite, samba3srcdir
29 from selftesthelpers import planpythontestsuite
30 from selftesthelpers import smbtorture3, configuration, smbclient3, smbtorture4
31 from selftesthelpers import net, wbinfo, dbwrap_tool, rpcclient, python
32 from selftesthelpers import smbget, smbcacls, smbcquotas, ntlm_auth3
33 from selftesthelpers import valgrindify, smbtorture4_testsuites
34 from selftesthelpers import smbtorture4_options
35 from selftesthelpers import smbcontrol
36 from selftesthelpers import smbstatus
37 smbtorture4_options.extend([
38     '--option=torture:sharedelay=100000',
39    '--option=torture:writetimeupdatedelay=500000',
40 ])
41
42
43 def plansmbtorture4testsuite(name, env, options, description=''):
44     if description == '':
45         modname = "samba3.%s" % (name, )
46     else:
47         modname = "samba3.%s %s" % (name, description)
48
49     selftesthelpers.plansmbtorture4testsuite(
50         name, env, options, target='samba3', modname=modname)
51
52 def compare_versions(version1, version2):
53     for i in range(max(len(version1),len(version2))):
54          v1 = version1[i] if i < len(version1) else 0
55          v2 = version2[i] if i < len(version2) else 0
56          if v1 > v2:
57             return 1
58          elif v1 <v2:
59             return -1
60     return 0
61
62 # find config.h
63 try:
64     config_h = os.environ["CONFIG_H"]
65 except KeyError:
66     samba4bindir = bindir()
67     config_h = os.path.join(samba4bindir, "default/include/config.h")
68
69 # check available features
70 config_hash = dict()
71 f = open(config_h, 'r')
72 try:
73     lines = f.readlines()
74     config_hash = dict((x[0], ' '.join(x[1:]))
75                        for x in map(lambda line: line.strip().split(' ')[1:],
76                                     filter(lambda line: (line[0:7] == '#define') and (len(line.split(' ')) > 2), lines)))
77 finally:
78     f.close()
79
80 linux_kernel_version = None
81 if platform.system() == 'Linux':
82     m = re.search(r'(\d+).(\d+).(\d+)', platform.release())
83     if m:
84         linux_kernel_version = [int(m.group(1)), int(m.group(2)), int(m.group(3))]
85
86 have_linux_kernel_oplocks = False
87 if "HAVE_KERNEL_OPLOCKS_LINUX" in config_hash:
88     if compare_versions(linux_kernel_version, [5,3,1]) >= 0:
89         have_linux_kernel_oplocks = True
90
91 have_inotify = ("HAVE_INOTIFY" in config_hash)
92 have_ldwrap = ("HAVE_LDWRAP" in config_hash)
93 with_pthreadpool = ("WITH_PTHREADPOOL" in config_hash)
94
95 have_smb3_unix_extensions = ("HAVE_SMB3_UNIX_EXTENSIONS" in config_hash)
96
97 def is_module_enabled(module):
98     if module in config_hash["STRING_SHARED_MODULES"]:
99         return True
100     if module in config_hash["STRING_STATIC_MODULES"]:
101         return True
102     return False
103
104 plantestsuite("samba3.blackbox.success", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/test_success.sh")])
105 plantestsuite("samba3.blackbox.failure", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/test_failure.sh")])
106
107 plantestsuite("samba3.local_s3", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/test_local_s3.sh")])
108
109 plantestsuite("samba3.blackbox.registry.upgrade", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/test_registry_upgrade.sh"), net, dbwrap_tool])
110
111 fileserver_tests = [
112          "FDPASS", "LOCK1", "LOCK2", "LOCK3", "LOCK4", "LOCK5", "LOCK6", "LOCK7",
113          "LOCK9A", "LOCK9B",
114          "LOCK10",
115          "LOCK11",
116          "LOCK12",
117          "LOCK13",
118          "UNLINK", "BROWSE", "ATTR", "TRANS2", "TORTURE",
119          "OPLOCK1", "OPLOCK2", "OPLOCK4", "STREAMERROR",
120          "DIR", "DIR1", "DIR-CREATETIME", "TCON", "TCONDEV", "RW1", "RW2", "RW3", "LARGE_READX", "RW-SIGNING",
121          "OPEN", "XCOPY", "RENAME", "DELETE", "DELETE-LN", "PROPERTIES", "W2K",
122          "TCON2", "IOCTL", "CHKPATH", "FDSESS", "CHAIN1", "CHAIN2", "OWNER-RIGHTS",
123          "CHAIN3", "PIDHIGH", "CLI_SPLICE",
124          "UID-REGRESSION-TEST", "SHORTNAME-TEST",
125          "CASE-INSENSITIVE-CREATE", "SMB2-BASIC", "NTTRANS-FSCTL", "SMB2-NEGPROT",
126          "SMB2-SESSION-REAUTH", "SMB2-SESSION-RECONNECT", "SMB2-FTRUNCATE",
127          "SMB2-ANONYMOUS", "SMB2-DIR-FSYNC",
128          "SMB2-PATH-SLASH",
129          "SMB2-QUOTA1",
130          "CLEANUP1",
131          "CLEANUP2",
132          "CLEANUP4",
133          "DELETE-STREAM",
134          "BAD-NBT-SESSION",
135          "SMB1-WILD-MANGLE-UNLINK",
136          "SMB1-WILD-MANGLE-RENAME"]
137
138 for t in fileserver_tests:
139     fileserver_env = "fileserver_smb1"
140     if "SMB2" in t:
141         fileserver_env = "fileserver"
142     plantestsuite("samba3.smbtorture_s3.plain.%s" % t, fileserver_env, [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
143     plantestsuite("samba3.smbtorture_s3.crypt_client.%s" % t, "nt4_dc_smb1", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', smbtorture3, "-e", "-l $LOCAL_PATH"])
144     if t == "TORTURE":
145         # this is a negative test to verify that the server rejects
146         # access without encryption
147         plantestsuite("samba3.smbtorture_s3.crypt_server.%s" % t, "nt4_dc_smb1", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmpenc', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
148     if t == "CLI_SPLICE":
149         # We must test this against the SMB1 fallback.
150         plantestsuite("samba3.smbtorture_s3.plain.%s" % t, "fileserver_smb1", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH", "-mNT1"])
151     plantestsuite("samba3.smbtorture_s3.plain.%s" % t, "ad_dc_ntvfs", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
152
153 t = "TLDAP"
154 plantestsuite("samba3.smbtorture_s3.plain.%s" % t, "ad_dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER/tmp', '$DC_USERNAME', '$DC_PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
155
156 if have_linux_kernel_oplocks:
157     t = "OPLOCK5"
158     plantestsuite("samba3.smbtorture_s3.plain.%s" % t,
159                   "fileserver_smb1",
160                   [os.path.join(samba3srcdir,
161                                 "script/tests/test_smbtorture_s3.sh"),
162                    t,
163                    '//$SERVER/tmp',
164                    '$USERNAME',
165                    '$PASSWORD',
166                    smbtorture3,
167                    "",
168                    "-l $LOCAL_PATH",
169                    "-mNT1"])
170 #
171 # RENAME-ACCESS needs to run against a special share - acl_xattr_ign_sysacl_windows
172 #
173 plantestsuite("samba3.smbtorture_s3.plain.%s" % "RENAME-ACCESS", "nt4_dc_smb1", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), "RENAME-ACCESS", '//$SERVER_IP/acl_xattr_ign_sysacl_windows', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
174 plantestsuite("samba3.smbtorture_s3.crypt_client.%s" % "RENAME-ACCESS", "nt4_dc_smb1", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), "RENAME-ACCESS", '//$SERVER_IP/acl_xattr_ign_sysacl_windows', '$USERNAME', '$PASSWORD', smbtorture3, "-e", "-l $LOCAL_PATH"])
175 # non-crypt only
176
177 tests = ["OPLOCK-CANCEL"]
178 for t in tests:
179     plantestsuite("samba3.smbtorture_s3.plain.%s" % t, "nt4_dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
180
181 env = "nt4_dc_smb1"
182 tests = ["MANGLE-ILLEGAL"]
183 for t in tests:
184     plantestsuite("samba3.smbtorture_s3.plain.%s" % t, env, [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/mangle_illegal', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
185
186 tests = ["RW1", "RW2", "RW3", "SMB2-BASIC"]
187 for t in tests:
188     if t == "SMB2-BASIC":
189         env = "simpleserver"
190     else:
191         env = "fileserver_smb1"
192
193     plantestsuite("samba3.smbtorture_s3.vfs_aio_pthread(%s).%s" % (env, t), env, [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/vfs_aio_pthread', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
194     plantestsuite("samba3.smbtorture_s3.vfs_aio_fork(%s).%s" % (env, t), env, [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/vfs_aio_fork', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
195
196 plantestsuite("samba3.smbtorture_s3.hidenewfiles",
197               "simpleserver",
198               [os.path.join(samba3srcdir,
199                             "script/tests/test_smbtorture_s3.sh"),
200                'hide-new-files-timeout',
201                '//$SERVER_IP/hidenewfiles',
202                '$USERNAME',
203                '$PASSWORD',
204                smbtorture3,
205                "",
206                "-l $LOCAL_PATH"])
207 plantestsuite("samba3.smbtorture_s3.hidenewfiles_showdirs",
208               "simpleserver",
209               [os.path.join(samba3srcdir,
210                             "script/tests/test_smbtorture_s3.sh"),
211                'hide-new-files-timeout-showdirs',
212                '//$SERVER_IP/hidenewfiles',
213                '$USERNAME',
214                '$PASSWORD',
215                smbtorture3,
216                "",
217                "-l $LOCAL_PATH"])
218
219 #
220 # MSDFS attribute tests.
221 #
222 plantestsuite("samba3.smbtorture_s3.smb2.MSDFS-ATTRIBUTE",
223                 "fileserver",
224                 [os.path.join(samba3srcdir,
225                               "script/tests/test_smbtorture_s3.sh"),
226                 'MSDFS-ATTRIBUTE',
227                 '//$SERVER_IP/msdfs-share',
228                 '$USERNAME',
229                 '$PASSWORD',
230                 smbtorture3,
231                 "-mSMB2",
232                 "-f msdfs-src1"])
233
234 plantestsuite("samba3.smbtorture_s3.smb1.MSDFS-ATTRIBUTE",
235                 "fileserver_smb1",
236                 [os.path.join(samba3srcdir,
237                               "script/tests/test_smbtorture_s3.sh"),
238                 'MSDFS-ATTRIBUTE',
239                 '//$SERVER_IP/msdfs-share',
240                 '$USERNAME',
241                 '$PASSWORD',
242                 smbtorture3,
243                 "-mNT1",
244                 "-f msdfs-src1"])
245
246 #
247 # SMB2-DFS-PATHS needs to run against a special share msdfs-pathname-share
248 # This is an empty DFS share with no links, used merely to test
249 # incoming DFS pathnames and how they map to local paths.
250 #
251 plantestsuite("samba3.smbtorture_s3.smb2.SMB2-DFS-PATHS",
252                 "fileserver",
253                 [os.path.join(samba3srcdir,
254                               "script/tests/test_smbtorture_s3.sh"),
255                 'SMB2-DFS-PATHS',
256                 '//$SERVER_IP/msdfs-pathname-share',
257                 '$USERNAME',
258                 '$PASSWORD',
259                 smbtorture3,
260                 "-mSMB2"])
261
262 # BUG: https://bugzilla.samba.org/show_bug.cgi?id=15277
263 # MacOSX clients send a leading '\\' character for DFS paths.
264 #
265 plantestsuite("samba3.smbtorture_s3.smb2.SMB2-DFS-FILENAME-LEADING-BACKSLASH",
266                 "fileserver",
267                 [os.path.join(samba3srcdir,
268                               "script/tests/test_smbtorture_s3.sh"),
269                 'SMB2-DFS-FILENAME-LEADING-BACKSLASH',
270                 '//$SERVER_IP/msdfs-pathname-share',
271                 '$USERNAME',
272                 '$PASSWORD',
273                 smbtorture3,
274                 "-mSMB2"])
275
276 #
277 # SMB2-NON-DFS-SHARE needs to run against a special share non-msdfs-pathname-share
278 # This is an empty non-DFS share with no links, used merely to test
279 # incoming DFS pathnames and how they map to local paths. We are testing
280 # what happens if we set the FLAGS2_DFS_PATHNAMES and send DFS paths
281 # on a non-DFS share.
282 #
283 plantestsuite("samba3.smbtorture_s3.smb2.SMB2-NON-DFS-SHARE",
284                 "fileserver",
285                 [os.path.join(samba3srcdir,
286                               "script/tests/test_smbtorture_s3.sh"),
287                 'SMB2-NON-DFS-SHARE',
288                 '//$SERVER_IP/non-msdfs-pathname-share',
289                 '$USERNAME',
290                 '$PASSWORD',
291                 smbtorture3,
292                 "-mSMB2"])
293
294 #
295 # SMB2-DFS-SHARE-NON-DFS-PATH needs to run against a special share msdfs-pathname-share
296 # This is an empty DFS share with no links, used merely to test
297 # incoming non-DFS pathnames and how they map to local paths.
298 #
299 plantestsuite("samba3.smbtorture_s3.smb2.SMB2-DFS-SHARE-NON-DFS-PATH",
300                 "fileserver",
301                 [os.path.join(samba3srcdir,
302                               "script/tests/test_smbtorture_s3.sh"),
303                 'SMB2-DFS-SHARE-NON-DFS-PATH',
304                 '//$SERVER_IP/msdfs-pathname-share',
305                 '$USERNAME',
306                 '$PASSWORD',
307                 smbtorture3,
308                 "-mSMB2"])
309
310 #
311 # SMB1-DFS-PATHS needs to run against a special share msdfs-pathname-share
312 # This is an empty DFS share with no links, used merely to test
313 # incoming DFS pathnames and how they map to local paths.
314 #
315 plantestsuite("samba3.smbtorture_s3.smb1.SMB1-DFS-PATHS",
316                 "fileserver",
317                 [os.path.join(samba3srcdir,
318                               "script/tests/test_smbtorture_s3.sh"),
319                 'SMB1-DFS-PATHS',
320                 '//$SERVER_IP/msdfs-pathname-share',
321                 '$USERNAME',
322                 '$PASSWORD',
323                 smbtorture3,
324                 "-mNT1"])
325
326 #
327 # SMB1-DFS-SEARCH-PATHS needs to run against a special share msdfs-pathname-share
328 # This is an empty DFS share with no links, used merely to test
329 # incoming DFS pathnames and how they map to local paths.
330 #
331 plantestsuite("samba3.smbtorture_s3.smb1.SMB1-DFS-SEARCH-PATHS",
332                 "fileserver",
333                 [os.path.join(samba3srcdir,
334                               "script/tests/test_smbtorture_s3.sh"),
335                 'SMB1-DFS-SEARCH-PATHS',
336                 '//$SERVER_IP/msdfs-pathname-share',
337                 '$USERNAME',
338                 '$PASSWORD',
339                 smbtorture3,
340                 "-mNT1"])
341
342 #
343 # SMB1-DFS-OPERATIONS needs to run against a special share msdfs-pathname-share
344 # This is an empty DFS share with no links, used merely to test
345 # incoming DFS pathnames and how they map to local paths.
346 #
347 plantestsuite("samba3.smbtorture_s3.smb1.SMB1-DFS-OPERATIONS",
348                 "fileserver",
349                 [os.path.join(samba3srcdir,
350                               "script/tests/test_smbtorture_s3.sh"),
351                 'SMB1-DFS-OPERATIONS',
352                 '//$SERVER_IP/msdfs-pathname-share',
353                 '$USERNAME',
354                 '$PASSWORD',
355                 smbtorture3,
356                 "-mNT1"])
357
358 #
359 # SMB2-STREAM-ACL needs to run against a special share - vfs_wo_fruit
360 #
361 plantestsuite("samba3.smbtorture_s3.plain.%s" % "SMB2-STREAM-ACL",
362                 "fileserver",
363                 [os.path.join(samba3srcdir,
364                               "script/tests/test_smbtorture_s3.sh"),
365                 'SMB2-STREAM-ACL',
366                 '//$SERVER_IP/vfs_wo_fruit',
367                 '$USERNAME',
368                 '$PASSWORD',
369                 smbtorture3,
370                 "",
371                 "-l $LOCAL_PATH"])
372
373 #
374 # SMB2-LIST-DIR-ASYNC needs to run against a special share vfs_aio_pthread_async_dosmode_default1
375 #
376 plantestsuite("samba3.smbtorture_s3.plain.%s" % "SMB2-LIST-DIR-ASYNC",
377                 "simpleserver",
378                 [os.path.join(samba3srcdir,
379                               "script/tests/test_smbtorture_s3.sh"),
380                 'SMB2-LIST-DIR-ASYNC',
381                 '//$SERVER_IP/vfs_aio_pthread_async_dosmode_default1',
382                 '$USERNAME',
383                 '$PASSWORD',
384                 smbtorture3,
385                 "",
386                 "-l $LOCAL_PATH"])
387 #
388 # SMB2-DEL-ON-CLOSE-NONEMPTY needs to run against a special fileserver share veto_files_delete
389 #
390 plantestsuite("samba3.smbtorture_s3.plain.%s" % "SMB2-DEL-ON-CLOSE-NONEMPTY",
391                 "fileserver",
392                 [os.path.join(samba3srcdir,
393                               "script/tests/test_smbtorture_s3.sh"),
394                 'SMB2-DEL-ON-CLOSE-NONEMPTY',
395                 '//$SERVER_IP/veto_files_delete',
396                 '$USERNAME',
397                 '$PASSWORD',
398                 smbtorture3,
399                 "",
400                 "-l $LOCAL_PATH"])
401
402 #
403 # SMB2-DEL-ON-CLOSE-NONWRITE-DELETE-YES needs to run against a special fileserver share delete_yes_unwrite
404 #
405 plantestsuite("samba3.smbtorture_s3.plain.%s" % "SMB2-DEL-ON-CLOSE-NONWRITE-DELETE-YES",
406                 "fileserver",
407                 [os.path.join(samba3srcdir,
408                               "script/tests/test_smbtorture_s3.sh"),
409                 'SMB2-DEL-ON-CLOSE-NONWRITE-DELETE-YES',
410                 '//$SERVER_IP/delete_yes_unwrite',
411                 '$USERNAME',
412                 '$PASSWORD',
413                 smbtorture3,
414                 "",
415                 "-l $LOCAL_PATH"])
416
417 #
418 # SMB2-DEL-ON-CLOSE-NONWRITE-DELETE-NO needs to run against a special fileserver share delete_no_unwrite
419 #
420 plantestsuite("samba3.smbtorture_s3.plain.%s" % "SMB2-DEL-ON-CLOSE-NONWRITE-DELETE-NO",
421                 "fileserver",
422                 [os.path.join(samba3srcdir,
423                               "script/tests/test_smbtorture_s3.sh"),
424                 'SMB2-DEL-ON-CLOSE-NONWRITE-DELETE-NO',
425                 '//$SERVER_IP/delete_no_unwrite',
426                 '$USERNAME',
427                 '$PASSWORD',
428                 smbtorture3,
429                 "",
430                 "-l $LOCAL_PATH"])
431
432 shares = [
433     "vfs_aio_pthread_async_dosmode_default1",
434     "vfs_aio_pthread_async_dosmode_default2"
435 ]
436 for s in shares:
437     plantestsuite("samba3.smbtorture_s3.%s(simpleserver).SMB2-BASIC" % s, "simpleserver", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), 'SMB2-BASIC', '//$SERVER_IP/' + s, '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
438     t = "smb2.compound_find"
439     plansmbtorture4testsuite(t, "simpleserver", "//%s/%s %s" % ('$SERVER_IP', s, ' -U$USERNAME%$PASSWORD'), description=s)
440
441 posix_tests = ["POSIX", "POSIX-APPEND", "POSIX-SYMLINK-ACL", "POSIX-SYMLINK-EA", "POSIX-OFD-LOCK",
442                "POSIX-STREAM-DELETE", "WINDOWS-BAD-SYMLINK", "POSIX-MKDIR",
443                "POSIX-BLOCKING-LOCK",
444                "POSIX-ACL-OPLOCK",
445                "POSIX-ACL-SHAREROOT",
446                "POSIX-LS-WILDCARD",
447                "POSIX-LS-SINGLE",
448                "POSIX-READLINK",
449                "POSIX-STAT",
450                "POSIX-SYMLINK-PARENT",
451                "POSIX-SYMLINK-CHMOD",
452                "POSIX-DIR-DEFAULT-ACL",
453                "POSIX-SYMLINK-RENAME",
454                "POSIX-SYMLINK-GETPATHINFO",
455                "POSIX-SYMLINK-SETPATHINFO",
456               ]
457
458 for t in posix_tests:
459     plantestsuite("samba3.smbtorture_s3.plain.%s" % t, "nt4_dc_smb1", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/posix_share', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
460     plantestsuite("samba3.smbtorture_s3.crypt.%s" % t, "nt4_dc_smb1", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/posix_share', '$USERNAME', '$PASSWORD', smbtorture3, "-e", "-l $LOCAL_PATH"])
461
462 local_tests = [
463     "LOCAL-SUBSTITUTE",
464     "LOCAL-GENCACHE",
465     "LOCAL-BASE64",
466     "LOCAL-RBTREE",
467     "LOCAL-MEMCACHE",
468     "LOCAL-STREAM-NAME",
469     "LOCAL-STR-MATCH-MSWILD",
470     "LOCAL-STR-MATCH-REGEX-SUB1",
471     "LOCAL-string_to_sid",
472     "LOCAL-sid_to_string",
473     "LOCAL-binary_to_sid",
474     "LOCAL-DBTRANS",
475     "LOCAL-TEVENT-POLL",
476     "LOCAL-CONVERT-STRING",
477     "LOCAL-CONV-AUTH-INFO",
478     "LOCAL-IDMAP-TDB-COMMON",
479     "LOCAL-MESSAGING-READ1",
480     "LOCAL-MESSAGING-READ2",
481     "LOCAL-MESSAGING-READ3",
482     "LOCAL-MESSAGING-READ4",
483     "LOCAL-MESSAGING-FDPASS1",
484     "LOCAL-MESSAGING-FDPASS2",
485     "LOCAL-MESSAGING-FDPASS2a",
486     "LOCAL-MESSAGING-FDPASS2b",
487     "LOCAL-MESSAGING-SEND-ALL",
488     "LOCAL-PTHREADPOOL-TEVENT",
489     "LOCAL-CANONICALIZE-PATH",
490     "LOCAL-DBWRAP-WATCH1",
491     "LOCAL-DBWRAP-WATCH2",
492     "LOCAL-DBWRAP-WATCH3",
493     "LOCAL-DBWRAP-WATCH4",
494     "LOCAL-DBWRAP-DO-LOCKED1",
495     "LOCAL-G-LOCK1",
496     "LOCAL-G-LOCK2",
497     "LOCAL-G-LOCK3",
498     "LOCAL-G-LOCK4",
499     "LOCAL-G-LOCK4A",
500     "LOCAL-G-LOCK5",
501     "LOCAL-G-LOCK6",
502     "LOCAL-G-LOCK7",
503     "LOCAL-G-LOCK8",
504     "LOCAL-NAMEMAP-CACHE1",
505     "LOCAL-IDMAP-CACHE1",
506     "LOCAL-hex_encode_buf",
507     "LOCAL-remove_duplicate_addrs2"]
508
509 for t in local_tests:
510     plantestsuite("samba3.smbtorture_s3.%s" % t, "none", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//foo/bar', '""', '""', smbtorture3, ""])
511
512 plantestsuite("samba.vfstest.stream_depot", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/stream-depot/run.sh"), binpath("vfstest"), "$PREFIX", configuration])
513 plantestsuite("samba.vfstest.xattr-tdb-1", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/xattr-tdb-1/run.sh"), binpath("vfstest"), "$PREFIX", configuration])
514 plantestsuite("samba.vfstest.acl", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/vfstest-acl/run.sh"), binpath("vfstest"), "$PREFIX", configuration])
515 plantestsuite("samba.vfstest.catia", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/vfstest-catia/run.sh"), binpath("vfstest"), "$PREFIX", configuration])
516 plantestsuite(
517     "samba.vfstest.full_audit_segfault",
518     "nt4_dc:local",
519     [os.path.join(samba3srcdir,
520                   "script/tests/full_audit_segfault/run.sh"),
521      binpath("vfstest"),
522      "$PREFIX",
523      configuration])
524
525 plantestsuite("samba3.blackbox.smbclient_basic.NT1", "nt4_dc_schannel", [os.path.join(samba3srcdir, "script/tests/test_smbclient_basic.sh"), '$SERVER', '$SERVER_IP', '$DC_USERNAME', '$DC_PASSWORD', smbclient3, configuration, "-mNT1"])
526 plantestsuite("samba3.blackbox.smbclient_basic.NT1", "nt4_dc_smb1", [os.path.join(samba3srcdir, "script/tests/test_smbclient_basic.sh"), '$SERVER', '$SERVER_IP', '$DC_USERNAME', '$DC_PASSWORD', smbclient3, configuration, "-mNT1"])
527 plantestsuite("samba3.blackbox.smbclient_basic.SMB2_02", "nt4_dc_schannel", [os.path.join(samba3srcdir, "script/tests/test_smbclient_basic.sh"), '$SERVER', '$SERVER_IP', '$DC_USERNAME', '$DC_PASSWORD', smbclient3, configuration, "-mSMB2_02"])
528 plantestsuite("samba3.blackbox.smbclient_basic.SMB2_10", "nt4_dc_schannel", [os.path.join(samba3srcdir, "script/tests/test_smbclient_basic.sh"), '$SERVER', '$SERVER_IP', '$DC_USERNAME', '$DC_PASSWORD', smbclient3, configuration, "-mSMB2_10"])
529 plantestsuite("samba3.blackbox.smbclient_basic.SMB3_02", "nt4_dc_schannel", [os.path.join(samba3srcdir, "script/tests/test_smbclient_basic.sh"), '$SERVER', '$SERVER_IP', '$DC_USERNAME', '$DC_PASSWORD', smbclient3, configuration, "-mSMB3_02"])
530 plantestsuite("samba3.blackbox.smbclient_basic.SMB3_11", "nt4_dc_schannel", [os.path.join(samba3srcdir, "script/tests/test_smbclient_basic.sh"), '$SERVER', '$SERVER_IP', '$DC_USERNAME', '$DC_PASSWORD', smbclient3, configuration, "-mSMB3_11"])
531
532 plantestsuite("samba3.blackbox.smbclient_usernamemap", "ad_member_idmap_nss:local", [os.path.join(samba3srcdir, "script/tests/test_usernamemap.sh"), '$SERVER', smbclient3])
533
534 plantestsuite("samba3.blackbox.smbclient_basic", "ad_member", [os.path.join(samba3srcdir, "script/tests/test_smbclient_basic.sh"), '$SERVER', '$SERVER_IP', '$DC_USERNAME', '$DC_PASSWORD', smbclient3, configuration])
535 for options in ["", "--option=clientntlmv2auth=no", "--option=clientusespnego=no", "--option=clientusespnego=no --option=clientntlmv2auth=no", "--option=clientntlmv2auth=no --option=clientlanmanauth=yes --max-protocol=LANMAN2", "--option=clientntlmv2auth=no --option=clientlanmanauth=yes --option=clientmaxprotocol=NT1"]:
536     if "NT1" in options or "LANMAN2" in options:
537         env = "nt4_dc_smb1_done"
538     else:
539         env = "nt4_dc"
540     plantestsuite("samba3.blackbox.smbclient_auth.plain.%s" % (options), env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$DC_USERNAME', '$DC_PASSWORD', smbclient3, configuration, options])
541
542 for env in ["nt4_dc", "nt4_member", "ad_member", "ad_dc", "ad_dc_ntvfs", "s4member", "fl2000dc"]:
543     plantestsuite("samba3.blackbox.smbclient_machine_auth.plain", "%s:local" % env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_machine_auth.sh"), '$SERVER', smbclient3, configuration])
544     smb1_env = env
545     if smb1_env == "ad_dc" or smb1_env == "nt4_dc":
546         smb1_env = smb1_env + "_smb1_done"
547     plantestsuite("samba3.blackbox.smbclient_ntlm.plain NT1", smb1_env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_ntlm.sh"), '$SERVER', '$DC_USERNAME', '$DC_PASSWORD', "never", smbclient3, "NT1", configuration])
548     plantestsuite("samba3.blackbox.smbclient_ntlm.plain SMB3", env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_ntlm.sh"), '$SERVER', '$DC_USERNAME', '$DC_PASSWORD', "never", smbclient3, "SMB3", configuration])
549
550
551 plantestsuite("samba3.blackbox.smbclient_log_basename", "ad_dc", [os.path.join(samba3srcdir, "script/tests/test_smbclient_log_basename.sh"), '$SERVER', smbclient3, '$PREFIX', configuration])
552
553 for options in ["--option=clientntlmv2auth=no", "--option=clientusespnego=no --option=clientntlmv2auth=no", "--option=clientusespnego=no --option=clientntlmv2auth=no -mNT1", ""]:
554     # don't attempt to run SMB1 tests in nt4_member or ad_member
555     # as these test envs don't support SMB1, use nt4_dc instead
556     environs = ["nt4_member", "ad_member"]
557     if "NT1" in options or "LANMAN2" in options:
558         environs = ["nt4_dc_smb1_done"]
559     for env in environs:
560         plantestsuite("samba3.blackbox.smbclient_auth.plain.%s" % (options), env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$DC_USERNAME', '$DC_PASSWORD', smbclient3, configuration, options])
561         plantestsuite("samba3.blackbox.smbclient_auth.plain.%s.member_creds" % (options), env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$SERVER/$USERNAME', '$PASSWORD', smbclient3, configuration, options])
562
563 for env in ["nt4_member", "ad_member"]:
564     plantestsuite("samba3.blackbox.smbclient_auth.empty_domain.domain_creds", env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '/$DC_USERNAME', '$DC_PASSWORD', smbclient3, configuration, options])
565     plantestsuite("samba3.blackbox.smbclient_auth.empty_domain.member_creds", env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '/$USERNAME', '$PASSWORD', smbclient3, configuration, options])
566     plantestsuite("samba3.blackbox.smbclient_auth.dot_domain.domain_creds", env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', './$DC_USERNAME', '$DC_PASSWORD', smbclient3, configuration, options])
567     plantestsuite("samba3.blackbox.smbclient_auth.dot_domain.member_creds", env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', './$USERNAME', '$PASSWORD', smbclient3, configuration, options])
568     plantestsuite("samba3.blackbox.smbclient_auth.upn.domain_creds", env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$DC_USERNAME@$REALM', '$DC_PASSWORD', smbclient3, configuration, options])
569     plantestsuite("samba3.blackbox.smbclient_auth.upn.member_creds", env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$USERNAME@$SERVER', '$PASSWORD', smbclient3, configuration, options])
570
571 env = "ad_dc_smb1"
572 plantestsuite("samba3.blackbox.smbspool", env, [os.path.join(samba3srcdir, "script/tests/test_smbspool.sh"), '$SERVER', '$SERVER_IP', '$DC_USERNAME', '$DC_PASSWORD', env])
573
574 plantestsuite("samba3.blackbox.printing_var_exp", "nt4_dc", [os.path.join(samba3srcdir, "script/tests/test_printing_var_exp.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD'])
575
576 for env in ["ad_member:local", "nt4_dc:local"]:
577     plantestsuite("samba3.blackbox.smbpasswd", env, [os.path.join(samba3srcdir, "script/tests/test_smbpasswd.sh"), '$SERVER', '$SERVER_IP', '$DC_USERNAME', '$DC_PASSWORD'])
578
579 env = "nt4_dc"
580 plantestsuite("samba3.blackbox.smbclient_auth.plain.ipv6", env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IPV6', '$SERVER/$USERNAME', '$PASSWORD', smbclient3, configuration])
581
582 for env in ["nt4_member", "ad_member"]:
583     plantestsuite("samba3.blackbox.net_cred_change", "%s:local" % env, [os.path.join(samba3srcdir, "script/tests/test_net_cred_change.sh"), configuration])
584
585 plantestsuite("samba3.blackbox.net_cred_change_at", "ad_member_s3_join:local", [os.path.join(samba3srcdir, "script/tests/test_net_cred_change_at.sh"), configuration, '$DC_SERVER'])
586
587 env = "ad_member"
588 t = "--krb5auth=$DOMAIN/$DC_USERNAME%$DC_PASSWORD"
589 plantestsuite("samba3.wbinfo_simple.%s" % t, "%s:local" % env, [os.path.join(srcdir(), "nsswitch/tests/test_wbinfo_simple.sh"), t])
590 plantestsuite("samba3.wbinfo_name_lookup", env,
591               [os.path.join(srcdir(),
592                             "nsswitch/tests/test_wbinfo_name_lookup.sh"),
593                '$DOMAIN', '$REALM', '$DC_USERNAME'])
594
595 env = "ad_member"
596 plantestsuite("samba3.wbinfo_user_info_cached", env,
597               [os.path.join(srcdir(),
598                             "nsswitch/tests/test_wbinfo_user_info_cached.sh"),
599                '$DOMAIN', '$REALM', 'joe', 'Secret007', '"Samba Users"', env])
600 plantestsuite("samba3.wbinfo_user_info_cached.trustdom", env,
601               [os.path.join(srcdir(),
602                             "nsswitch/tests/test_wbinfo_user_info_cached.sh"),
603                '$TRUST_F_BOTH_DOMAIN', '$TRUST_F_BOTH_REALM', 'joe', 'Secret007', '"Samba Users"', env])
604
605 env = "ad_member:local"
606 plantestsuite("samba3.wbinfo_user_info", env,
607               [os.path.join(srcdir(),
608                             "nsswitch/tests/test_wbinfo_user_info.sh"),
609                '$DOMAIN', '$REALM', '$DOMAIN', 'alice', 'alice', 'jane', 'jane.doe', env])
610
611 plantestsuite("samba3.winbind_call_depth_trace", env,
612               [os.path.join(srcdir(),
613                             "source3/script/tests/test_winbind_call_depth_trace.sh"),
614                smbcontrol, configuration, '$PREFIX', env])
615
616 env = "fl2008r2dc:local"
617 plantestsuite("samba3.wbinfo_user_info", env,
618               [os.path.join(srcdir(),
619                             "nsswitch/tests/test_wbinfo_user_info.sh"),
620                '$TRUST_DOMAIN', '$TRUST_REALM', '$DOMAIN', 'alice', 'alice', 'jane', 'jane.doe', env])
621
622 env = "nt4_member:local"
623 plantestsuite("samba3.wbinfo_sids_to_xids", env,
624               [os.path.join(srcdir(),
625                             "nsswitch/tests/test_wbinfo_sids_to_xids.sh")])
626 plantestsuite(
627     "samba.wbinfo_lookuprids_cache",
628     env,
629     [os.path.join(samba3srcdir,
630                   "script/tests/test_wbinfo_lookuprids_cache.sh")])
631
632 env = "ad_member"
633 t = "WBCLIENT-MULTI-PING"
634 plantestsuite("samba3.smbtorture_s3.%s" % t, env, [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//foo/bar', '""', '""', smbtorture3, ""])
635 plantestsuite("samba3.substitutions", env, [os.path.join(samba3srcdir, "script/tests/test_substitutions.sh"), "$SERVER", "alice", "Secret007", "$PREFIX"])
636
637 for env in ["maptoguest", "simpleserver"]:
638     plantestsuite("samba3.blackbox.smbclient_auth.plain.local_creds", env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', smbclient3, configuration + " --option=clientntlmv2auth=no --option=clientlanmanauth=yes"])
639
640 env = "maptoguest"
641 plantestsuite("samba3.blackbox.smbclient_auth.plain.bad_username", env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', 'notmy$USERNAME', '$PASSWORD', smbclient3, configuration + " --option=clientntlmv2auth=no --option=clientlanmanauth=yes"])
642 plantestsuite("samba3.blackbox.smbclient_ntlm.plain.NT1", env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_ntlm.sh"), '$SERVER', '$USERNAME', '$PASSWORD', "baduser", smbclient3, "NT1", configuration])
643 plantestsuite("samba3.blackbox.smbclient_ntlm.plain.SMB3", env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_ntlm.sh"), '$SERVER', '$USERNAME', '$PASSWORD', "baduser", smbclient3, "SMB3", configuration])
644
645 # plain
646 env = "nt4_dc_smb1_done"
647 plantestsuite("samba3.blackbox.smbclient_s3.NT1.plain", env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', smbclient3, wbinfo, net, configuration, "NT1"])
648 env = "nt4_dc"
649 plantestsuite("samba3.blackbox.smbclient_s3.SMB3.plain", env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', smbclient3, wbinfo, net, configuration, "SMB3"])
650
651 for env in ["nt4_member", "ad_member"]:
652     plantestsuite("samba3.blackbox.smbclient_s3.NT1.plain.member_creds", env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$SERVER', '$SERVER/$USERNAME', '$PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', smbclient3, wbinfo, net, configuration, "NT1"])
653     plantestsuite("samba3.blackbox.smbclient_s3.SMB3.plain.member_creds", env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$SERVER', '$SERVER/$USERNAME', '$PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', smbclient3, wbinfo, net, configuration, "SMB3"])
654
655 env = "nt4_dc_smb1_done"
656 plantestsuite("samba3.blackbox.smbclient_s3.NT1.sign", env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', smbclient3, wbinfo, net, configuration, "NT1", "--client-protection=sign"])
657 env = "nt4_dc"
658 plantestsuite("samba3.blackbox.smbclient_s3.SMB3.sign", env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', smbclient3, wbinfo, net, configuration, "SMB3", "--client-protection=sign"])
659
660 for env in ["nt4_member", "ad_member"]:
661     plantestsuite("samba3.blackbox.smbclient_s3.NT1.sign.member_creds", env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$SERVER', '$SERVER/$USERNAME', '$PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', smbclient3, wbinfo, net, configuration, "NT1", "--client-protection=sign"])
662     plantestsuite("samba3.blackbox.smbclient_s3.SMB3.sign.member_creds", env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$SERVER', '$SERVER/$USERNAME', '$PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', smbclient3, wbinfo, net, configuration, "SMB3", "--client-protection=sign"])
663
664 env = "nt4_dc_smb1_done"
665 # encrypted
666 plantestsuite("samba3.blackbox.smbclient_s3.NT1.crypt", env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', smbclient3, wbinfo, net, configuration, "NT1", "--client-protection=encrypt"])
667 env = "nt4_dc"
668 plantestsuite("samba3.blackbox.smbclient_s3.SMB3.crypt", env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', smbclient3, wbinfo, net, configuration, "SMB3", "--client-protection=encrypt"])
669
670 for env in ["fileserver"]:
671     plantestsuite("samba3.blackbox.preserve_case.NT1", env + "_smb1_done", [os.path.join(samba3srcdir, "script/tests/test_preserve_case.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3, "NT1"])
672     plantestsuite("samba3.blackbox.preserve_case.SMB2+", env, [os.path.join(samba3srcdir, "script/tests/test_preserve_case.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3, '"SMB2 SMB3"'])
673     plantestsuite("samba3.blackbox.dfree_command.NT1", env + "_smb1_done", [os.path.join(samba3srcdir, "script/tests/test_dfree_command.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3, "NT1"])
674     plantestsuite("samba3.blackbox.dfree_command.SMB3", env, [os.path.join(samba3srcdir, "script/tests/test_dfree_command.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3, "SMB3"])
675     plantestsuite("samba3.blackbox.dfree_quota.NT1", env + "_smb1_done", [os.path.join(samba3srcdir, "script/tests/test_dfree_quota.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH', smbclient3, smbcquotas, smbcacls, "NT1"])
676     plantestsuite("samba3.blackbox.dfree_quota.SMB3", env, [os.path.join(samba3srcdir, "script/tests/test_dfree_quota.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH', smbclient3, smbcquotas, smbcacls, "SMB3"])
677     plantestsuite("samba3.blackbox.smbcquotas", env, [os.path.join(samba3srcdir, "script/tests/test_smbcquota.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH', smbcquotas])
678     plantestsuite("samba3.blackbox.valid_users", env, [os.path.join(samba3srcdir, "script/tests/test_valid_users.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3])
679     plantestsuite("samba3.blackbox.force_create_mode", env, [os.path.join(samba3srcdir, "script/tests/test_force_create_mode.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$PREFIX', env, smbclient3])
680     plantestsuite("samba3.blackbox.dropbox", env, [os.path.join(samba3srcdir, "script/tests/test_dropbox.sh"), '$SERVER', '$DOMAIN', 'gooduser', '$PASSWORD', '$PREFIX', env, smbclient3])
681     plantestsuite("samba3.blackbox.offline", env, [os.path.join(samba3srcdir, "script/tests/test_offline.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH/offline', smbclient3])
682     plantestsuite("samba3.blackbox.shadow_copy2.NT1", env + "_smb1_done", [os.path.join(samba3srcdir, "script/tests/test_shadow_copy.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH/shadow', smbclient3, '-m', 'NT1'])
683     plantestsuite("samba3.blackbox.shadow_copy2.SMB3", env, [os.path.join(samba3srcdir, "script/tests/test_shadow_copy.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH/shadow', smbclient3, '-m', 'SMB3'])
684     plantestsuite("samba3.blackbox.shadow_copy_torture", env, [os.path.join(samba3srcdir, "script/tests/test_shadow_copy_torture.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH/shadow', smbtorture4, smbclient3])
685     plantestsuite("samba3.blackbox.smbclient.forceuser_validusers", env, [os.path.join(samba3srcdir, "script/tests/test_forceuser_validusers.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH', smbclient3])
686     plantestsuite("samba3.blackbox.smbget", env, [os.path.join(samba3srcdir, "script/tests/test_smbget.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', 'smbget_user', '$PASSWORD', '$LOCAL_PATH/smbget', smbget])
687     plantestsuite("samba3.blackbox.netshareenum", env, [os.path.join(samba3srcdir, "script/tests/test_shareenum.sh"), '$SERVER', '$USERNAME', '$PASSWORD', rpcclient])
688     plantestsuite("samba3.blackbox.acl_xattr.NT1", env + "_smb1_done", [os.path.join(samba3srcdir, "script/tests/test_acl_xattr.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3, smbcacls, '-mNT1'])
689     plantestsuite("samba3.blackbox.acl_xattr.SMB3", env, [os.path.join(samba3srcdir, "script/tests/test_acl_xattr.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3, smbcacls, '-mSMB3'])
690     plantestsuite("samba3.blackbox.smb2.not_casesensitive", env, [os.path.join(samba3srcdir, "script/tests/test_smb2_not_casesensitive.sh"), '//$SERVER/tmp', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$LOCAL_PATH', smbclient3])
691     plantestsuite("samba3.blackbox.inherit_owner.default.NT1", env + "_smb1_done", [os.path.join(samba3srcdir, "script/tests/test_inherit_owner.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3, smbcacls, net, 'tmp', '0', '0', '-m', 'NT1'])
692     plantestsuite("samba3.blackbox.inherit_owner.default.SMB3", env, [os.path.join(samba3srcdir, "script/tests/test_inherit_owner.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3, smbcacls, net, 'tmp', '0', '0', '-m', 'SMB3'])
693     plantestsuite("samba3.blackbox.inherit_owner.full.NT1", env + "_smb1_done", [os.path.join(samba3srcdir, "script/tests/test_inherit_owner.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3, smbcacls, net, 'inherit_owner', '1', '1', '-m', 'NT1'])
694     plantestsuite("samba3.blackbox.inherit_owner.full.SMB3", env, [os.path.join(samba3srcdir, "script/tests/test_inherit_owner.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3, smbcacls, net, 'inherit_owner', '1', '1', '-m', 'SMB3'])
695     plantestsuite("samba3.blackbox.inherit_owner.unix.NT1", env + "_smb1_done", [os.path.join(samba3srcdir, "script/tests/test_inherit_owner.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3, smbcacls, net, 'inherit_owner_u', '0', '1', '-m', 'NT1'])
696     plantestsuite("samba3.blackbox.inherit_owner.unix.SMB3", env, [os.path.join(samba3srcdir, "script/tests/test_inherit_owner.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3, smbcacls, net, 'inherit_owner_u', '0', '1', '-m', 'SMB3'])
697     plantestsuite("samba3.blackbox.large_acl.NT1", env + "_smb1_done", [os.path.join(samba3srcdir, "script/tests/test_large_acl.sh"), '$SERVER', '$USERNAME', '$PASSWORD', smbclient3, smbcacls, '-m', 'NT1'])
698     plantestsuite("samba3.blackbox.large_acl.SMB3", env, [os.path.join(samba3srcdir, "script/tests/test_large_acl.sh"), '$SERVER', '$USERNAME', '$PASSWORD', smbclient3, smbcacls, '-m', 'SMB3'])
699     plantestsuite("samba3.blackbox.give_owner", env, [os.path.join(samba3srcdir, "script/tests/test_give_owner.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3, smbcacls, net, 'tmp'])
700     plantestsuite("samba3.blackbox.delete_stream", env, [os.path.join(samba3srcdir, "script/tests/test_delete_stream.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3, smbcacls, net, 'acl_streams_xattr'])
701     plantestsuite("samba3.blackbox.homes", env, [os.path.join(samba3srcdir, "script/tests/test_homes.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$LOCAL_PATH', '$PREFIX', smbclient3, configuration])
702     plantestsuite("samba3.blackbox.force_group_change", env,
703                 [os.path.join(samba3srcdir, "script/tests/test_force_group_change.sh"),
704                 '$SERVER', '$USERNAME', '$PASSWORD', '$LOCAL_PATH', smbclient3, smbcontrol])
705     plantestsuite("samba3.blackbox.zero-data", env,
706                   [os.path.join(samba3srcdir, "script/tests/test_zero_data.sh"),
707                    '$SERVER_IP', '$USERNAME', '$PASSWORD', '$LOCAL_PATH'])
708     plantestsuite("samba3.blackbox.timestamps", env,
709                   [os.path.join(samba3srcdir, "script/tests/test_timestamps.sh"),
710                    '$SERVER_IP', '$USERNAME', '$PASSWORD', '$LOCAL_PATH', smbclient3])
711     plantestsuite("samba3.blackbox.volumeserialnumber", env,
712                   [os.path.join(samba3srcdir, "script/tests/test_volume_serial_number.sh"),
713                    '$SERVER_IP', '$USERNAME', '$PASSWORD', 'volumeserialnumber', smbclient3])
714     plantestsuite("samba3.blackbox.smb1_system_security", env + "_smb1_done",
715                   [os.path.join(samba3srcdir, "script/tests/test_smb1_system_security.sh"),
716                    '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', smbtorture3, net, 'tmp'])
717     plantestsuite("samba3.blackbox.sacl_get_set", env,
718                   [os.path.join(samba3srcdir, "script/tests/test_sacl_set_get.sh"),
719                    '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', smbtorture3, net, 'tmp'])
720     plantestsuite("samba3.blackbox.NT1.shadow_copy_torture", env + "_smb1_done",
721                   [os.path.join(samba3srcdir, "script/tests/test_smb1_shadow_copy_torture.sh"),
722                    '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH/shadow', smbtorture4])
723     plantestsuite("samba3.blackbox.smbclient_iconv.SMB2", env,
724                   [os.path.join(samba3srcdir, "script/tests/test_smbclient_iconv.sh"),
725                    '$SERVER', '$SERVER_IP', 'bad_iconv', '$USERNAME', '$PASSWORD', smbclient3])
726     plantestsuite("samba3.blackbox.smbclient_iconv.NT1", env + "_smb1_done",
727                   [os.path.join(samba3srcdir, "script/tests/test_smbclient_iconv.sh"),
728                    '$SERVER', '$SERVER_IP', 'bad_iconv', '$USERNAME', '$PASSWORD', smbclient3, '-mNT1'])
729     plantestsuite("samba3.blackbox.smbclient_iconv.CORE", env + "_smb1_done",
730                   [os.path.join(samba3srcdir, "script/tests/test_smbclient_iconv.sh"),
731                    '$SERVER', '$SERVER_IP', 'bad_iconv', '$USERNAME', '$PASSWORD', smbclient3, '-mCORE'])
732     plantestsuite("samba3.blackbox.test_veto_rmdir", env,
733                   [os.path.join(samba3srcdir, "script/tests/test_veto_rmdir.sh"),
734                   '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$LOCAL_PATH/veto', smbclient3])
735     plantestsuite("samba3.blackbox.test_dangle_rmdir", env,
736                   [os.path.join(samba3srcdir, "script/tests/test_delete_veto_files_only_rmdir.sh"),
737                   '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$LOCAL_PATH/veto', smbclient3])
738     plantestsuite("samba3.blackbox.test_list_servers.NT1",
739                   env + "_smb1_done",
740                   [os.path.join(samba3srcdir, "script/tests/test_smbclient_list_servers.sh"),
741                   '$SERVER',
742                   '$SERVER_IP',
743                   '$USERNAME',
744                   '$PASSWORD',
745                   smbclient3,
746                   "-mSMB3"])
747     plantestsuite("samba3.blackbox.test_list_servers.SMB2",
748                   env,
749                   [os.path.join(samba3srcdir, "script/tests/test_smbclient_list_servers.sh"),
750                   '$SERVER',
751                   '$SERVER_IP',
752                   '$USERNAME',
753                   '$PASSWORD',
754                   smbclient3,
755                   "-mSMB3"])
756
757     plantestsuite("samba3.blackbox.test_symlink_traversal.SMB2", env,
758                   [os.path.join(samba3srcdir, "script/tests/test_symlink_traversal_smb2.sh"),
759                   '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$LOCAL_PATH/local_symlinks',
760                   '$PREFIX', smbclient3])
761
762     plantestsuite("samba3.blackbox.test_symlink_traversal.SMB1", env + "_smb1_done",
763                   [os.path.join(samba3srcdir, "script/tests/test_symlink_traversal_smb1.sh"),
764                   '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$LOCAL_PATH/local_symlinks',
765                   '$PREFIX', smbclient3])
766
767     plantestsuite("samba3.blackbox.test_symlink_traversal.SMB1.posix", env + "_smb1_done",
768                   [os.path.join(samba3srcdir, "script/tests/test_symlink_traversal_smb1_posix.sh"),
769                   '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$LOCAL_PATH/local_symlinks',
770                   '$PREFIX', smbclient3])
771
772     plantestsuite("samba3.blackbox.test_symlink_rename.SMB1.posix", env + "_smb1_done",
773                   [os.path.join(samba3srcdir, "script/tests/test_symlink_rename_smb1_posix.sh"),
774                   '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$LOCAL_PATH/local_symlinks',
775                   '$PREFIX', smbclient3])
776
777     plantestsuite("samba3.blackbox.test_veto_files", env,
778                   [os.path.join(samba3srcdir, "script/tests/test_veto_files.sh"),
779                   '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$LOCAL_PATH/veto', smbclient3])
780
781     #
782     # tar command tests
783     #
784
785     # Test smbclient/tarmode
786     plantestsuite("samba3.blackbox.smbclient_tarmode.NT1", env + "_smb1_done",
787                   [os.path.join(samba3srcdir, "script/tests/test_smbclient_tarmode.sh"),
788                    '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD',
789                    '$LOCAL_PATH/tarmode/smbclient_tar', '$PREFIX', smbclient3, configuration, "-mNT1"])
790     plantestsuite("samba3.blackbox.smbclient_tarmode.SMB3", env,
791                   [os.path.join(samba3srcdir, "script/tests/test_smbclient_tarmode.sh"),
792                    '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD',
793                    '$LOCAL_PATH/tarmode/smbclient_tar', '$PREFIX', smbclient3, configuration, "-mSMB3"])
794
795     # Test suite for new smbclient/tar with libarchive (GSoC 13)
796     plantestsuite("samba3.blackbox.smbclient_tar.NT1", env + "_smb1_done",
797                   [os.path.join(samba3srcdir, "script/tests/test_smbclient_tarmode.pl"),
798                    '-n', '$SERVER', '-i', '$SERVER_IP', '-s', 'tarmode2',
799                    '-u', '$USERNAME', '-p', '$PASSWORD', '-l', '$LOCAL_PATH/tarmode2',
800                    '-d', 'smbclient_tar.NT1', '-b', smbclient3,
801                    '--subunit', '--', configuration, '-mNT1'])
802     plantestsuite("samba3.blackbox.smbclient_tar.SMB3", env,
803                   [os.path.join(samba3srcdir, "script/tests/test_smbclient_tarmode.pl"),
804                    '-n', '$SERVER', '-i', '$SERVER_IP', '-s', 'tarmode2',
805                    '-u', '$USERNAME', '-p', '$PASSWORD', '-l', '$LOCAL_PATH/tarmode2',
806                    '-d', 'smbclient_tar.SMB3', '-b', smbclient3,
807                    '--subunit', '--', configuration, '-mSMB3'])
808     plantestsuite("samba3.blackbox.fifo", env,
809                   [os.path.join(samba3srcdir, "script/tests/test_fifo.sh"),
810                   '$SERVER', '$DOMAIN', 'gooduser', '$PASSWORD', '$PREFIX', env, smbclient3])
811     plantestsuite("samba3.blackbox.test_full_audit_success_badname", env,
812                   [os.path.join(samba3srcdir, "script/tests/test_bad_auditnames.sh"),
813                   '$SERVER', 'full_audit_success_bad_name', '$USERNAME', '$PASSWORD', smbclient3])
814     plantestsuite("samba3.blackbox.test_full_audit_fail_badname", env,
815                   [os.path.join(samba3srcdir, "script/tests/test_bad_auditnames.sh"),
816                   '$SERVER', 'full_audit_fail_bad_name', '$USERNAME', '$PASSWORD', smbclient3])
817     plantestsuite("samba3.blackbox.fruit.resource_stream", env,
818                   [os.path.join(samba3srcdir, "script/tests/test_fruit_resource_stream.sh"),
819                   '$SERVER', 'fruit_resource_stream', '$USERNAME', '$PASSWORD',
820                   '$LOCAL_PATH/fruit_resource_stream', smbclient3])
821
822 for env in ["fileserver:local"]:
823     plantestsuite("samba3.blackbox.net_usershare", env, [os.path.join(samba3srcdir, "script/tests/test_net_usershare.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', smbclient3])
824
825     plantestsuite("samba3.blackbox.smbstatus", env, [os.path.join(samba3srcdir, "script/tests/test_smbstatus.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', smbclient3, smbstatus, configuration, "SMB3"])
826     plantestsuite("samba3.blackbox.net_registry_import", env, [os.path.join(samba3srcdir, "script/tests/test_net_registry_import.sh"), '$SERVER', '$LOCAL_PATH', '$USERNAME', '$PASSWORD'])
827
828 plantestsuite("samba3.blackbox.server_addresses",
829               "simpleserver",
830               [os.path.join(samba3srcdir,
831                             "script/tests/test_server_addresses.sh")])
832
833 # TODO encrypted against member, with member creds, and with DC creds
834 plantestsuite("samba3.blackbox.net.misc NT1", "ad_dc_smb1_done:local",
835               [os.path.join(samba3srcdir, "script/tests/test_net_misc.sh"),
836                scriptdir, "$SMB_CONF_PATH", net, configuration, "NT1"])
837 plantestsuite("samba3.blackbox.net.misc SMB3", "ad_dc:local",
838               [os.path.join(samba3srcdir, "script/tests/test_net_misc.sh"),
839                scriptdir, "$SMB_CONF_PATH", net, configuration, "SMB3"])
840 plantestsuite("samba3.blackbox.net.local.registry", "nt4_dc:local",
841               [os.path.join(samba3srcdir, "script/tests/test_net_registry.sh"),
842                scriptdir, "$SMB_CONF_PATH", net, configuration])
843 plantestsuite("samba3.blackbox.net.registry.check", "nt4_dc:local",
844               [os.path.join(samba3srcdir, "script/tests/test_net_registry_check.sh"),
845                scriptdir, "$SMB_CONF_PATH", net, configuration, dbwrap_tool])
846 plantestsuite("samba3.blackbox.net.rpc.registry", "nt4_dc",
847               [os.path.join(samba3srcdir, "script/tests/test_net_registry.sh"),
848                scriptdir, "$SMB_CONF_PATH", net, configuration, 'rpc'])
849
850 plantestsuite("samba3.blackbox.net.local.registry.roundtrip", "nt4_dc:local",
851               [os.path.join(samba3srcdir, "script/tests/test_net_registry_roundtrip.sh"),
852                scriptdir, "$SMB_CONF_PATH", net, configuration])
853 plantestsuite("samba3.blackbox.net.rpc.registry.roundtrip", "nt4_dc",
854               [os.path.join(samba3srcdir, "script/tests/test_net_registry_roundtrip.sh"),
855                scriptdir, "$SMB_CONF_PATH", net, configuration, 'rpc'])
856
857 plantestsuite("samba3.blackbox.net.local.conf", "nt4_dc:local",
858               [os.path.join(samba3srcdir, "script/tests/test_net_conf.sh"),
859                scriptdir, "$SMB_CONF_PATH", net, configuration])
860 plantestsuite("samba3.blackbox.net.rpc.conf", "nt4_dc",
861               [os.path.join(samba3srcdir, "script/tests/test_net_conf.sh"),
862                scriptdir, "$SMB_CONF_PATH", net, configuration, 'rpc'])
863
864
865 plantestsuite("samba3.blackbox.testparm", "nt4_dc:local",
866               [os.path.join(samba3srcdir, "script/tests/test_testparm_s3.sh"),
867                "$LOCAL_PATH"])
868
869 plantestsuite(
870     "samba3.pthreadpool", "none",
871     [os.path.join(samba3srcdir, "script/tests/test_pthreadpool.sh")])
872
873 if with_pthreadpool and have_ldwrap:
874     plantestsuite("samba3.pthreadpool_cmocka", "none",
875                   [os.path.join(bindir(), "pthreadpooltest_cmocka")])
876
877 if with_pthreadpool:
878     plantestsuite("samba3.libwbclient_threads",
879                   "nt4_member",
880                   [os.path.join(samba3srcdir,
881                                 "script/tests/test_libwbclient_threads.sh"),
882                    "$DOMAIN", "$DC_USERNAME"])
883
884 plantestsuite("samba3.test_nfs4_acl", "none",
885               [os.path.join(bindir(), "test_nfs4_acls"),
886                "$SMB_CONF_PATH"])
887
888 plantestsuite("samba3.test_vfs_full_audit", "none",
889               [os.path.join(bindir(), "test_vfs_full_audit"),
890                "$SMB_CONF_PATH"])
891
892 plantestsuite("samba3.test_vfs_posixacl", "none",
893               [os.path.join(bindir(), "test_vfs_posixacl"),
894                "$SMB_CONF_PATH"])
895
896 if is_module_enabled("vfs_gpfs"):
897     plantestsuite("samba3.test_vfs_gpfs", "none",
898                   [os.path.join(bindir(), "test_vfs_gpfs")])
899
900 plantestsuite(
901     "samba3.resolvconf", "none",
902     [os.path.join(samba3srcdir, "script/tests/test_resolvconf.sh")])
903
904 plantestsuite("samba3.tevent_glib_glue", "none",
905     [os.path.join(samba3srcdir, "script/tests/test_tevent_glib_glue.sh")])
906
907 plantestsuite("samba3.async_req", "nt4_dc",
908               [os.path.join(samba3srcdir, "script/tests/test_async_req.sh")])
909
910 # smbtorture4 tests
911
912 base = ["base.attr", "base.charset", "base.chkpath", "base.createx_access", "base.defer_open", "base.delaywrite", "base.delete",
913         "base.deny1", "base.deny2", "base.deny3", "base.denydos", "base.dir1", "base.dir2",
914         "base.disconnect", "base.fdpass", "base.lock",
915         "base.mangle", "base.negnowait", "base.ntdeny1",
916         "base.ntdeny2", "base.open", "base.openattr", "base.properties", "base.rename", "base.rw1",
917         "base.secleak", "base.tcon", "base.tcondev", "base.trans2", "base.unlink", "base.vuid",
918         "base.xcopy", "base.samba3error"]
919
920 raw = ["raw.acls", "raw.chkpath", "raw.close", "raw.composite", "raw.context", "raw.eas",
921        "raw.ioctl", "raw.lock", "raw.mkdir", "raw.mux", "raw.notify", "raw.open", "raw.oplock",
922        "raw.qfileinfo", "raw.qfsinfo", "raw.read", "raw.rename", "raw.search", "raw.seek",
923        "raw.sfileinfo.base", "raw.sfileinfo.bug", "raw.streams", "raw.unlink", "raw.write",
924        "raw.samba3hide", "raw.samba3badpath", "raw.sfileinfo.rename", "raw.session",
925        "raw.samba3caseinsensitive", "raw.samba3posixtimedlock",
926        "raw.samba3rootdirfid", "raw.samba3rootdirfid2", "raw.sfileinfo.end-of-file",
927        "raw.bench-oplock", "raw.bench-lock", "raw.bench-open", "raw.bench-tcon",
928        "raw.samba3checkfsp", "raw.samba3closeerr", "raw.samba3oplocklogoff", "raw.samba3badnameblob"]
929
930 smb2 = smbtorture4_testsuites("smb2.")
931
932 rpc = ["rpc.authcontext",
933        "rpc.samba3.bind",
934        "rpc.samba3.srvsvc",
935        "rpc.samba3.sharesec",
936        "rpc.samba3.spoolss",
937        "rpc.samba3.wkssvc",
938        "rpc.samba3.winreg",
939        "rpc.samba3.getaliasmembership-0",
940        "rpc.samba3.netlogon",
941        "rpc.samba3.sessionkey",
942        "rpc.samba3.getusername",
943        "rpc.samba3.smb1-pipe-name",
944        "rpc.samba3.smb2-pipe-name",
945        "rpc.samba3.smb-reauth1",
946        "rpc.samba3.smb-reauth2",
947        "rpc.samba3.lsa_over_netlogon",
948        "rpc.samba3.pipes_supported_interfaces",
949        "rpc.svcctl",
950        "rpc.ntsvcs",
951        "rpc.winreg",
952        "rpc.eventlog",
953        "rpc.spoolss.printserver",
954        "rpc.spoolss.win",
955        "rpc.spoolss.notify",
956        "rpc.spoolss.printer",
957        "rpc.spoolss.driver",
958        "rpc.lsa",
959        "rpc.lsa-getuser",
960        "rpc.lsa.lookupsids",
961        "rpc.lsa.lookupnames",
962        "rpc.lsa.privileges",
963        "rpc.lsa.secrets",
964        "rpc.mdssvc",
965        "rpc.samr",
966        "rpc.samr.users",
967        "rpc.samr.users.privileges",
968        "rpc.samr.passwords.default",
969        "rpc.samr.passwords.pwdlastset",
970        "rpc.samr.passwords.lockout",
971        "rpc.samr.passwords.badpwdcount",
972        "rpc.samr.large-dc",
973        "rpc.samr.machine.auth",
974        "rpc.samr.priv",
975        "rpc.samr.passwords.validate",
976        "rpc.samr.handletype",
977        "rpc.netlogon.admin",
978        "rpc.netlogon.zerologon",
979        "rpc.schannel",
980        "rpc.schannel2",
981        "rpc.bench-schannel1",
982        "rpc.schannel_anon_setpw",
983        "rpc.join",
984        "rpc.bind",
985        "rpc.initshutdown",
986        "rpc.wkssvc",
987        "rpc.srvsvc"]
988
989 local = ["local.nss"]
990
991 idmap = ["idmap.rfc2307", "idmap.alloc", "idmap.rid", "idmap.ad"]
992
993 rap = ["rap.basic", "rap.rpc", "rap.printing", "rap.sam"]
994
995 unix = ["unix.info2", "unix.whoami"]
996
997 nbt = ["nbt.dgram"]
998
999 vfs = [
1000     "vfs.fruit",
1001     "vfs.acl_xattr",
1002     "vfs.fruit_netatalk",
1003     "vfs.fruit_file_id",
1004     "vfs.fruit_timemachine",
1005     "vfs.fruit_conversion",
1006     "vfs.unfruit",
1007 ]
1008
1009 tests = base + raw + smb2 + rpc + unix + local + rap + nbt + idmap + vfs
1010
1011 for t in tests:
1012     if t == "base.delaywrite" or t == "base.deny1" or t == "base.deny2":
1013         plansmbtorture4testsuite(t, "fileserver_smb1", '//$SERVER/tmp -U$USERNAME%$PASSWORD --maximum-runtime=900')
1014     elif t == "base.createx_access":
1015         plansmbtorture4testsuite(t, "ad_dc_smb1", '//$SERVER/tmp -U$USERNAME%$PASSWORD -k yes --maximum-runtime=900')
1016     elif t == "rap.sam":
1017         plansmbtorture4testsuite(t, "nt4_dc_smb1", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --option=doscharset=ISO-8859-1')
1018         plansmbtorture4testsuite(t, "ad_dc_smb1", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --option=doscharset=ISO-8859-1')
1019     elif t == "winbind.pac":
1020         plansmbtorture4testsuite(t, "ad_member:local", '//$SERVER/tmp --realm=$REALM --machine-pass --option=torture:addc=$DC_SERVER', description="machine account")
1021     elif t == "unix.whoami":
1022         plansmbtorture4testsuite(t, "nt4_member:local", '//$SERVER/tmp --machine-pass', description="machine account")
1023         plansmbtorture4testsuite(t, "ad_dc_smb1:local", '//$SERVER/tmp --machine-pass', description="machine account")
1024         plansmbtorture4testsuite(t, "ad_member:local", '//$SERVER/tmp --machine-pass --option=torture:addc=$DC_SERVER', description="machine account")
1025         plansmbtorture4testsuite(t, "ad_dc_smb1:local", '//$SERVER/tmp --machine-pass --option=torture:addc=$DC_SERVER', description="machine account")
1026         for env in ["nt4_dc_smb1", "nt4_member"]:
1027             plansmbtorture4testsuite(t, env, '//$SERVER/tmp -U$DC_USERNAME%$DC_PASSWORD')
1028             plansmbtorture4testsuite(t, env, '//$SERVER/tmpguest -U%', description='anonymous connection')
1029         for env in ["ad_dc_smb1", "ad_member"]:
1030             plansmbtorture4testsuite(t, env, '//$SERVER/tmp -U$DC_USERNAME@$REALM%$DC_PASSWORD --option=torture:addc=$DC_SERVER')
1031             plansmbtorture4testsuite(t, env, '//$SERVER/tmp -k yes -U$DC_USERNAME@$REALM%$DC_PASSWORD --option=torture:addc=$DC_SERVER', description='kerberos connection')
1032             plansmbtorture4testsuite(t, env, '//$SERVER/tmpguest -U% --option=torture:addc=$DC_SERVER', description='anonymous connection')
1033             plansmbtorture4testsuite(t, env, '//$SERVER/tmp -k no -U$DC_USERNAME@$REALM%$DC_PASSWORD', description='ntlm user@realm')
1034     elif t == "raw.samba3posixtimedlock":
1035         plansmbtorture4testsuite(t, "nt4_dc_smb1", '//$SERVER_IP/tmpguest -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc_smb1/share')
1036         plansmbtorture4testsuite(t, "nt4_dc_smb1", '//$SERVER_IP/brl_delay_inject1 -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc_smb1/share',
1037                                  description="brl_delay_inject1")
1038         plansmbtorture4testsuite(t, "nt4_dc_smb1", '//$SERVER_IP/brl_delay_inject2 -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc_smb1/share',
1039                                  description="brl_delay_inject2")
1040         plansmbtorture4testsuite(t, "ad_dc_smb1", '//$SERVER_IP/tmpguest -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/ad_dc_smb1/share')
1041     elif t == "smb2.samba3misc":
1042         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmpguest -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share')
1043         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/brl_delay_inject1 -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share',
1044                                  description="brl_delay_inject1")
1045         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/brl_delay_inject2 -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share',
1046                                  description="brl_delay_inject2")
1047         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER_IP/tmpguest -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/ad_dc/share')
1048     elif t == "raw.chkpath":
1049         plansmbtorture4testsuite(t, "nt4_dc_smb1", '//$SERVER_IP/tmpcase -U$USERNAME%$PASSWORD')
1050         plansmbtorture4testsuite(t, "ad_dc_smb1", '//$SERVER_IP/tmpcase -U$USERNAME%$PASSWORD')
1051     elif t == "raw.samba3hide" or t == "raw.samba3checkfsp" or t == "raw.samba3closeerr":
1052         plansmbtorture4testsuite(t, "nt4_dc_smb1", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
1053         plansmbtorture4testsuite(t, "fileserver_smb1", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
1054         plansmbtorture4testsuite(t, "ad_dc_smb1", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
1055     elif t == "raw.session":
1056         plansmbtorture4testsuite(t, "nt4_dc_smb1", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD', 'plain')
1057         plansmbtorture4testsuite(t, "nt4_dc_smb1", '//$SERVER_IP/tmpenc -U$USERNAME%$PASSWORD', 'enc')
1058         plansmbtorture4testsuite(t, "ad_dc_smb1", '//$SERVER/tmp -k no -U$USERNAME%$PASSWORD', 'ntlm')
1059         plansmbtorture4testsuite(t, "ad_dc_smb1", '//$SERVER/tmp -k yes -U$USERNAME%$PASSWORD', 'krb5')
1060     elif t == "smb2.session":
1061         alice_creds = "--option='torture:user2name=alice' --option='torture:user2password=Secret007'"
1062         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD', 'plain')
1063         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmpenc -U$USERNAME%$PASSWORD', 'enc')
1064         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -k no -U$USERNAME%$PASSWORD ' + alice_creds, 'ntlm')
1065         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -k yes -U$USERNAME%$PASSWORD ' + alice_creds, 'krb5')
1066         # Certain tests fail when run against ad_member with MIT kerberos because the private krb5.conf overrides the provisioned lib/krb5.conf,
1067         # ad_member_idmap_rid sets "create krb5.conf = no"
1068         plansmbtorture4testsuite(t, "ad_member_idmap_rid", '//$SERVER/tmp -k yes -U$DC_USERNAME@$REALM%$DC_PASSWORD', 'krb5')
1069     elif t == "rpc.lsa":
1070         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD', 'over ncacn_np ')
1071         plansmbtorture4testsuite(t, "nt4_dc", 'ncacn_ip_tcp:$SERVER_IP -U$USERNAME%$PASSWORD', 'over ncacn_ip_tcp ')
1072     elif t.startswith("rpc.lsa."):
1073         # This avoids the rpc.lsa.* tests runing under ncacn_ip_tcp:
1074         # (there is rpc.lsa.secrets fails due to OpenPolicy2 for example)
1075         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
1076     elif t == "rpc.mdssvc":
1077         plansmbtorture4testsuite(t, "fileserver", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
1078     elif t == "smb2.durable-open" or t == "smb2.durable-v2-open" or t == "smb2.replay" or t == "smb2.durable-v2-delay":
1079         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/durable -U$USERNAME%$PASSWORD')
1080         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER_IP/durable -U$USERNAME%$PASSWORD')
1081     elif t == "base.rw1":
1082         plansmbtorture4testsuite(t, "nt4_dc_smb1", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
1083         plansmbtorture4testsuite(t, "nt4_dc_smb1", '//$SERVER_IP/valid-users-tmp -U$USERNAME%$PASSWORD')
1084         plansmbtorture4testsuite(t, "nt4_dc_smb1", '//$SERVER_IP/write-list-tmp -U$USERNAME%$PASSWORD')
1085         plansmbtorture4testsuite(t, "ad_dc_smb1", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
1086     elif t == "idmap.rfc2307":
1087         plantestsuite(t, "ad_member_rfc2307",
1088                       [os.path.join(samba3srcdir,
1089                                     "../nsswitch/tests/test_idmap_rfc2307.sh"),
1090                        '$DOMAIN',
1091                        'Administrator', '2000000',
1092                        'Guest', '2000001',
1093                        '"Domain Users"', '2000002',
1094                        'DnsAdmins', '2000003',
1095                        '2000005', '35',
1096                        'ou=idmap,dc=samba,dc=example,dc=com',
1097                        '$DC_SERVER', '$DC_USERNAME', '$DC_PASSWORD'])
1098     elif t == "idmap.alloc":
1099         plantestsuite(t, "ad_member_rfc2307", [os.path.join(samba3srcdir, "../nsswitch/tests/test_idmap_nss.sh"), '$DOMAIN'])
1100     elif t == "idmap.rid":
1101         plantestsuite(t, "ad_member_idmap_rid", [os.path.join(samba3srcdir, "../nsswitch/tests/test_idmap_rid.sh"), '$DOMAIN', '2000000'])
1102         plantestsuite(t,
1103                       "admem_idmap_autorid",
1104                       [os.path.join(samba3srcdir,
1105                                     "../nsswitch/tests/test_idmap_rid.sh"),
1106                        '$DOMAIN',
1107                        '2000000'])
1108     elif t == "idmap.ad":
1109         plantestsuite(t, "ad_member_idmap_ad", [os.path.join(samba3srcdir, "../nsswitch/tests/test_idmap_ad.sh"), '$DOMAIN', '$DC_SERVER', '$DC_PASSWORD', '$TRUST_DOMAIN', '$TRUST_SERVER', '$TRUST_PASSWORD'])
1110     elif t == "raw.acls":
1111         plansmbtorture4testsuite(t, "nt4_dc_smb1", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
1112         plansmbtorture4testsuite(t, "nt4_dc_smb1", '//$SERVER_IP/nfs4acl_simple_40 -U$USERNAME%$PASSWORD', description='nfs4acl_xattr-simple-40')
1113         plansmbtorture4testsuite(t, "nt4_dc_smb1", '//$SERVER_IP/nfs4acl_special_40 -U$USERNAME%$PASSWORD', description='nfs4acl_xattr-special-40')
1114         plansmbtorture4testsuite(t, "nt4_dc_smb1", '//$SERVER_IP/nfs4acl_simple_41 -U$USERNAME%$PASSWORD', description='nfs4acl_xattr-simple-41')
1115         plansmbtorture4testsuite(t, "nt4_dc_smb1", '//$SERVER_IP/nfs4acl_xdr_40 -U$USERNAME%$PASSWORD', description='nfs4acl_xattr-xdr-40')
1116         plansmbtorture4testsuite(t, "nt4_dc_smb1", '//$SERVER_IP/nfs4acl_xdr_41 -U$USERNAME%$PASSWORD', description='nfs4acl_xattr-xdr-41')
1117         plansmbtorture4testsuite(t, "nt4_dc_smb1", '//$SERVER_IP/nfs4acl_nfs_40 -U$USERNAME%$PASSWORD', description='nfs4acl_xattr-nfs-40')
1118         plansmbtorture4testsuite(t, "nt4_dc_smb1", '//$SERVER_IP/nfs4acl_nfs_41 -U$USERNAME%$PASSWORD', description='nfs4acl_xattr-nfs-41')
1119         plansmbtorture4testsuite(t, "ad_dc_smb1", '//$SERVER_IP/tmpcase -U$USERNAME%$PASSWORD')
1120     elif t == "smb2.ioctl":
1121         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/fs_specific -U$USERNAME%$PASSWORD', 'fs_specific')
1122         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
1123         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
1124     elif t == "smb2.ioctl-on-stream":
1125         plansmbtorture4testsuite(t, "fileserver", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
1126     elif t == "smb2.lock":
1127         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/aio -U$USERNAME%$PASSWORD', 'aio')
1128         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
1129     elif t == "raw.lock" or t == "base.lock":
1130         plansmbtorture4testsuite(t, "nt4_dc_smb1", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
1131     elif t == "raw.read":
1132         plansmbtorture4testsuite(t, "nt4_dc_smb1", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
1133         plansmbtorture4testsuite(t, "nt4_dc_smb1", '//$SERVER_IP/aio -U$USERNAME%$PASSWORD', 'aio')
1134         plansmbtorture4testsuite(t, "ad_dc_smb1", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
1135     elif t == "raw.search":
1136         plansmbtorture4testsuite(t, "nt4_dc_smb1", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
1137 # test the dirsort module.
1138         plansmbtorture4testsuite(t, "nt4_dc_smb1", '//$SERVER_IP/tmpsort -U$USERNAME%$PASSWORD')
1139         plansmbtorture4testsuite(t, "ad_dc_smb1", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
1140     elif t == "vfs.fruit":
1141         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share --option=torture:share2=vfs_wo_fruit', 'metadata_netatalk')
1142         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit_metadata_stream -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share --option=torture:share2=vfs_wo_fruit', 'metadata_stream')
1143         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit_stream_depot -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share --option=torture:share2=vfs_wo_fruit_stream_depot', 'streams_depot')
1144         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit_delete_empty_adfiles -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share --option=torture:share2=vfs_wo_fruit', 'fruit_delete_empty_adfiles')
1145     elif t == "vfs.fruit_netatalk":
1146         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit_xattr -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share')
1147     elif t == "vfs.fruit_timemachine":
1148         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit_timemachine -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share')
1149     elif t == "vfs.fruit_file_id":
1150         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit_zero_fileid -U$USERNAME%$PASSWORD')
1151     elif t == "vfs.fruit_conversion":
1152         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --option=torture:share2=vfs_fruit_wipe_intentionally_left_blank_rfork --option=torture:delete_empty_adfiles=false', 'wipe_intentionally_left_blank_rfork')
1153         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --option=torture:share2=vfs_fruit_delete_empty_adfiles --option=torture:delete_empty_adfiles=true', 'delete_empty_adfiles')
1154     elif t == "vfs.unfruit":
1155         creds = '-U$USERNAME%$PASSWORD'
1156         share2 = '--option=torture:share2=tmp'
1157         netopt = '--option=torture:net=%s' % net
1158         shareopt = '--option=torture:sharename'
1159
1160         plansmbtorture4testsuite(t, "nt4_dc:local", '//$SERVER_IP/vfs_fruit %s %s %s %s=%s' % (creds, share2, netopt, shareopt, 'vfs_fruit'), 'metadata_netatalk')
1161         plansmbtorture4testsuite(t, "nt4_dc:local", '//$SERVER_IP/vfs_fruit_metadata_stream %s %s %s %s=%s' % (creds, share2, netopt, shareopt, 'vfs_fruit_metadata_stream'), 'metadata_stream')
1162         plansmbtorture4testsuite(t, "nt4_dc:local", '//$SERVER_IP/vfs_fruit_stream_depot %s %s %s %s=%s' % (creds, share2, netopt, shareopt, 'vfs_fruit_stream_depot'), 'streams_depot')
1163     elif t == "rpc.schannel_anon_setpw":
1164         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$%', description="anonymous password set")
1165         plansmbtorture4testsuite(t, "nt4_dc_schannel", '//$SERVER_IP/tmp -U$%', description="anonymous password set (schannel enforced server-side)")
1166         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$%', description="anonymous password set")
1167     elif t == "local.nss":
1168         for env in ["nt4_dc:local", "ad_member:local", "nt4_member:local", "ad_dc:local"]:
1169             plansmbtorture4testsuite(t, env, '//$SERVER/tmp -U$USERNAME%$PASSWORD')
1170     elif t == "smb2.change_notify_disabled":
1171         plansmbtorture4testsuite(t, "simpleserver", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
1172     elif t == "smb2.notify" or t == "raw.notify" or t == "smb2.oplock" or t == "raw.oplock":
1173         tmp_env = "nt4_dc"
1174         if t == "raw.notify" or t == "raw.oplock":
1175             tmp_env = "nt4_dc_smb1"
1176         # These tests are a little slower so don't duplicate them with ad_dc
1177         plansmbtorture4testsuite(t, tmp_env, '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --client-protection=sign')
1178     elif t == "smb2.dosmode":
1179         plansmbtorture4testsuite(t, "simpleserver", '//$SERVER/dosmode -U$USERNAME%$PASSWORD')
1180     elif t == "smb2.kernel-oplocks":
1181         if have_linux_kernel_oplocks:
1182             plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER/kernel_oplocks -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share')
1183     elif t == "smb2.notify-inotify":
1184         if have_inotify:
1185             plansmbtorture4testsuite(t, "fileserver", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
1186     elif t == "vfs.acl_xattr":
1187         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
1188     elif t == "smb2.compound_find":
1189         plansmbtorture4testsuite(t, "fileserver", '//$SERVER/compound_find -U$USERNAME%$PASSWORD')
1190         plansmbtorture4testsuite(t, "fileserver", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
1191     elif t == "smb2.compound":
1192         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
1193         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/aio -U$USERNAME%$PASSWORD', 'aio')
1194         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
1195     elif t == "smb2.compound_async":
1196         plansmbtorture4testsuite(t, "fileserver", '//$SERVER_IP/aio_delay_inject -U$USERNAME%$PASSWORD')
1197     elif t == "smb2.ea":
1198         plansmbtorture4testsuite(t, "fileserver", '//$SERVER/ea_acl_xattr --option=torture:acl_xattr_name=hackme -U$USERNAME%$PASSWORD')
1199     elif t == "rpc.samba3.netlogon" or t == "rpc.samba3.sessionkey":
1200         plansmbtorture4testsuite(t, "nt4_dc_smb1", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --option=torture:wksname=samba3rpctest')
1201         plansmbtorture4testsuite(t, "ad_dc_smb1", '//$SERVER/tmp -U$USERNAME%$PASSWORD --option=torture:wksname=samba3rpctest')
1202     elif t == "smb2.streams":
1203         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
1204         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
1205         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/streams_xattr -U$USERNAME%$PASSWORD', 'streams_xattr')
1206     elif t == "smb2.aio_delay":
1207         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/aio_delay_inject -U$USERNAME%$PASSWORD')
1208     elif t == "smb2.delete-on-close-perms":
1209         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
1210         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/delete_readonly -U$USERNAME%$PASSWORD --option=torture:delete_readonly=true')
1211         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
1212     elif t == "smb2.fileid":
1213         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit_xattr -U$USERNAME%$PASSWORD')
1214     elif t == "smb2.acls_non_canonical":
1215         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/acls_non_canonical -U$USERNAME%$PASSWORD')
1216     elif t == "smb2.async_dosmode":
1217         plansmbtorture4testsuite("smb2.async_dosmode",
1218                                  "simpleserver",
1219                                  "//$SERVER_IP/async_dosmode_shadow_copy2 -U$USERNAME%$PASSWORD")
1220     elif t == "smb2.rename":
1221         plansmbtorture4testsuite(t, "fileserver", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
1222     elif t == "smb2.twrp":
1223         # This is being driven by samba3.blackbox.shadow_copy_torture
1224         pass
1225     elif t == "smb2.create_no_streams":
1226         plansmbtorture4testsuite(t, "fileserver", '//$SERVER_IP/nfs4acl_simple_40 -U$USERNAME%$PASSWORD')
1227     elif t == "rpc.wkssvc":
1228         plansmbtorture4testsuite(t, "ad_member", '//$SERVER/tmp -U$DC_USERNAME%$DC_PASSWORD')
1229     elif t == "rpc.srvsvc":
1230         plansmbtorture4testsuite(t, "ad_member", '//$SERVER/tmp -U$DC_USERNAME%$DC_PASSWORD')
1231         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$DC_USERNAME%$DC_PASSWORD')
1232     elif t == "rpc.samba3.lsa_over_netlogon":
1233         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
1234     elif t == "rpc.samba3.pipes_supported_interfaces":
1235         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
1236         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
1237     elif t == "rpc.spoolss.notify":
1238         plansmbtorture4testsuite(t, "ad_member", '//$SERVER_IP/tmp -U$DC_USERNAME%$DC_PASSWORD')
1239     elif (t in base and t != "base.charset") \
1240         or (t in rap and t != "rap.printing") \
1241         or (t in unix) \
1242         or (t in ["rpc.authcontext",
1243                   "rpc.join",
1244                   "rpc.samba3.bind",
1245                   "rpc.samba3.getusername",
1246                   "rpc.samba3.sharesec",
1247                   "rpc.samba3.smb1-pipe-name",
1248                   "rpc.samba3.smb-reauth1",
1249                   "rpc.samba3.smb-reauth2",
1250                   "rpc.samba3.spoolss",
1251                   "rpc.samba3.wkssvc",]) \
1252         or (t in ["raw.close",
1253                   "raw.composite",
1254                   "raw.eas",
1255                   "raw.mkdir",
1256                   "raw.open",
1257                   "raw.rename",
1258                   "raw.samba3badnameblob",
1259                   "raw.samba3badpath",
1260                   "raw.samba3caseinsensitive",
1261                   "raw.samba3oplocklogoff",
1262                   "raw.samba3posixtimedlock",
1263                   "raw.samba3rootdirfid",
1264                   "raw.samba3rootdirfid2",
1265                   "raw.seek",
1266                   "raw.sfileinfo.bug",
1267                   "raw.sfileinfo.end-of-file",
1268                   "raw.sfileinfo.rename",
1269                   "raw.streams",
1270                   "raw.unlink",
1271                   "raw.write",]) :
1272         plansmbtorture4testsuite(t, "nt4_dc_smb1", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
1273         plansmbtorture4testsuite(t, "ad_dc_smb1", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
1274     elif t in ["base.mangle", "base.tcon", "raw.mkdir"]:
1275         plansmbtorture4testsuite(t, "nt4_dc_smb1_done", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
1276         plansmbtorture4testsuite(t, "ad_dc_smb1_done", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
1277     elif t == "rpc.samr.passwords.validate":
1278         plansmbtorture4testsuite(t, "nt4_dc", 'ncacn_ip_tcp:$SERVER_IP[seal] -U$USERNAME%$PASSWORD', 'over ncacn_ip_tcp ')
1279     elif t == "rpc.samr.users.privileges":
1280         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --option=torture:nt4_dc=true')
1281     elif t == "rpc.samr" or t.startswith("rpc.samr."):
1282         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
1283     else:
1284         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
1285         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
1286
1287 plantestsuite(
1288     "idmap_ad.ticket_expiry",
1289     "ad_member_idmap_ad:local",
1290     [os.path.join(samba3srcdir, "../nsswitch/tests/test_ticket_expiry.sh"),
1291      '$DOMAIN'])
1292
1293 plansmbtorture4testsuite(
1294     "notifyd",
1295     "fileserver:local",
1296     '//foo/bar -U%')
1297
1298 plansmbtorture4testsuite(
1299     "smb2.streams",
1300     "simpleserver",
1301     '//$SERVER/external_streams_depot -U$USERNAME%$PASSWORD')
1302
1303 test = 'rpc.lsa.lookupsids'
1304 auth_options = ["", "ntlm", "spnego", "spnego,ntlm", "spnego,smb1", "spnego,smb2"]
1305 signseal_options = ["", ",connect", ",packet", ",sign", ",seal"]
1306 endianness_options = ["", ",bigendian"]
1307 for s in signseal_options:
1308     for e in endianness_options:
1309         for a in auth_options:
1310             binding_string = "ncacn_np:$SERVER[%s%s%s]" % (a, s, e)
1311             options = binding_string + " -U$USERNAME%$PASSWORD"
1312             if "smb1" in a:
1313                 plansmbtorture4testsuite(test, "nt4_dc_smb1_done", options, 'over ncacn_np with [%s%s%s] ' % (a, s, e))
1314             else:
1315                 plansmbtorture4testsuite(test, "nt4_dc", options, 'over ncacn_np with [%s%s%s] ' % (a, s, e))
1316             plantestsuite(
1317                 f'samba3.blackbox.rpcclient over ncacn_np with [{a}{s}{e}] ',
1318                 "nt4_dc:local",
1319                 [os.path.join(samba3srcdir, "script/tests/test_rpcclient.sh"),
1320                  "none",
1321                  options + " -c getusername",
1322                  configuration])
1323             plantestsuite(
1324                 f'samba3.blackbox.rpcclient over ncalrpc with [{a}{s}{e}] ',
1325                 "nt4_dc:local",
1326                 [os.path.join(samba3srcdir, "script/tests/test_rpcclient.sh"),
1327                  "none",
1328                  f'ncalrpc:[{a}{s}{e}] -c epmmap',
1329                  configuration])
1330             if s != ",connect":
1331                 plantestsuite(
1332                     f'samba3.blackbox.rpcclient over ncacn_ip_tcp with [{a}{s}{e}] ',
1333                     "nt4_dc:local",
1334                     [os.path.join(samba3srcdir, "script/tests/test_rpcclient.sh"),
1335                      "none",
1336                      f'ncacn_ip_tcp:"$SERVER_IP"[{a}{s}{e}] -c epmmap -U"$USERNAME"%"$PASSWORD"',
1337                      configuration])
1338
1339     # We should try more combinations in future, but this is all
1340     # the pre-calculated credentials cache supports at the moment
1341     #
1342     # As the ktest env requires SMB3_00 we need to use "smb2" until
1343     # dcerpc client code in smbtorture support autonegotiation
1344     # of any smb dialect.
1345     e = ""
1346     a = "smb2"
1347     binding_string = "ncacn_np:$SERVER[%s%s%s]" % (a, s, e)
1348     options = binding_string + " --use-krb5-ccache=$PREFIX/ktest/krb5_ccache-2"
1349     plansmbtorture4testsuite(test, "ktest", options, 'krb5 with old ccache ncacn_np with [%s%s%s] ' % (a, s, e))
1350
1351     options = binding_string + " --use-krb5-ccache=$PREFIX/ktest/krb5_ccache-3"
1352     plansmbtorture4testsuite(test, "ktest", options, 'krb5 ncacn_np with [%s%s%s] ' % (a, s, e))
1353
1354     auth_options2 = ["krb5", "spnego,krb5"]
1355     for a in auth_options2:
1356         binding_string = "ncacn_np:$SERVER[%s%s%s]" % (a, s, e)
1357
1358         plantestsuite(
1359             f'samba3.blackbox.rpcclient krb5 ncacn_np with [{a}{s}{e}] ',
1360             "ktest:local",
1361             [os.path.join(samba3srcdir, "script/tests/test_rpcclient.sh"),
1362              "$PREFIX/ktest/krb5_ccache-3",
1363              binding_string,
1364              "--use-krb5-ccache=$PREFIX/ktest/krb5_ccache-3 -c getusername",
1365              configuration])
1366
1367 plantestsuite("samba3.blackbox.rpcclient_samlogon", "ad_member:local", [os.path.join(samba3srcdir, "script/tests/test_rpcclient_samlogon.sh"),
1368                                                                         "$DC_USERNAME", "$DC_PASSWORD", "ncacn_np:$DC_SERVER", configuration])
1369 plantestsuite("samba3.blackbox.sharesec", "simpleserver:local",
1370               [os.path.join(samba3srcdir, "script/tests/test_sharesec.sh"),
1371                configuration, os.path.join(bindir(), "sharesec"),
1372                os.path.join(bindir(), "net"), "tmp"])
1373
1374 plantestsuite("samba3.blackbox.close-denied-share", "simpleserver:local",
1375               [os.path.join(samba3srcdir,
1376                             "script/tests/test_close_denied_share.sh"),
1377                configuration,
1378                os.path.join(bindir(), "sharesec"),
1379                os.path.join(bindir(), "smbclient"),
1380                os.path.join(bindir(), "smbcontrol"),
1381                '$SERVER_IP',
1382                "tmp"])
1383
1384 plantestsuite("samba3.blackbox.force-close-share", "simpleserver:local",
1385               [os.path.join(samba3srcdir,
1386                             "script/tests/test_force_close_share.sh"),
1387                configuration,
1388                os.path.join(bindir(), "smbclient"),
1389                os.path.join(bindir(), "smbcontrol"),
1390                '$SERVER_IP',
1391                "aio_delay_inject",
1392                '$PREFIX/force-close-share'])
1393
1394 plantestsuite("samba3.blackbox.open-eintr", "simpleserver:local",
1395               [os.path.join(samba3srcdir,
1396                             "script/tests/test_open_eintr.sh"),
1397                configuration,
1398                os.path.join(bindir(), "smbclient"),
1399                os.path.join(bindir(), "smbcontrol"),
1400                '$SERVER_IP',
1401                "error_inject"])
1402
1403 plantestsuite("samba3.blackbox.chdir-cache", "simpleserver:local",
1404               [os.path.join(samba3srcdir,
1405                             "script/tests/test_chdir_cache.sh"),
1406                configuration,
1407                os.path.join(bindir(), "smbclient"),
1408                os.path.join(bindir(), "smbcontrol"),
1409                '$SERVER_IP',
1410                "error_inject",
1411                '$PREFIX',
1412                'simpleserver'])
1413
1414 plantestsuite("samba3.blackbox.netfileenum", "simpleserver:local",
1415               [os.path.join(samba3srcdir,
1416                             "script/tests/test_netfileenum.sh"),
1417                os.path.join(bindir(), "smbclient"),
1418                os.path.join(bindir(), "rpcclient"),
1419                os.path.join(bindir(), "net"),
1420                '$SERVER_IP',
1421                'tmp'])
1422
1423 plantestsuite("samba3.blackbox.netshareenum_username", "fileserver",
1424               [os.path.join(samba3srcdir,
1425                             "script/tests/test_user_in_sharelist.sh"),
1426                os.path.join(bindir(), "rpcclient"),
1427                '$SERVER_IP'])
1428
1429 plantestsuite("samba3.blackbox.net_tdb", "simpleserver:local",
1430               [os.path.join(samba3srcdir, "script/tests/test_net_tdb.sh"),
1431                smbclient3, '$SERVER', 'tmp', '$USERNAME', '$PASSWORD',
1432                configuration, '$LOCAL_PATH', '$LOCK_DIR'])
1433
1434 plantestsuite("samba3.blackbox.aio-outstanding", "simpleserver:local",
1435               [os.path.join(samba3srcdir,
1436                             "script/tests/test_aio_outstanding.sh"),
1437                configuration,
1438                os.path.join(bindir(), "smbclient"),
1439                '$SERVER_IP',
1440                "aio_delay_inject"])
1441
1442 plantestsuite("samba3.blackbox.deadtime", "simpleserver:local",
1443               [os.path.join(samba3srcdir, "script/tests/test_deadtime.sh"),
1444                '$SERVER_IP'])
1445
1446 plantestsuite("samba3.blackbox.smbd_error", "simpleserver:local",
1447               [os.path.join(samba3srcdir, "script/tests/test_smbd_error.sh")])
1448
1449 plantestsuite("samba3.blackbox.smbd_no_krb5", "ad_member:local",
1450               [os.path.join(samba3srcdir, "script/tests/test_smbd_no_krb5.sh"),
1451                smbclient3, '$SERVER', "$DC_USERNAME", "$DC_PASSWORD", "$PREFIX"])
1452
1453 plantestsuite("samba3.blackbox.winbind_ignore_domain", "ad_member_idmap_ad:local",
1454               [os.path.join(samba3srcdir, "script/tests/test_winbind_ignore_domains.sh")])
1455
1456 plantestsuite("samba3.blackbox.durable_v2_delay", "simpleserver:local",
1457               [os.path.join(samba3srcdir, "script/tests/test_durable_handle_reconnect.sh")])
1458
1459 plantestsuite("samba3.blackbox.net_cache_samlogon", "ad_member:local",
1460               [os.path.join(samba3srcdir, "script/tests/test_net_cache_samlogon.sh"),
1461                '$SERVER', 'tmp', '$DC_USERNAME', '$DC_PASSWORD'])
1462
1463 plantestsuite("samba3.blackbox.net_rpc_share_allowedusers", "nt4_dc",
1464               [os.path.join(samba3srcdir, "script/tests/test_net_rpc_share_allowedusers.sh"),
1465                "$SERVER", "$USERNAME", "$PASSWORD", "$PREFIX/net_rpc_share_allowedusers",
1466                configuration])
1467
1468 plantestsuite("samba3.blackbox.net_dom_join_fail_dc", "nt4_dc",
1469               [os.path.join(samba3srcdir, "script/tests/test_net_dom_join_fail_dc.sh"),
1470                "$USERNAME", "$PASSWORD", "$SERVER", "$PREFIX/net_dom_join_fail_dc",
1471                configuration])
1472 plantestsuite("samba3.blackbox.net_rpc_join", "nt4_dc",
1473               [os.path.join(samba3srcdir, "script/tests/test_net_rpc_join.sh"),
1474                "$USERNAME", "$PASSWORD", "$SERVER", "$PREFIX/net_rpc_join",
1475                configuration])
1476 plantestsuite("samba3.blackbox.net_rpc_oldjoin", "nt4_dc:local",
1477               [os.path.join(samba3srcdir, "script/tests/test_net_rpc_oldjoin.sh"),
1478                "$SERVER", "$PREFIX/net_rpc_oldjoin",
1479                "$SMB_CONF_PATH"])
1480 plantestsuite("samba3.blackbox.net_rpc_join_creds", "nt4_dc",
1481               [os.path.join(samba3srcdir, "script/tests/test_net_rpc_join_creds.sh"),
1482                "$DOMAIN", "$USERNAME", "$PASSWORD", "$SERVER", "$PREFIX/net_rpc_join_creds",
1483                configuration])
1484
1485 plantestsuite("samba3.blackbox.rpcclient_srvsvc", "simpleserver",
1486               [os.path.join(samba3srcdir, "script/tests/test_rpcclientsrvsvc.sh"),
1487                "$USERNAME", "$PASSWORD", "$SERVER",
1488                os.path.join(bindir(), "rpcclient"), "tmp"])
1489
1490 plantestsuite("samba3.blackbox.rpcclient_lookup", "simpleserver",
1491               [os.path.join(samba3srcdir, "script/tests/test_rpcclient_lookup.sh"),
1492                "$USERNAME", "$PASSWORD", "$SERVER",
1493                os.path.join(bindir(), "rpcclient")])
1494
1495 plantestsuite("samba3.blackbox.rpcclient_dfs", "fileserver:local",
1496               [os.path.join(samba3srcdir, "script/tests/test_rpcclient_dfs.sh"),
1497                "$USERNAME", "$PASSWORD", "$SERVER",
1498                os.path.join(bindir(), "rpcclient")])
1499
1500 plantestsuite("samba3.blackbox.rpcclient.pw-nt-hash", "simpleserver",
1501               [os.path.join(samba3srcdir, "script/tests/test_rpcclient_pw_nt_hash.sh"),
1502                "$USERNAME", "$PASSWORD", "$SERVER",
1503                os.path.join(bindir(), "rpcclient")])
1504
1505 plantestsuite("samba3.blackbox.smbclient.encryption_off", "simpleserver",
1506               [os.path.join(samba3srcdir, "script/tests/test_smbclient_encryption_off.sh"),
1507                "$USERNAME", "$PASSWORD", "$SERVER",
1508                smbclient3])
1509
1510 plantestsuite("samba3.blackbox.smbXsrv_client_dead_rec", "fileserver:local",
1511               [os.path.join(samba3srcdir,
1512                             "script/tests/test_smbXsrv_client_dead_rec.sh"),
1513                configuration,
1514                '$SERVER_IP',
1515                "tmp"])
1516
1517 plantestsuite("samba3.blackbox.smbXsrv_client_cross_node", "clusteredmember:local",
1518               [os.path.join(samba3srcdir,
1519                             "script/tests/test_smbXsrv_client_cross_node.sh"),
1520                configuration,
1521                'ctdb0', 'ctdb1',
1522                "tmp"])
1523 plantestsuite("samba3.blackbox.registry_share", "clusteredmember",
1524               [os.path.join(samba3srcdir,
1525                             "script/tests/test_registry_share.sh"),
1526                "$SERVER", '$DC_USERNAME', "$DC_PASSWORD"])
1527
1528 env = 'fileserver'
1529 plantestsuite("samba3.blackbox.virus_scanner", "%s:local" % (env),
1530               [os.path.join(samba3srcdir,
1531                             "script/tests/test_virus_scanner.sh"),
1532                '$SERVER_IP',
1533                "virusfilter",
1534                '$LOCAL_PATH',
1535                smbclient3])
1536
1537 for env in ['fileserver', 'simpleserver']:
1538     plantestsuite("samba3.blackbox.smbclient.encryption", env,
1539                   [os.path.join(samba3srcdir, "script/tests/test_smbclient_encryption.sh"),
1540                    "$USERNAME", "$PASSWORD", "$SERVER",
1541                    smbclient3, env])
1542
1543 plantestsuite("samba3.blackbox.smbclient.kerberos", 'ad_dc',
1544               [os.path.join(samba3srcdir,
1545                             "script/tests/test_smbclient_kerberos.sh"),
1546                "alice",
1547                "$REALM",
1548                "Secret007",
1549                "$SERVER",
1550                smbclient3,
1551                env])
1552 for env in ['ad_dc_fips', 'ad_member_fips']:
1553     plantestsuite("samba3.blackbox.smbclient.kerberos", env,
1554                   [os.path.join(samba3srcdir,
1555                                 "script/tests/test_smbclient_kerberos.sh"),
1556                    "alice",
1557                    "$REALM",
1558                    "Secret007",
1559                    "$SERVER",
1560                    smbclient3,
1561                    env],
1562                   environ={'GNUTLS_FORCE_FIPS_MODE': '1',
1563                            'OPENSSL_FORCE_FIPS_MODE': '1'})
1564
1565 plantestsuite("samba3.blackbox.rpcclient_netsessenum", "ad_member",
1566               [os.path.join(samba3srcdir,
1567                             "script/tests/test_rpcclient_netsessenum.sh"),
1568                "$DOMAIN", "$DC_USERNAME", "$DC_PASSWORD", "$SERVER",
1569                os.path.join(bindir(), "rpcclient"), smbtorture3, "tmp"])
1570
1571 # The ktest environment uses:
1572 # server min protocol = SMB3_00
1573 # client max protocol = SMB3
1574 options_list = ["", "--client-protection=encrypt"]
1575 for options in options_list:
1576     plantestsuite("samba3.blackbox.smbclient_krb5 old ccache %s" % options, "ktest:local",
1577                   [os.path.join(samba3srcdir, "script/tests/test_smbclient_krb5.sh"),
1578                    "$PREFIX/ktest/krb5_ccache-2",
1579                    smbclient3, "$SERVER", options, configuration])
1580
1581     plantestsuite("samba3.blackbox.smbclient_krb5 new ccache %s" % options, "ktest:local",
1582                   [os.path.join(samba3srcdir, "script/tests/test_smbclient_krb5.sh"),
1583                    "$PREFIX/ktest/krb5_ccache-3",
1584                    smbclient3, "$SERVER", options, configuration])
1585
1586     plantestsuite("samba3.blackbox.smbclient_large_file %s krb5" % options, "ktest:local",
1587                   [os.path.join(samba3srcdir, "script/tests/test_smbclient_large_file.sh"),
1588                    "$PREFIX/ktest/krb5_ccache-3",
1589                    smbclient3, "$SERVER", "$PREFIX", options, "--use-krb5-ccache=$PREFIX/ktest/krb5_ccache-3 " + configuration])
1590
1591 options_list = ["-mNT1", "-mNT1 --client-protection=encrypt", "-mSMB3", "-mSMB3 --client-protection=encrypt"]
1592 for options in options_list:
1593     env = "nt4_dc"
1594     if "NT1" in options:
1595         env = "nt4_dc_smb1_done"
1596     plantestsuite("samba3.blackbox.smbclient_large_file %s NTLM" % options, "%s:local" % env,
1597                   [os.path.join(samba3srcdir, "script/tests/test_smbclient_large_file.sh"),
1598                    "none",
1599                    smbclient3, "$SERVER", "$PREFIX", options, "-U$USERNAME%$PASSWORD " + configuration])
1600
1601 for alias in ["foo", "bar"]:
1602     plantestsuite("samba3.blackbox.smbclient_netbios_aliases [%s]" % alias, "ad_member:local",
1603                   [os.path.join(samba3srcdir, "script/tests/test_smbclient_netbios_aliases.sh"),
1604                    smbclient3, alias, "$DC_USERNAME", "$DC_PASSWORD", "$PREFIX",
1605                    configuration])
1606
1607 for e in endianness_options:
1608     for a in auth_options:
1609         for s in signseal_options:
1610             binding_string = "ncacn_ip_tcp:$SERVER_IP[%s%s%s]" % (a, s, e)
1611             options = binding_string + " -U$USERNAME%$PASSWORD"
1612             plansmbtorture4testsuite(test, "nt4_dc", options, 'over ncacn_ip_tcp with [%s%s%s] ' % (a, s, e))
1613
1614 plansmbtorture4testsuite('rpc.epmapper', 'nt4_dc:local', 'ncalrpc: -U$USERNAME%$PASSWORD', 'over ncalrpc')
1615 plansmbtorture4testsuite('rpc.fsrvp', 'nt4_dc:local', 'ncacn_np:$SERVER_IP -U$USERNAME%$PASSWORD', 'over ncacn_np')
1616
1617 for env in ["ad_member_idmap_rid:local", "maptoguest:local"]:
1618     plantestsuite("samba3.blackbox.guest", env,
1619                   [os.path.join(samba3srcdir, "script/tests/test_guest_auth.sh"),
1620                    '$SERVER', smbclient3, smbcontrol, net, configuration])
1621
1622 plantestsuite("samba3.blackbox.smbclient-mget",
1623               "fileserver",
1624               [os.path.join(samba3srcdir, "script/tests/test_smbclient_mget.sh"),
1625                smbclient3,
1626                "$SERVER",
1627                "tmp",
1628                "$USERNAME",
1629                "$PASSWORD",
1630                "valid_users"])
1631
1632 t = "readdir-timestamp"
1633 plantestsuite(
1634     "samba3.smbtorture_s3.plain.%s" % t,
1635     "clusteredmember",
1636     [os.path.join(samba3srcdir,
1637                   "script/tests/test_smbtorture_s3.sh"),
1638      t,
1639      '//foo/bar',
1640      '$DOMAIN\\\\$DC_USERNAME',
1641      '$DC_PASSWORD',
1642      smbtorture3,
1643      "",
1644      "-b $PREFIX/clusteredmember/unclists/tmp.txt -N 5 -o 10"])
1645
1646 plantestsuite(
1647     "samba3.net_machine_account",
1648     "clusteredmember",
1649     [os.path.join(samba3srcdir,
1650                   "script/tests/test_net_machine_account.sh"),
1651      "bin/net",
1652      "$SERVERCONFFILE",
1653      "$SERVER_IP"])
1654
1655 plantestsuite(
1656     "samba3.net_lookup_ldap",
1657     "ad_dc:local",
1658     [os.path.join(samba3srcdir,
1659                   "script/tests/test_net_lookup.sh"),
1660      '$DC_SERVER',
1661      '$DC_USERNAME',
1662      '$DC_PASSWORD',
1663      "bin/net",
1664      "bin/samba-tool",
1665      '$DNSNAME'])
1666
1667 plantestsuite("samba3.blackbox.force-user-unlink",
1668               "maptoguest:local",
1669               [os.path.join(samba3srcdir,
1670                             "script/tests/test_force_user_unlink.sh")])
1671
1672 def planclusteredmembertestsuite(tname, prefix):
1673     '''Define a clustered test for the clusteredmember environment'''
1674
1675     tshare = 'tmp'
1676
1677     autharg = '-U${DOMAIN}/${DC_USERNAME}%${DC_PASSWORD}'
1678     namearg = 'clustered.%s' % tname
1679     modnamearg = 'samba3.%s' % namearg
1680     extraargs = ''
1681
1682     prefix = os.path.join(prefix, 'clusteredmember')
1683     unclist = os.path.join(prefix, 'unclists/%s.txt' % tshare)
1684
1685     unclistarg = '--unclist=%s' % unclist
1686     sharearg = '//$SERVER_IP/%s' % tshare
1687
1688     return selftesthelpers.plansmbtorture4testsuite(
1689         namearg,
1690         'clusteredmember',
1691         [extraargs, unclistarg, sharearg, autharg, tname],
1692         target='samba3',
1693         modname=modnamearg)
1694
1695
1696 CLUSTERED_TESTS = [ 'smb2.deny.deny2' ]
1697
1698 for test in CLUSTERED_TESTS:
1699     planclusteredmembertestsuite(test, "$PREFIX")
1700
1701 CLUSTERED_LOCAL_TESTS = [
1702     "ctdbd-conn1",
1703     "local-dbwrap-ctdb1"
1704 ]
1705
1706 for t in CLUSTERED_LOCAL_TESTS:
1707     plantestsuite(
1708         "samba3.%s" % t,
1709         "clusteredmember:local",
1710         [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"),
1711          t,
1712          '//foo/bar',
1713          '""',
1714          '""',
1715          smbtorture3,
1716          "-N 1000 -o 2000"])
1717
1718 if have_smb3_unix_extensions:
1719     planpythontestsuite("fileserver", "samba.tests.smb3unix")
1720 planpythontestsuite("fileserver", "samba.tests.reparsepoints")
1721 planpythontestsuite("fileserver_smb1", "samba.tests.smb2symlink")
1722 planpythontestsuite("fileserver_smb1", "samba.tests.smb1posix")