nsswitch:tests: Add test for wbinfo --user-info
[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, sys
22 sys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), "../../selftest")))
23 import selftesthelpers
24 from selftesthelpers import *
25 smbtorture4_options.extend([
26    '--option=torture:sharedelay=100000',
27    '--option=torture:writetimeupdatedelay=500000',
28    ])
29
30 def plansmbtorture4testsuite(name, env, options, description=''):
31     if description == '':
32         modname = "samba3.%s" % (name, )
33     else:
34         modname = "samba3.%s %s" % (name, description)
35
36     selftesthelpers.plansmbtorture4testsuite(
37         name, env, options, target='samba3', modname=modname)
38
39 # find config.h
40 try:
41     config_h = os.environ["CONFIG_H"]
42 except KeyError:
43     samba4bindir = bindir()
44     config_h = os.path.join(samba4bindir, "default/include/config.h")
45
46 # check available features
47 config_hash = dict()
48 f = open(config_h, 'r')
49 try:
50     lines = f.readlines()
51     config_hash = dict((x[0], ' '.join(x[1:]))
52             for x in map(lambda line: line.strip().split(' ')[1:],
53                          filter(lambda line: (line[0:7] == '#define') and (len(line.split(' ')) > 2), lines)))
54 finally:
55     f.close()
56
57 have_libarchive = ("HAVE_LIBARCHIVE" in config_hash)
58 have_linux_kernel_oplocks = ("HAVE_KERNEL_OPLOCKS_LINUX" in config_hash)
59 have_inotify = ("HAVE_INOTIFY" in config_hash)
60 have_ldwrap = ("HAVE_LDWRAP" in config_hash)
61 with_pthreadpool = ("WITH_PTHREADPOOL" in config_hash)
62
63
64 plantestsuite("samba3.blackbox.success", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/test_success.sh")])
65 plantestsuite("samba3.blackbox.failure", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/test_failure.sh")])
66
67 plantestsuite("samba3.local_s3", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/test_local_s3.sh")])
68
69 plantestsuite("samba3.blackbox.registry.upgrade", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/test_registry_upgrade.sh"), net, dbwrap_tool])
70
71 tests = ["FDPASS", "LOCK1", "LOCK2", "LOCK3", "LOCK4", "LOCK5", "LOCK6", "LOCK7", "LOCK9",
72         "UNLINK", "BROWSE", "ATTR", "TRANS2", "TORTURE",
73         "OPLOCK1", "OPLOCK2", "OPLOCK4", "STREAMERROR",
74         "DIR", "DIR1", "DIR-CREATETIME", "TCON", "TCONDEV", "RW1", "RW2", "RW3", "LARGE_READX", "RW-SIGNING",
75         "OPEN", "XCOPY", "RENAME", "DELETE", "DELETE-LN", "WILDDELETE", "PROPERTIES", "W2K",
76         "TCON2", "IOCTL", "CHKPATH", "FDSESS", "CHAIN1", "CHAIN2", "OWNER-RIGHTS",
77         "CHAIN3", "PIDHIGH",
78         "UID-REGRESSION-TEST", "SHORTNAME-TEST",
79         "CASE-INSENSITIVE-CREATE", "SMB2-BASIC", "NTTRANS-FSCTL", "SMB2-NEGPROT",
80         "SMB2-SESSION-REAUTH", "SMB2-SESSION-RECONNECT", "SMB2-FTRUNCATE",
81         "SMB2-ANONYMOUS",
82         "CLEANUP1",
83         "CLEANUP2",
84         "CLEANUP4",
85         "BAD-NBT-SESSION"]
86
87 for t in tests:
88     plantestsuite("samba3.smbtorture_s3.plain(fileserver).%s" % t, "fileserver", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
89     plantestsuite("samba3.smbtorture_s3.crypt_client(nt4_dc).%s" % t, "nt4_dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', smbtorture3, "-e", "-l $LOCAL_PATH"])
90     if t == "TORTURE":
91         # this is a negative test to verify that the server rejects
92         # access without encryption
93         plantestsuite("samba3.smbtorture_s3.crypt_server(nt4_dc).%s" % t, "nt4_dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmpenc', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
94     plantestsuite("samba3.smbtorture_s3.plain(ad_dc_ntvfs).%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"])
95
96 t = "TLDAP"
97 plantestsuite("samba3.smbtorture_s3.plain.%s(ad_dc)" % t, "ad_dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER/tmp', '$DC_USERNAME', '$DC_PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
98
99 #
100 # RENAME-ACCESS needs to run against a special share - acl_xattr_ign_sysacl_windows
101 #
102 plantestsuite("samba3.smbtorture_s3.plain(nt4_dc).%s" % "RENAME-ACCESS","nt4_dc", [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"])
103 plantestsuite("samba3.smbtorture_s3.crypt_client(nt4_dc).%s" % "RENAME-ACCESS", "nt4_dc", [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"])
104 # non-crypt only
105
106 tests = ["OPLOCK-CANCEL"]
107 for t in tests:
108     plantestsuite("samba3.smbtorture_s3.plain(nt4_dc).%s" % t, "nt4_dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
109
110 env = "nt4_dc"
111 tests = ["MANGLE-ILLEGAL"]
112 for t in tests:
113     plantestsuite("samba3.smbtorture_s3.plain(%s).%s" % (env, t), env, [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/mangle_illegal', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
114
115 tests = ["RW1", "RW2", "RW3", "SMB2-BASIC"]
116 for t in tests:
117     plantestsuite("samba3.smbtorture_s3.vfs_aio_pthread(simpleserver).%s" % t, "simpleserver", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/vfs_aio_pthread', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
118     plantestsuite("samba3.smbtorture_s3.vfs_aio_fork(simpleserver).%s" % t, "simpleserver", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/vfs_aio_fork', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
119
120 posix_tests = ["POSIX", "POSIX-APPEND", "POSIX-SYMLINK-ACL", "POSIX-SYMLINK-EA", "POSIX-OFD-LOCK",
121               "POSIX-STREAM-DELETE", "WINDOWS-BAD-SYMLINK" ]
122
123 for t in posix_tests:
124     plantestsuite("samba3.smbtorture_s3.plain(nt4_dc).%s" % t, "nt4_dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/posix_share', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
125     plantestsuite("samba3.smbtorture_s3.crypt(nt4_dc).%s" % t, "nt4_dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/posix_share', '$USERNAME', '$PASSWORD', smbtorture3, "-e", "-l $LOCAL_PATH"])
126     plantestsuite("samba3.smbtorture_s3.plain(ad_dc_ntvfs).%s" % t, "ad_dc_ntvfs", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/posix_share', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
127
128 env = "nt4_dc:local"
129 t = "CLEANUP3"
130 plantestsuite("samba3.smbtorture_s3.plain(%s).%s" % (env, t), env, [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', binpath('smbtorture3'), "", "-l $LOCAL_PATH"])
131
132 local_tests = [
133     "LOCAL-SUBSTITUTE",
134     "LOCAL-GENCACHE",
135     "LOCAL-BASE64",
136     "LOCAL-RBTREE",
137     "LOCAL-MEMCACHE",
138     "LOCAL-STREAM-NAME",
139     "LOCAL-string_to_sid",
140     "LOCAL-sid_to_string",
141     "LOCAL-binary_to_sid",
142     "LOCAL-DBTRANS",
143     "LOCAL-TEVENT-POLL",
144     "LOCAL-CONVERT-STRING",
145     "LOCAL-CONV-AUTH-INFO",
146     "LOCAL-IDMAP-TDB-COMMON",
147     "LOCAL-MESSAGING-READ1",
148     "LOCAL-MESSAGING-READ2",
149     "LOCAL-MESSAGING-READ3",
150     "LOCAL-MESSAGING-READ4",
151     "LOCAL-MESSAGING-FDPASS1",
152     "LOCAL-MESSAGING-FDPASS2",
153     "LOCAL-MESSAGING-FDPASS2a",
154     "LOCAL-MESSAGING-FDPASS2b",
155     "LOCAL-MESSAGING-SEND-ALL",
156     "LOCAL-PTHREADPOOL-TEVENT",
157     "LOCAL-CANONICALIZE-PATH",
158     "LOCAL-DBWRAP-WATCH1",
159     "LOCAL-DBWRAP-WATCH2",
160     "LOCAL-DBWRAP-DO-LOCKED1",
161     "LOCAL-G-LOCK1",
162     "LOCAL-G-LOCK2",
163     "LOCAL-G-LOCK3",
164     "LOCAL-G-LOCK4",
165     "LOCAL-G-LOCK5",
166     "LOCAL-G-LOCK6",
167     "LOCAL-NAMEMAP-CACHE1",
168     "LOCAL-hex_encode_buf",
169     "LOCAL-remove_duplicate_addrs2"]
170
171 for t in local_tests:
172     plantestsuite("samba3.smbtorture_s3.%s" % t, "none", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//foo/bar', '""', '""', smbtorture3, ""])
173
174 plantestsuite("samba.vfstest.stream_depot", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/stream-depot/run.sh"), binpath("vfstest"), "$PREFIX", configuration])
175 plantestsuite("samba.vfstest.xattr-tdb-1", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/xattr-tdb-1/run.sh"), binpath("vfstest"), "$PREFIX", configuration])
176 plantestsuite("samba.vfstest.acl", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/vfstest-acl/run.sh"), binpath("vfstest"), "$PREFIX", configuration])
177 plantestsuite("samba.vfstest.catia", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/vfstest-catia/run.sh"), binpath("vfstest"), "$PREFIX", configuration])
178
179 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"])
180 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"])
181 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"])
182 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"])
183 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"])
184
185 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])
186 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"]:
187     env = "nt4_dc"
188     plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) %s" % (env, options), env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$DC_USERNAME', '$DC_PASSWORD', smbclient3, configuration, options])
189
190 for env in ["nt4_dc", "nt4_member", "ad_member", "ad_dc", "ad_dc_ntvfs", "s4member", "fl2000dc"]:
191     plantestsuite("samba3.blackbox.smbclient_machine_auth.plain (%s:local)" % env, "%s:local" % env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_machine_auth.sh"), '$SERVER', smbclient3, configuration])
192     plantestsuite("samba3.blackbox.smbclient_ntlm.plain (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_ntlm.sh"), '$SERVER', '$DC_USERNAME', '$DC_PASSWORD', "never", smbclient3, configuration])
193
194 for options in ["--option=clientntlmv2auth=no", "--option=clientusespnego=no --option=clientntlmv2auth=no", ""]:
195     for env in ["nt4_member", "ad_member"]:
196         plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) %s" % (env, options), env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$DC_USERNAME', '$DC_PASSWORD', smbclient3, configuration, options])
197         plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) %s member creds" % (env, options), env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$SERVER/$USERNAME', '$PASSWORD', smbclient3, configuration, options])
198
199 env="ad_dc"
200 plantestsuite("samba3.blackbox.smbspool", env, [os.path.join(samba3srcdir, "script/tests/test_smbspool.sh"), '$SERVER', '$SERVER_IP', '$DC_USERNAME', '$DC_PASSWORD', env])
201
202 for env in ["ad_member:local", "nt4_dc:local"]:
203     plantestsuite("samba3.blackbox.smbpasswd", env, [os.path.join(samba3srcdir, "script/tests/test_smbpasswd.sh"), '$SERVER', '$SERVER_IP', '$DC_USERNAME', '$DC_PASSWORD'])
204
205 env="nt4_dc"
206 plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) ipv6" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IPV6', '$SERVER/$USERNAME', '$PASSWORD', smbclient3, configuration])
207
208 for env in ["nt4_member", "ad_member"]:
209     plantestsuite("samba3.blackbox.net_cred_change.(%s:local)" % env, "%s:local" % env, [os.path.join(samba3srcdir, "script/tests/test_net_cred_change.sh"), configuration])
210
211 env = "ad_member"
212 t = "--krb5auth=$DOMAIN/$DC_USERNAME%$DC_PASSWORD"
213 plantestsuite("samba3.wbinfo_simple.(%s:local).%s" % (env, t), "%s:local" % env, [os.path.join(srcdir(), "nsswitch/tests/test_wbinfo_simple.sh"), t])
214 plantestsuite("samba3.wbinfo_name_lookup", env,
215               [ os.path.join(srcdir(),
216                             "nsswitch/tests/test_wbinfo_name_lookup.sh"),
217                 '$DOMAIN', '$REALM', '$DC_USERNAME' ])
218
219 env = "ad_member:local"
220 plantestsuite("samba3.wbinfo_user_info", env,
221               [ os.path.join(srcdir(),
222                             "nsswitch/tests/test_wbinfo_user_info.sh"),
223                 '$DOMAIN', '$REALM', 'alice', 'alice', 'jane', 'jane.doe' ])
224
225 env = "fl2008r2dc:local"
226 plantestsuite("samba3.wbinfo_user_info", env,
227               [ os.path.join(srcdir(),
228                             "nsswitch/tests/test_wbinfo_user_info.sh"),
229                 '$TRUST_DOMAIN', '$TRUST_REALM', 'alice', 'alice', 'jane', 'jane.doe' ])
230
231 env = "ad_member"
232 t = "WBCLIENT-MULTI-PING"
233 plantestsuite("samba3.smbtorture_s3.%s" % t, env, [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//foo/bar', '""', '""', smbtorture3, ""])
234 plantestsuite("samba3.substitutions", env, [os.path.join(samba3srcdir, "script/tests/test_substitutions.sh"), "$SERVER", "alice", "Secret007", "$PREFIX"])
235
236 plantestsuite("samba3.ntlm_auth.krb5 with old ccache(ktest:local)", "ktest:local", [os.path.join(samba3srcdir, "script/tests/test_ntlm_auth_krb5.sh"), valgrindify(python), samba3srcdir, ntlm_auth3, '$PREFIX/ktest/krb5_ccache-2', '$SERVER', configuration])
237
238 plantestsuite("samba3.ntlm_auth.krb5(ktest:local)", "ktest:local", [os.path.join(samba3srcdir, "script/tests/test_ntlm_auth_krb5.sh"), valgrindify(python), samba3srcdir, ntlm_auth3, '$PREFIX/ktest/krb5_ccache-3', '$SERVER', configuration])
239
240
241 for env in ["maptoguest", "simpleserver"]:
242     plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) local creds" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', smbclient3, configuration + " --option=clientntlmv2auth=no --option=clientlanmanauth=yes"])
243
244 env = "maptoguest"
245 plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) bad username" % env, 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"])
246 plantestsuite("samba3.blackbox.smbclient_ntlm.plain (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_ntlm.sh"), '$SERVER', '$USERNAME', '$PASSWORD', "baduser", smbclient3, configuration])
247
248 # plain
249 for env in ["nt4_dc"]:
250     plantestsuite("samba3.blackbox.smbclient_s3.NT1.plain (%s)" % env, 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"])
251     plantestsuite("samba3.blackbox.smbclient_s3.SMB3.plain (%s)" % env, 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"])
252
253 for env in ["nt4_member", "ad_member"]:
254     plantestsuite("samba3.blackbox.smbclient_s3.NT1.plain (%s) member creds" % env, 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"])
255     plantestsuite("samba3.blackbox.smbclient_s3.SMB3.plain (%s) member creds" % env, 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"])
256
257 for env in ["nt4_dc"]:
258     plantestsuite("samba3.blackbox.smbclient_s3.NT1.sign (%s)" % env, 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", "--signing=required"])
259     plantestsuite("samba3.blackbox.smbclient_s3.SMB3.sign (%s)" % env, 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", "--signing=required"])
260
261 for env in ["nt4_member", "ad_member"]:
262     plantestsuite("samba3.blackbox.smbclient_s3.NT1.sign (%s) member creds" % env, 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", "--signing=required"])
263     plantestsuite("samba3.blackbox.smbclient_s3.SMB3.sign (%s) member creds" % env, 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", "--signing=required"])
264
265 for env in ["nt4_dc"]:
266     # encrypted
267     plantestsuite("samba3.blackbox.smbclient_s3.NT1.crypt (%s)" % env, 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", "-e"])
268     plantestsuite("samba3.blackbox.smbclient_s3.SMB3.crypt (%s)" % env, 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", "-e"])
269
270 for env in ["fileserver"]:
271     plantestsuite("samba3.blackbox.preserve_case (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_preserve_case.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3])
272     plantestsuite("samba3.blackbox.dfree_command (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_dfree_command.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3])
273     plantestsuite("samba3.blackbox.dfree_quota (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_dfree_quota.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH', smbclient3, smbcquotas, smbcacls])
274     plantestsuite("samba3.blackbox.valid_users (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_valid_users.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3])
275     plantestsuite("samba3.blackbox.offline (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_offline.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH/offline', smbclient3])
276     plantestsuite("samba3.blackbox.shadow_copy2 NT1 (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_shadow_copy.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH/shadow', smbclient3, '-m', 'NT1'])
277     plantestsuite("samba3.blackbox.shadow_copy2 SMB3 (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_shadow_copy.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH/shadow', smbclient3, '-m', 'SMB3'])
278     plantestsuite("samba3.blackbox.smbclient.forceuser_validusers (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_forceuser_validusers.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH', smbclient3])
279     plantestsuite("samba3.blackbox.smbget (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbget.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', 'smbget_user', '$PASSWORD', '$LOCAL_PATH/smbget', smbget])
280     plantestsuite("samba3.blackbox.netshareenum (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_shareenum.sh"), '$SERVER', '$USERNAME', '$PASSWORD', rpcclient])
281     plantestsuite("samba3.blackbox.acl_xattr.NT1", env, [os.path.join(samba3srcdir, "script/tests/test_acl_xattr.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3, smbcacls, '-mNT1'])
282     plantestsuite("samba3.blackbox.acl_xattr.SMB3", env, [os.path.join(samba3srcdir, "script/tests/test_acl_xattr.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3, smbcacls, '-mSMB3'])
283     plantestsuite("samba3.blackbox.smb2.not_casesensitive (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smb2_not_casesensitive.sh"), '//$SERVER/tmp', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$LOCAL_PATH', smbclient3])
284     plantestsuite("samba3.blackbox.inherit_owner.default.NT1", env, [os.path.join(samba3srcdir, "script/tests/test_inherit_owner.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3, smbcacls, net, 'tmp', '0', '0', '-m', 'NT1'])
285     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'])
286     plantestsuite("samba3.blackbox.inherit_owner.full.NT1", env, [os.path.join(samba3srcdir, "script/tests/test_inherit_owner.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3, smbcacls, net, 'inherit_owner', '1', '1', '-m', 'NT1'])
287     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'])
288     plantestsuite("samba3.blackbox.inherit_owner.unix.NT1", env, [os.path.join(samba3srcdir, "script/tests/test_inherit_owner.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3, smbcacls, net, 'inherit_owner_u', '0', '1', '-m', 'NT1'])
289     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'])
290     plantestsuite("samba3.blackbox.large_acl.NT1", env, [os.path.join(samba3srcdir, "script/tests/test_large_acl.sh"), '$SERVER', '$USERNAME', '$PASSWORD', smbclient3, smbcacls, '-m', 'NT1'])
291     plantestsuite("samba3.blackbox.large_acl.SMB3", env, [os.path.join(samba3srcdir, "script/tests/test_large_acl.sh"), '$SERVER', '$USERNAME', '$PASSWORD', smbclient3, smbcacls, '-m', 'SMB3'])
292     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'])
293
294     #
295     # tar command tests
296     #
297
298     # tar command enabled only if built with libarchive
299     if have_libarchive:
300         # Test smbclient/tarmode
301         plantestsuite("samba3.blackbox.smbclient_tarmode.NT1", env,
302                       [os.path.join(samba3srcdir, "script/tests/test_smbclient_tarmode.sh"),
303                        '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD',
304                        '$LOCAL_PATH/tarmode', '$PREFIX', smbclient3, configuration, "-mNT1"])
305         plantestsuite("samba3.blackbox.smbclient_tarmode.SMB3", env,
306                       [os.path.join(samba3srcdir, "script/tests/test_smbclient_tarmode.sh"),
307                        '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD',
308                        '$LOCAL_PATH/tarmode', '$PREFIX', smbclient3, configuration, "-mSMB3"])
309
310         # Test suite for new smbclient/tar with libarchive (GSoC 13)
311         plantestsuite("samba3.blackbox.smbclient_tar.NT1", env,
312                       [os.path.join(samba3srcdir, "script/tests/test_smbclient_tarmode.pl"),
313                        '-n', '$SERVER', '-i', '$SERVER_IP', '-s', 'tmp',
314                        '-u', '$USERNAME', '-p', '$PASSWORD', '-l', '$LOCAL_PATH/tarmode',
315                        '-d', '$PREFIX', '-b', smbclient3,
316                        '--subunit', '--', configuration, '-mNT1'])
317         plantestsuite("samba3.blackbox.smbclient_tar.SMB3", env,
318                       [os.path.join(samba3srcdir, "script/tests/test_smbclient_tarmode.pl"),
319                        '-n', '$SERVER', '-i', '$SERVER_IP', '-s', 'tmp',
320                        '-u', '$USERNAME', '-p', '$PASSWORD', '-l', '$LOCAL_PATH/tarmode',
321                        '-d', '$PREFIX', '-b', smbclient3,
322                        '--subunit', '--', configuration, '-mSMB3'])
323
324 plantestsuite("samba3.blackbox.net_usershare", "fileserver:local", [os.path.join(samba3srcdir, "script/tests/test_net_usershare.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', smbclient3])
325
326 #TODO encrypted against member, with member creds, and with DC creds
327 plantestsuite("samba3.blackbox.net.misc", "nt4_dc:local",
328               [os.path.join(samba3srcdir, "script/tests/test_net_misc.sh"),
329                scriptdir, "$SMB_CONF_PATH", net, configuration])
330 plantestsuite("samba3.blackbox.net.local.registry", "nt4_dc:local",
331               [os.path.join(samba3srcdir, "script/tests/test_net_registry.sh"),
332                scriptdir, "$SMB_CONF_PATH", net, configuration])
333 plantestsuite("samba3.blackbox.net.registry.check", "nt4_dc:local",
334               [os.path.join(samba3srcdir, "script/tests/test_net_registry_check.sh"),
335                scriptdir, "$SMB_CONF_PATH", net, configuration, dbwrap_tool])
336 plantestsuite("samba3.blackbox.net.rpc.registry", "nt4_dc",
337               [os.path.join(samba3srcdir, "script/tests/test_net_registry.sh"),
338                scriptdir, "$SMB_CONF_PATH", net, configuration, 'rpc'])
339
340 plantestsuite("samba3.blackbox.net.local.registry.roundtrip", "nt4_dc:local",
341               [os.path.join(samba3srcdir, "script/tests/test_net_registry_roundtrip.sh"),
342                scriptdir, "$SMB_CONF_PATH", net, configuration])
343 plantestsuite("samba3.blackbox.net.rpc.registry.roundtrip", "nt4_dc",
344               [os.path.join(samba3srcdir, "script/tests/test_net_registry_roundtrip.sh"),
345                scriptdir, "$SMB_CONF_PATH", net, configuration, 'rpc'])
346
347 plantestsuite("samba3.blackbox.net.local.conf", "nt4_dc:local",
348               [os.path.join(samba3srcdir, "script/tests/test_net_conf.sh"),
349                scriptdir, "$SMB_CONF_PATH", net, configuration])
350 plantestsuite("samba3.blackbox.net.rpc.conf", "nt4_dc",
351               [os.path.join(samba3srcdir, "script/tests/test_net_conf.sh"),
352                scriptdir, "$SMB_CONF_PATH", net, configuration, 'rpc'])
353
354
355 plantestsuite("samba3.blackbox.testparm", "nt4_dc:local",
356               [os.path.join(samba3srcdir, "script/tests/test_testparm_s3.sh"),
357                "$LOCAL_PATH"])
358
359 plantestsuite(
360     "samba3.pthreadpool", "none",
361     [os.path.join(samba3srcdir, "script/tests/test_pthreadpool.sh")])
362
363 if with_pthreadpool and have_ldwrap:
364     plantestsuite("samba3.pthreadpool_cmocka", "none",
365                   [os.path.join(bindir(), "pthreadpooltest_cmocka")])
366
367 plantestsuite("samba3.async_req", "nt4_dc",
368               [os.path.join(samba3srcdir, "script/tests/test_async_req.sh")])
369
370 #smbtorture4 tests
371
372 base = ["base.attr", "base.charset", "base.chkpath", "base.createx_access", "base.defer_open", "base.delaywrite", "base.delete",
373         "base.deny1", "base.deny2", "base.deny3", "base.denydos", "base.dir1", "base.dir2",
374         "base.disconnect", "base.fdpass", "base.lock",
375         "base.mangle", "base.negnowait", "base.ntdeny1",
376         "base.ntdeny2", "base.open", "base.openattr", "base.properties", "base.rename", "base.rw1",
377         "base.secleak", "base.tcon", "base.tcondev", "base.trans2", "base.unlink", "base.vuid",
378         "base.xcopy", "base.samba3error"]
379
380 raw = ["raw.acls", "raw.chkpath", "raw.close", "raw.composite", "raw.context", "raw.eas",
381        "raw.ioctl", "raw.lock", "raw.mkdir", "raw.mux", "raw.notify", "raw.open", "raw.oplock",
382        "raw.qfileinfo", "raw.qfsinfo", "raw.read", "raw.rename", "raw.search", "raw.seek",
383        "raw.sfileinfo.base", "raw.sfileinfo.bug", "raw.streams", "raw.unlink", "raw.write",
384        "raw.samba3hide", "raw.samba3badpath", "raw.sfileinfo.rename", "raw.session",
385        "raw.samba3caseinsensitive", "raw.samba3posixtimedlock",
386        "raw.samba3rootdirfid", "raw.sfileinfo.end-of-file",
387        "raw.bench-oplock", "raw.bench-lock", "raw.bench-open", "raw.bench-tcon",
388        "raw.samba3checkfsp", "raw.samba3closeerr", "raw.samba3oplocklogoff", "raw.samba3badnameblob"]
389
390 smb2 = smbtorture4_testsuites("smb2.")
391
392 rpc = ["rpc.authcontext", "rpc.samba3.bind", "rpc.samba3.srvsvc", "rpc.samba3.sharesec",
393        "rpc.samba3.spoolss", "rpc.samba3.wkssvc", "rpc.samba3.winreg",
394        "rpc.samba3.getaliasmembership-0",
395        "rpc.samba3.netlogon", "rpc.samba3.sessionkey", "rpc.samba3.getusername",
396        "rpc.samba3.smb1-pipe-name", "rpc.samba3.smb2-pipe-name",
397        "rpc.samba3.smb-reauth1", "rpc.samba3.smb-reauth2",
398        "rpc.svcctl", "rpc.ntsvcs", "rpc.winreg", "rpc.eventlog",
399        "rpc.spoolss.printserver", "rpc.spoolss.win", "rpc.spoolss.notify", "rpc.spoolss.printer",
400        "rpc.spoolss.driver",
401        "rpc.lsa", "rpc.lsa-getuser", "rpc.lsa.lookupsids", "rpc.lsa.lookupnames",
402        "rpc.lsa.privileges", "rpc.lsa.secrets",
403        "rpc.samr", "rpc.samr.users", "rpc.samr.users.privileges", "rpc.samr.passwords",
404        "rpc.samr.passwords.pwdlastset", "rpc.samr.passwords.lockout", "rpc.samr.passwords.badpwdcount", "rpc.samr.large-dc", "rpc.samr.machine.auth",
405        "rpc.samr.priv", "rpc.samr.passwords.validate",
406        "rpc.netlogon.admin",
407        "rpc.schannel", "rpc.schannel2", "rpc.bench-schannel1", "rpc.schannel_anon_setpw", "rpc.join", "rpc.bind"]
408
409 local = ["local.nss"]
410
411 idmap = ["idmap.rfc2307", "idmap.alloc", "idmap.rid", "idmap.ad"]
412
413 rap = ["rap.basic", "rap.rpc", "rap.printing", "rap.sam"]
414
415 unix = ["unix.info2", "unix.whoami"]
416
417 nbt = ["nbt.dgram" ]
418
419 libsmbclient = ["libsmbclient"]
420
421 vfs = ["vfs.fruit", "vfs.acl_xattr", "vfs.fruit_netatalk", "vfs.fruit_file_id", "vfs.fruit_timemachine"]
422
423 tests= base + raw + smb2 + rpc + unix + local + rap + nbt + libsmbclient + idmap + vfs
424
425 for t in tests:
426     if t == "base.delaywrite" or t == "base.deny1" or t == "base.deny2":
427         plansmbtorture4testsuite(t, "fileserver", '//$SERVER/tmp -U$USERNAME%$PASSWORD --maximum-runtime=900')
428     elif t == "base.createx_access":
429         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD -k yes --maximum-runtime=900')
430     elif t == "rap.sam":
431         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --option=doscharset=ISO-8859-1')
432         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --option=doscharset=ISO-8859-1')
433     elif t == "winbind.pac":
434         plansmbtorture4testsuite(t, "ad_member:local", '//$SERVER/tmp --realm=$REALM --machine-pass --option=torture:addc=$DC_SERVER', description="machine account")
435     elif t == "unix.whoami":
436         plansmbtorture4testsuite(t, "nt4_member:local", '//$SERVER/tmp --machine-pass', description="machine account")
437         plansmbtorture4testsuite(t, "ad_member:local", '//$SERVER/tmp --machine-pass --option=torture:addc=$DC_SERVER', description="machine account")
438         for env in ["nt4_dc", "nt4_member"]:
439             plansmbtorture4testsuite(t, env, '//$SERVER/tmp -U$DC_USERNAME%$DC_PASSWORD')
440             plansmbtorture4testsuite(t, env, '//$SERVER/tmpguest -U%', description='anonymous connection')
441         for env in ["ad_dc", "ad_member"]:
442             plansmbtorture4testsuite(t, env, '//$SERVER/tmp -U$DC_USERNAME@$REALM%$DC_PASSWORD --option=torture:addc=$DC_SERVER')
443             plansmbtorture4testsuite(t, env, '//$SERVER/tmp -k yes -U$DC_USERNAME@$REALM%$DC_PASSWORD --option=torture:addc=$DC_SERVER', description='kerberos connection')
444             plansmbtorture4testsuite(t, env, '//$SERVER/tmpguest -U% --option=torture:addc=$DC_SERVER', description='anonymous connection')
445             plansmbtorture4testsuite(t, env, '//$SERVER/tmp -k no -U$DC_USERNAME@$REALM%$DC_PASSWORD', description='ntlm user@realm')
446     elif t == "raw.samba3posixtimedlock":
447         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmpguest -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share')
448         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER_IP/tmpguest -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/ad_dc/share')
449     elif t == "raw.chkpath":
450         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmpcase -U$USERNAME%$PASSWORD')
451         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER_IP/tmpcase -U$USERNAME%$PASSWORD')
452     elif t == "raw.samba3hide" or t == "raw.samba3checkfsp" or t ==  "raw.samba3closeerr":
453         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
454         plansmbtorture4testsuite(t, "simpleserver", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
455         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
456     elif t == "raw.session" or t == "smb2.session":
457         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD', 'plain')
458         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmpenc -U$USERNAME%$PASSWORD', 'enc')
459         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -k no -U$USERNAME%$PASSWORD', 'ntlm')
460         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -k yes -U$USERNAME%$PASSWORD', 'krb5')
461     elif t == "rpc.lsa":
462         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD', 'over ncacn_np ')
463         plansmbtorture4testsuite(t, "nt4_dc", 'ncacn_ip_tcp:$SERVER_IP -U$USERNAME%$PASSWORD', 'over ncacn_ip_tcp ')
464         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD', 'over ncacn_np ')
465         plansmbtorture4testsuite(t, "ad_dc", 'ncacn_ip_tcp:$SERVER_IP -U$USERNAME%$PASSWORD', 'over ncacn_ip_tcp ')
466     elif t == "rpc.samr.passwords.validate":
467         plansmbtorture4testsuite(t, "nt4_dc", 'ncacn_ip_tcp:$SERVER_IP[seal] -U$USERNAME%$PASSWORD', 'over ncacn_ip_tcp ')
468         plansmbtorture4testsuite(t, "ad_dc", 'ncacn_ip_tcp:$SERVER_IP[seal] -U$USERNAME%$PASSWORD', 'over ncacn_ip_tcp ')
469     elif t == "smb2.durable-open" or t == "smb2.durable-v2-open" or t == "smb2.replay":
470         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/durable -U$USERNAME%$PASSWORD')
471         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER_IP/durable -U$USERNAME%$PASSWORD')
472     elif t == "base.rw1":
473         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
474         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/valid-users-tmp -U$USERNAME%$PASSWORD')
475         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/write-list-tmp -U$USERNAME%$PASSWORD')
476         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
477     elif t == "idmap.rfc2307":
478         plantestsuite(t, "ad_member_rfc2307",
479                       [os.path.join(samba3srcdir,
480                                     "../nsswitch/tests/test_idmap_rfc2307.sh"),
481                        '$DOMAIN',
482                        'Administrator', '2000000',
483                        'Guest', '2000001',
484                        '"Domain Users"', '2000002',
485                        'DnsAdmins', '2000003',
486                        '2000005', '35',
487                        'ou=idmap,dc=samba,dc=example,dc=com',
488                        '$DC_SERVER', '$DC_USERNAME', '$DC_PASSWORD'])
489     elif t == "idmap.alloc":
490         plantestsuite(t, "ad_member_rfc2307", [os.path.join(samba3srcdir, "../nsswitch/tests/test_idmap_nss.sh"), '$DOMAIN'])
491     elif t == "idmap.rid":
492         plantestsuite(t, "ad_member_idmap_rid", [os.path.join(samba3srcdir, "../nsswitch/tests/test_idmap_rid.sh"), '$DOMAIN', '2000000'])
493     elif t == "idmap.ad":
494         plantestsuite(t, "ad_member_idmap_ad", [os.path.join(samba3srcdir, "../nsswitch/tests/test_idmap_ad.sh"), '$DOMAIN', '$DC_SERVER', '$DC_PASSWORD'])
495     elif t == "raw.acls":
496         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
497         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/nfs4acl_simple_40 -U$USERNAME%$PASSWORD', description='nfs4acl_xattr-simple-40')
498         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/nfs4acl_special_40 -U$USERNAME%$PASSWORD', description='nfs4acl_xattr-special-40')
499         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/nfs4acl_simple_41 -U$USERNAME%$PASSWORD', description='nfs4acl_xattr-simple-41')
500         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/nfs4acl_xdr_40 -U$USERNAME%$PASSWORD', description='nfs4acl_xattr-xdr-40')
501         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/nfs4acl_xdr_41 -U$USERNAME%$PASSWORD', description='nfs4acl_xattr-xdr-41')
502         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER_IP/tmpcase -U$USERNAME%$PASSWORD')
503     elif t == "smb2.ioctl":
504         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/fs_specific -U$USERNAME%$PASSWORD', 'fs_specific')
505         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
506         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
507     elif t == "smb2.lock":
508         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/aio -U$USERNAME%$PASSWORD', 'aio')
509         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
510     elif t == "raw.lock" or t == "base.lock":
511         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
512     elif t == "raw.read":
513         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
514         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/aio -U$USERNAME%$PASSWORD', 'aio')
515         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
516     elif t == "raw.search":
517         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
518 # test the dirsort module.
519         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmpsort -U$USERNAME%$PASSWORD')
520         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
521     elif t == "vfs.fruit":
522         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')
523         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')
524         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')
525     elif t == "vfs.fruit_netatalk":
526         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit_xattr -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share')
527     elif t == "vfs.fruit_timemachine":
528         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit_timemachine -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share')
529     elif t == "vfs.fruit_file_id":
530         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit -U$USERNAME%$PASSWORD')
531     elif t == "rpc.schannel_anon_setpw":
532         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$%', description="anonymous password set")
533         plansmbtorture4testsuite(t, "nt4_dc_schannel", '//$SERVER_IP/tmp -U$%', description="anonymous password set (schannel enforced server-side)")
534         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$%', description="anonymous password set")
535     elif t == "local.nss":
536         for env in ["nt4_dc:local", "ad_member:local", "nt4_member:local", "ad_dc:local"]:
537             plansmbtorture4testsuite(t, env, '//$SERVER/tmp -U$USERNAME%$PASSWORD')
538     elif t == "smb2.change_notify_disabled":
539         plansmbtorture4testsuite(t, "simpleserver", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
540     elif t == "smb2.notify" or t == "raw.notify" or t == "smb2.oplock" or t == "raw.oplock":
541         # These tests are a little slower so don't duplicate them with ad_dc
542         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --signing=required')
543     elif t == "smb2.dosmode":
544         plansmbtorture4testsuite(t, "simpleserver", '//$SERVER/dosmode -U$USERNAME%$PASSWORD')
545     elif t == "smb2.kernel-oplocks":
546         if have_linux_kernel_oplocks:
547             plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER/kernel_oplocks -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share')
548     elif t == "smb2.notify-inotify":
549         if have_inotify:
550             plansmbtorture4testsuite(t, "fileserver", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
551     elif t == "vfs.acl_xattr":
552         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
553     elif t == "smb2.compound_find":
554         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER/compound_find -U$USERNAME%$PASSWORD')
555         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
556         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
557     elif t == "rpc.samr.users.privileges":
558         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --option=torture:nt4_dc=true')
559         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
560     elif t == "smb2.compound":
561         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
562         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/aio -U$USERNAME%$PASSWORD', 'aio')
563         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
564     elif t == "rpc.samba3.netlogon" or t == "rpc.samba3.sessionkey":
565         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --option=torture:wksname=samba3rpctest')
566         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD --option=torture:wksname=samba3rpctest')
567     elif t == "libsmbclient":
568         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%%$PASSWORD '
569                                     '--option=torture:smburl=smb://$USERNAME:$PASSWORD@$SERVER/tmp '
570                                     '--option=torture:replace_smbconf=%s' % os.path.join(srcdir(), "testdata/samba3/smb_new.conf"))
571         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%%$PASSWORD '
572                                     '--option=torture:smburl=smb://$USERNAME:$PASSWORD@$SERVER/tmp '
573                                     '--option=torture:replace_smbconf=%s' % os.path.join(srcdir(), "testdata/samba3/smb_new.conf"))
574     else:
575         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
576         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
577
578
579 test = 'rpc.lsa.lookupsids'
580 auth_options = ["", "ntlm", "spnego", "spnego,ntlm" ]
581 signseal_options = ["", ",connect", ",packet", ",sign", ",seal"]
582 endianness_options = ["", ",bigendian"]
583 for s in signseal_options:
584     for e in endianness_options:
585         for a in auth_options:
586             binding_string = "ncacn_np:$SERVER[%s%s%s]" % (a, s, e)
587             options = binding_string + " -U$USERNAME%$PASSWORD"
588             plansmbtorture4testsuite(test, "nt4_dc", options, 'over ncacn_np with [%s%s%s] ' % (a, s, e))
589             plantestsuite("samba3.blackbox.rpcclient over ncacn_np with [%s%s%s] " % (a, s, e), "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/test_rpcclient.sh"),
590                                                              "none", options, configuration])
591
592     # We should try more combinations in future, but this is all
593     # the pre-calculated credentials cache supports at the moment
594     #
595     # As the ktest env requires SMB3_00 we need to use "smb2" until
596     # dcerpc client code in smbtorture support autonegotiation
597     # of any smb dialect.
598     e = ""
599     a = "smb2"
600     binding_string = "ncacn_np:$SERVER[%s%s%s]" % (a, s, e)
601     options = binding_string + " -k yes --krb5-ccache=$PREFIX/ktest/krb5_ccache-2"
602     plansmbtorture4testsuite(test, "ktest", options, 'krb5 with old ccache ncacn_np with [%s%s%s] ' % (a, s, e))
603
604     options = binding_string + " -k yes --krb5-ccache=$PREFIX/ktest/krb5_ccache-3"
605     plansmbtorture4testsuite(test, "ktest", options, 'krb5 ncacn_np with [%s%s%s] ' % (a, s, e))
606
607     auth_options2 = ["krb5", "spnego,krb5"]
608     for a in auth_options2:
609         binding_string = "ncacn_np:$SERVER[%s%s%s]" % (a, s, e)
610
611         plantestsuite("samba3.blackbox.rpcclient krb5 ncacn_np with [%s%s%s] " % (a, s, e), "ktest:local", [os.path.join(samba3srcdir, "script/tests/test_rpcclient.sh"),
612                                                                                                                               "$PREFIX/ktest/krb5_ccache-3", binding_string, "-k", configuration])
613
614 plantestsuite("samba3.blackbox.rpcclient_samlogon", "ad_member:local", [os.path.join(samba3srcdir, "script/tests/test_rpcclient_samlogon.sh"),
615                                                                        "$DC_USERNAME", "$DC_PASSWORD", "ncacn_np:$DC_SERVER", configuration])
616 plantestsuite("samba3.blackbox.sharesec", "simpleserver:local",
617               [os.path.join(samba3srcdir, "script/tests/test_sharesec.sh"),
618                configuration, os.path.join(bindir(), "sharesec"), "tmp"])
619
620 plantestsuite("samba3.blackbox.net_tdb", "simpleserver:local",
621               [ os.path.join(samba3srcdir, "script/tests/test_net_tdb.sh"),
622                 smbclient3, '$SERVER', 'tmp', '$USERNAME', '$PASSWORD',
623                 configuration, '$LOCAL_PATH', '$LOCK_DIR' ])
624
625 plantestsuite("samba3.blackbox.smbd_error", "simpleserver:local",
626               [ os.path.join(samba3srcdir, "script/tests/test_smbd_error.sh") ])
627
628 plantestsuite("samba3.blackbox.net_cache_samlogon", "ad_member:local",
629               [ os.path.join(samba3srcdir, "script/tests/test_net_cache_samlogon.sh"),
630                 '$SERVER', 'tmp', '$DC_USERNAME', '$DC_PASSWORD'])
631
632 plantestsuite("samba3.blackbox.net_dom_join_fail_dc", "nt4_dc",
633               [os.path.join(samba3srcdir, "script/tests/test_net_dom_join_fail_dc.sh"),
634                "$USERNAME", "$PASSWORD", "$SERVER", "$PREFIX/net_dom_join_fail_dc",
635                configuration])
636 plantestsuite("samba3.blackbox.net_rpc_join", "nt4_dc",
637               [os.path.join(samba3srcdir, "script/tests/test_net_rpc_join.sh"),
638                "$USERNAME", "$PASSWORD", "$SERVER", "$PREFIX/net_rpc_join",
639                configuration])
640 plantestsuite("samba3.blackbox.net_rpc_oldjoin", "nt4_dc:local",
641               [os.path.join(samba3srcdir, "script/tests/test_net_rpc_oldjoin.sh"),
642                "$SERVER", "$PREFIX/net_rpc_oldjoin",
643                "$SMB_CONF_PATH"])
644
645 plantestsuite("samba3.blackbox.rpcclient_srvsvc", "simpleserver",
646               [os.path.join(samba3srcdir, "script/tests/test_rpcclientsrvsvc.sh"),
647                "$USERNAME", "$PASSWORD", "$SERVER",
648                os.path.join(bindir(), "rpcclient"), "tmp"])
649
650 plantestsuite("samba3.blackbox.rpcclient.pw-nt-hash", "simpleserver",
651               [os.path.join(samba3srcdir, "script/tests/test_rpcclient_pw_nt_hash.sh"),
652                "$USERNAME", "$PASSWORD", "$SERVER",
653                os.path.join(bindir(), "rpcclient")])
654
655 plantestsuite("samba3.blackbox.smbclient.encryption_off", "simpleserver",
656               [os.path.join(samba3srcdir, "script/tests/test_smbclient_encryption_off.sh"),
657                "$USERNAME", "$PASSWORD", "$SERVER",
658                smbclient3])
659
660 plantestsuite("samba3.blackbox.rpcclient_netsessenum", "ad_member",
661               [os.path.join(samba3srcdir,
662                             "script/tests/test_rpcclient_netsessenum.sh"),
663                "$DOMAIN", "$DC_USERNAME", "$DC_PASSWORD", "$SERVER",
664                os.path.join(bindir(), "rpcclient"), smbtorture3, "tmp"])
665
666 # The ktest environment uses:
667 # server min protocol = SMB3_00
668 # client max protocol = SMB3
669 options_list = ["", "-e"]
670 for options in options_list:
671     plantestsuite("samba3.blackbox.smbclient_krb5 old ccache %s" % options, "ktest:local",
672                   [os.path.join(samba3srcdir, "script/tests/test_smbclient_krb5.sh"),
673                    "$PREFIX/ktest/krb5_ccache-2",
674                    smbclient3, "$SERVER", options, configuration])
675
676     plantestsuite("samba3.blackbox.smbclient_krb5 new ccache %s" % options, "ktest:local",
677                   [os.path.join(samba3srcdir, "script/tests/test_smbclient_krb5.sh"),
678                    "$PREFIX/ktest/krb5_ccache-3",
679                    smbclient3, "$SERVER", options, configuration])
680
681     plantestsuite("samba3.blackbox.smbclient_large_file %s krb5" % options, "ktest:local",
682                   [os.path.join(samba3srcdir, "script/tests/test_smbclient_large_file.sh"),
683                    "$PREFIX/ktest/krb5_ccache-3",
684                    smbclient3, "$SERVER", "$PREFIX", options, "-k " + configuration])
685
686 options_list = ["-mNT1", "-mNT1 -e", "-mSMB3", "-mSMB3 -e"]
687 for options in options_list:
688     plantestsuite("samba3.blackbox.smbclient_large_file %s NTLM" % options, "nt4_dc:local",
689                   [os.path.join(samba3srcdir, "script/tests/test_smbclient_large_file.sh"),
690                    "none",
691                    smbclient3, "$SERVER", "$PREFIX", options, "-U$USERNAME%$PASSWORD " + configuration])
692
693 for alias in ["foo", "bar"]:
694     plantestsuite("samba3.blackbox.smbclient_netbios_aliases [%s]" % alias, "ad_member:local",
695                   [os.path.join(samba3srcdir, "script/tests/test_smbclient_netbios_aliases.sh"),
696                    smbclient3, alias, "$DC_USERNAME", "$DC_PASSWORD", "$PREFIX", options, configuration])
697
698 for e in endianness_options:
699     for a in auth_options:
700         for s in signseal_options:
701             binding_string = "ncacn_ip_tcp:$SERVER_IP[%s%s%s]" % (a, s, e)
702             options = binding_string + " -U$USERNAME%$PASSWORD"
703             plansmbtorture4testsuite(test, "nt4_dc", options, 'over ncacn_ip_tcp with [%s%s%s] ' % (a, s, e))
704
705 plansmbtorture4testsuite('rpc.epmapper', 'nt4_dc:local', 'ncalrpc: -U$USERNAME%$PASSWORD', 'over ncalrpc')
706 plansmbtorture4testsuite('rpc.fsrvp', 'nt4_dc:local', 'ncacn_np:$SERVER_IP[/pipe/FssagentRpc] -U$USERNAME%$PASSWORD', 'over ncacn_np')