CVE-2015-7560: s3: torture3: Add new POSIX-SYMLINK-ACL test.
[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
40 plantestsuite("samba3.blackbox.success", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/test_success.sh")])
41 plantestsuite("samba3.blackbox.failure", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/test_failure.sh")])
42
43 plantestsuite("samba3.local_s3", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/test_local_s3.sh")])
44
45 plantestsuite("samba3.blackbox.registry.upgrade", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/test_registry_upgrade.sh"), net, dbwrap_tool])
46
47 tests = ["FDPASS", "LOCK1", "LOCK2", "LOCK3", "LOCK4", "LOCK5", "LOCK6", "LOCK7", "LOCK9",
48         "UNLINK", "BROWSE", "ATTR", "TRANS2", "TORTURE",
49         "OPLOCK1", "OPLOCK2", "OPLOCK4", "STREAMERROR",
50         "DIR", "DIR1", "DIR-CREATETIME", "TCON", "TCONDEV", "RW1", "RW2", "RW3", "LARGE_READX", "RW-SIGNING",
51         "OPEN", "XCOPY", "RENAME", "DELETE", "DELETE-LN", "WILDDELETE", "PROPERTIES", "W2K",
52         "TCON2", "IOCTL", "CHKPATH", "FDSESS", "CHAIN1", "CHAIN2",
53         "CHAIN3",
54         "GETADDRINFO", "UID-REGRESSION-TEST", "SHORTNAME-TEST",
55         "CASE-INSENSITIVE-CREATE", "SMB2-BASIC", "NTTRANS-FSCTL", "SMB2-NEGPROT",
56         "SMB2-SESSION-REAUTH", "SMB2-SESSION-RECONNECT",
57         "CLEANUP1",
58         "CLEANUP2",
59         "CLEANUP4",
60         "BAD-NBT-SESSION"]
61
62 for t in tests:
63     plantestsuite("samba3.smbtorture_s3.plain(s3dc).%s" % t, "s3dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
64     plantestsuite("samba3.smbtorture_s3.crypt_client(s3dc).%s" % t, "s3dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', smbtorture3, "-e", "-l $LOCAL_PATH"])
65     if t == "TORTURE":
66         # this is a negative test to verify that the server rejects
67         # access without encryption
68         plantestsuite("samba3.smbtorture_s3.crypt_server(s3dc).%s" % t, "s3dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmpenc', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
69     plantestsuite("samba3.smbtorture_s3.plain(dc).%s" % t, "dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
70
71 # non-crypt only
72
73 tests = ["OPLOCK-CANCEL"]
74 for t in tests:
75     plantestsuite("samba3.smbtorture_s3.plain(s3dc).%s" % t, "s3dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
76
77 tests = ["RW1", "RW2", "RW3"]
78 for t in tests:
79     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"])
80
81 posix_tests = ["POSIX", "POSIX-APPEND", "POSIX-SYMLINK-ACL"]
82
83 for t in posix_tests:
84     plantestsuite("samba3.smbtorture_s3.plain(s3dc).%s" % t, "s3dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/posix_share', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
85     plantestsuite("samba3.smbtorture_s3.crypt(s3dc).%s" % t, "s3dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/posix_share', '$USERNAME', '$PASSWORD', smbtorture3, "-e", "-l $LOCAL_PATH"])
86     plantestsuite("samba3.smbtorture_s3.plain(dc).%s" % t, "dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/posix_share', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
87
88 env = "s3dc:local"
89 t = "CLEANUP3"
90 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"])
91
92 local_tests = [
93     "LOCAL-SUBSTITUTE",
94     "LOCAL-GENCACHE",
95     "LOCAL-TALLOC-DICT",
96     "LOCAL-BASE64",
97     "LOCAL-RBTREE",
98     "LOCAL-MEMCACHE",
99     "LOCAL-STREAM-NAME",
100     "LOCAL-WBCLIENT",
101     "LOCAL-string_to_sid",
102     "LOCAL-sid_to_string",
103     "LOCAL-binary_to_sid",
104     "LOCAL-DBTRANS",
105     "LOCAL-TEVENT-SELECT",
106     "LOCAL-CONVERT-STRING",
107     "LOCAL-CONV-AUTH-INFO",
108     "LOCAL-IDMAP-TDB-COMMON",
109     "LOCAL-MESSAGING-READ1",
110     "LOCAL-MESSAGING-READ2",
111     "LOCAL-MESSAGING-READ3",
112     "LOCAL-MESSAGING-READ4",
113     "LOCAL-MESSAGING-FDPASS1",
114     "LOCAL-MESSAGING-FDPASS2",
115     "LOCAL-hex_encode_buf",
116     "LOCAL-sprintf_append",
117     "LOCAL-remove_duplicate_addrs2"]
118
119 for t in local_tests:
120     plantestsuite("samba3.smbtorture_s3.%s" % t, "none", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//foo/bar', '""', '""', smbtorture3, ""])
121
122 plantestsuite("samba.vfstest.stream_depot", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/stream-depot/run.sh"), binpath("vfstest"), "$PREFIX", configuration])
123 plantestsuite("samba.vfstest.xattr-tdb-1", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/xattr-tdb-1/run.sh"), binpath("vfstest"), "$PREFIX", configuration])
124 plantestsuite("samba.vfstest.acl", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/vfstest-acl/run.sh"), binpath("vfstest"), "$PREFIX", configuration])
125 plantestsuite("samba.vfstest.catia", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/vfstest-catia/run.sh"), binpath("vfstest"), "$PREFIX", configuration])
126
127 for options in ["--option=clientusespnego=no", " --option=clientntlmv2auth=no --option=clientlanmanauth=yes --max-protocol=LANMAN2", ""]:
128     env = "s3dc"
129     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])
130
131 for env in ["s3dc", "member", "s3member", "dc", "s4member"]:
132     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])
133
134 for env in ["s3dc", "member", "s3member"]:
135     plantestsuite("samba3.blackbox.smbclient_auth.plain (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$DC_USERNAME', '$DC_PASSWORD', smbclient3, configuration])
136     plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) member creds" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$SERVER/$USERNAME', '$PASSWORD', smbclient3, configuration])
137
138 for env in ["member", "s3member"]:
139     plantestsuite("samba3.blackbox.net_cred_change.(%s:local)" % env, "%s:local" % env, [os.path.join(samba3srcdir, "script/tests/test_net_cred_change.sh"), configuration])
140
141 env = "s3member"
142 t = "--krb5auth=$DOMAIN/$DC_USERNAME%$DC_PASSWORD"
143 plantestsuite("samba3.wbinfo_simple.(%s:local).%s" % (env, t), "%s:local" % env, [os.path.join(srcdir(), "nsswitch/tests/test_wbinfo_simple.sh"), t])
144
145 plantestsuite("samba3.ntlm_auth.krb5(ktest:local) old ccache", "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])
146
147 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])
148
149
150 for env in ["maptoguest", "simpleserver"]:
151     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"])
152
153 env = "maptoguest"
154 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"])
155
156 # plain
157 for env in ["s3dc"]:
158     plantestsuite("samba3.blackbox.smbclient_s3.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])
159
160 for env in ["member", "s3member"]:
161     plantestsuite("samba3.blackbox.smbclient_s3.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])
162
163 for env in ["s3dc"]:
164     plantestsuite("samba3.blackbox.smbclient_s3.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, "--signing=required"])
165
166 for env in ["member", "s3member"]:
167     plantestsuite("samba3.blackbox.smbclient_s3.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, "--signing=required"])
168
169 for env in ["s3dc"]:
170     # encrypted
171     plantestsuite("samba3.blackbox.smbclient_s3.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, "-e"])
172
173
174     #
175     # tar command tests
176     #
177
178     # find config.h
179     try:
180         config_h = os.environ["CONFIG_H"]
181     except KeyError:
182         config_h = os.path.join(samba4bindir, "default/include/config.h")
183
184     # see if libarchive is supported
185     f = open(config_h, 'r')
186     try:
187         have_libarchive = ("HAVE_LIBARCHIVE 1" in f.read())
188     finally:
189         f.close()
190
191     # tar command enabled only if built with libarchive
192     if have_libarchive:
193         # Test smbclient/tarmode
194         plantestsuite("samba3.blackbox.smbclient_tarmode (%s)" % env, env,
195                       [os.path.join(samba3srcdir, "script/tests/test_smbclient_tarmode.sh"),
196                        '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD',
197                        '$LOCAL_PATH', '$PREFIX', smbclient3, configuration])
198
199         # Test suite for new smbclient/tar with libarchive (GSoC 13)
200         plantestsuite("samba3.blackbox.smbclient_tar (%s)" % env, env,
201                       [os.path.join(samba3srcdir, "script/tests/test_smbclient_tarmode.pl"),
202                        '-n', '$SERVER', '-i', '$SERVER_IP', '-s', 'tmp',
203                        '-u', '$USERNAME', '-p', '$PASSWORD', '-l', '$LOCAL_PATH',
204                        '-d', '$PREFIX', '-b', smbclient3,
205                        '--subunit', '--', configuration])
206
207 #TODO encrypted against member, with member creds, and with DC creds
208 plantestsuite("samba3.blackbox.net.misc", "s3dc:local",
209               [os.path.join(samba3srcdir, "script/tests/test_net_misc.sh"),
210                scriptdir, "$SMB_CONF_PATH", net, configuration])
211 plantestsuite("samba3.blackbox.net.local.registry", "s3dc:local",
212               [os.path.join(samba3srcdir, "script/tests/test_net_registry.sh"),
213                scriptdir, "$SMB_CONF_PATH", net, configuration])
214 plantestsuite("samba3.blackbox.net.registry.check", "s3dc:local",
215               [os.path.join(samba3srcdir, "script/tests/test_net_registry_check.sh"),
216                scriptdir, "$SMB_CONF_PATH", net, configuration, dbwrap_tool])
217 plantestsuite("samba3.blackbox.net.rpc.registry", "s3dc",
218               [os.path.join(samba3srcdir, "script/tests/test_net_registry.sh"),
219                scriptdir, "$SMB_CONF_PATH", net, configuration, 'rpc'])
220
221 plantestsuite("samba3.blackbox.net.local.registry.roundtrip", "s3dc:local",
222               [os.path.join(samba3srcdir, "script/tests/test_net_registry_roundtrip.sh"),
223                scriptdir, "$SMB_CONF_PATH", net, configuration])
224 plantestsuite("samba3.blackbox.net.rpc.registry.roundtrip", "s3dc",
225               [os.path.join(samba3srcdir, "script/tests/test_net_registry_roundtrip.sh"),
226                scriptdir, "$SMB_CONF_PATH", net, configuration, 'rpc'])
227
228 plantestsuite("samba3.blackbox.net.local.conf", "s3dc:local",
229               [os.path.join(samba3srcdir, "script/tests/test_net_conf.sh"),
230                scriptdir, "$SMB_CONF_PATH", net, configuration])
231 plantestsuite("samba3.blackbox.net.rpc.conf", "s3dc",
232               [os.path.join(samba3srcdir, "script/tests/test_net_conf.sh"),
233                scriptdir, "$SMB_CONF_PATH", net, configuration, 'rpc'])
234
235
236 plantestsuite("samba3.blackbox.testparm", "s3dc:local",
237               [os.path.join(samba3srcdir, "script/tests/test_testparm_s3.sh"),
238                "$LOCAL_PATH"])
239
240 plantestsuite(
241     "samba3.pthreadpool", "s3dc",
242     [os.path.join(samba3srcdir, "script/tests/test_pthreadpool.sh")])
243
244 plantestsuite("samba3.async_req", "nt4_dc",
245               [os.path.join(samba3srcdir, "script/tests/test_async_req.sh")])
246
247 #smbtorture4 tests
248
249 base = ["base.attr", "base.charset", "base.chkpath", "base.defer_open", "base.delaywrite", "base.delete",
250         "base.deny1", "base.deny2", "base.deny3", "base.denydos", "base.dir1", "base.dir2",
251         "base.disconnect", "base.fdpass", "base.lock",
252         "base.mangle", "base.negnowait", "base.ntdeny1",
253         "base.ntdeny2", "base.open", "base.openattr", "base.properties", "base.rename", "base.rw1",
254         "base.secleak", "base.tcon", "base.tcondev", "base.trans2", "base.unlink", "base.vuid",
255         "base.xcopy", "base.samba3error"]
256
257 raw = ["raw.acls", "raw.chkpath", "raw.close", "raw.composite", "raw.context", "raw.eas",
258        "raw.ioctl", "raw.lock", "raw.mkdir", "raw.mux", "raw.notify", "raw.open", "raw.oplock",
259        "raw.qfileinfo", "raw.qfsinfo", "raw.read", "raw.rename", "raw.search", "raw.seek",
260        "raw.sfileinfo.base", "raw.sfileinfo.bug", "raw.streams", "raw.unlink", "raw.write",
261        "raw.samba3hide", "raw.samba3badpath", "raw.sfileinfo.rename", "raw.session",
262        "raw.samba3caseinsensitive", "raw.samba3posixtimedlock",
263        "raw.samba3rootdirfid", "raw.sfileinfo.end-of-file",
264        "raw.bench-oplock", "raw.bench-lock", "raw.bench-open", "raw.bench-tcon",
265        "raw.samba3checkfsp", "raw.samba3closeerr", "raw.samba3oplocklogoff", "raw.samba3badnameblob"]
266
267 smb2 = smbtorture4_testsuites("smb2.")
268
269 rpc = ["rpc.authcontext", "rpc.samba3.bind", "rpc.samba3.srvsvc", "rpc.samba3.sharesec",
270        "rpc.samba3.spoolss", "rpc.samba3.wkssvc", "rpc.samba3.winreg",
271        "rpc.samba3.getaliasmembership-0",
272        "rpc.samba3.netlogon", "rpc.samba3.sessionkey", "rpc.samba3.getusername",
273        "rpc.samba3.smb1-pipe-name", "rpc.samba3.smb2-pipe-name",
274        "rpc.samba3.smb-reauth1", "rpc.samba3.smb-reauth2",
275        "rpc.svcctl", "rpc.ntsvcs", "rpc.winreg", "rpc.eventlog",
276        "rpc.spoolss.printserver", "rpc.spoolss.win", "rpc.spoolss.notify", "rpc.spoolss.printer",
277        "rpc.spoolss.driver",
278        "rpc.lsa", "rpc.lsa-getuser", "rpc.lsa.lookupsids", "rpc.lsa.lookupnames",
279        "rpc.lsa.privileges", "rpc.lsa.secrets",
280        "rpc.samr", "rpc.samr.users", "rpc.samr.users.privileges", "rpc.samr.passwords",
281        "rpc.samr.passwords.pwdlastset", "rpc.samr.passwords.lockout", "rpc.samr.passwords.badpwdcount", "rpc.samr.large-dc", "rpc.samr.machine.auth",
282        "rpc.samr.priv", "rpc.samr.passwords.validate",
283        "rpc.netlogon.admin",
284        "rpc.schannel", "rpc.schannel2", "rpc.bench-schannel1", "rpc.join", "rpc.bind"]
285
286 local = ["local.ndr"]
287
288 idmap = [ "idmap.rfc2307" ]
289
290 rap = ["rap.basic", "rap.rpc", "rap.printing", "rap.sam"]
291
292 unix = ["unix.info2", "unix.whoami"]
293
294 nbt = ["nbt.dgram" ]
295
296 libsmbclient = ["libsmbclient"]
297
298 vfs = ["vfs.fruit"]
299
300 tests= base + raw + smb2 + rpc + unix + local + rap + nbt + libsmbclient + idmap + vfs
301
302 for t in tests:
303     if t == "base.delaywrite":
304         plansmbtorture4testsuite(t, "plugin_s4_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD -k yes --maximum-runtime=900')
305     elif t == "rap.sam":
306         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --option=doscharset=ISO-8859-1')
307         plansmbtorture4testsuite(t, "plugin_s4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --option=doscharset=ISO-8859-1')
308     elif t == "winbind.pac":
309         plansmbtorture4testsuite(t, "s3member:local", '//$SERVER/tmp --realm=$REALM --machine-pass --option=torture:addc=$DC_SERVER', description="machine account")
310     elif t == "unix.whoami":
311         plansmbtorture4testsuite(t, "member:local", '//$SERVER/tmp --machine-pass', description="machine account")
312         plansmbtorture4testsuite(t, "s3member:local", '//$SERVER/tmp --machine-pass --option=torture:addc=$DC_SERVER', description="machine account")
313         for env in ["s3dc", "member"]:
314             plansmbtorture4testsuite(t, env, '//$SERVER/tmp -U$DC_USERNAME%$DC_PASSWORD')
315             plansmbtorture4testsuite(t, env, '//$SERVER/tmpguest -U%', description='anonymous connection')
316         for env in ["plugin_s4_dc", "s3member"]:
317             plansmbtorture4testsuite(t, env, '//$SERVER/tmp -U$DC_USERNAME@$REALM%$DC_PASSWORD --option=torture:addc=$DC_SERVER')
318             plansmbtorture4testsuite(t, env, '//$SERVER/tmp -k yes -U$DC_USERNAME@$REALM%$DC_PASSWORD --option=torture:addc=$DC_SERVER', description='kerberos connection')
319             plansmbtorture4testsuite(t, env, '//$SERVER/tmpguest -U% --option=torture:addc=$DC_SERVER', description='anonymous connection')
320     elif t == "raw.samba3posixtimedlock":
321         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/tmpguest -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/s3dc/share')
322         plansmbtorture4testsuite(t, "plugin_s4_dc", '//$SERVER_IP/tmpguest -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/plugin_s4_dc/share')
323     elif t == "raw.chkpath":
324         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/tmpcase -U$USERNAME%$PASSWORD')
325         plansmbtorture4testsuite(t, "plugin_s4_dc", '//$SERVER_IP/tmpcase -U$USERNAME%$PASSWORD')
326     elif t == "raw.samba3hide" or t == "raw.samba3checkfsp" or t ==  "raw.samba3closeerr":
327         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
328         plansmbtorture4testsuite(t, "simpleserver", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
329         plansmbtorture4testsuite(t, "plugin_s4_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
330     elif t == "raw.session" or t == "smb2.session":
331         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD', 'plain')
332         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/tmpenc -U$USERNAME%$PASSWORD', 'enc')
333         plansmbtorture4testsuite(t, "plugin_s4_dc", '//$SERVER/tmp -k no -U$USERNAME%$PASSWORD', 'ntlm')
334         plansmbtorture4testsuite(t, "plugin_s4_dc", '//$SERVER/tmp -k yes -U$USERNAME%$PASSWORD', 'krb5')
335     elif t == "rpc.lsa":
336         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD', 'over ncacn_np ')
337         plansmbtorture4testsuite(t, "s3dc", 'ncacn_ip_tcp:$SERVER_IP -U$USERNAME%$PASSWORD', 'over ncacn_ip_tcp ')
338         plansmbtorture4testsuite(t, "plugin_s4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD', 'over ncacn_np ')
339         plansmbtorture4testsuite(t, "plugin_s4_dc", 'ncacn_ip_tcp:$SERVER_IP -U$USERNAME%$PASSWORD', 'over ncacn_ip_tcp ')
340     elif t == "rpc.samr.passwords.validate":
341         plansmbtorture4testsuite(t, "s3dc", 'ncacn_ip_tcp:$SERVER_IP -U$USERNAME%$PASSWORD', 'over ncacn_ip_tcp ')
342         plansmbtorture4testsuite(t, "plugin_s4_dc", 'ncacn_ip_tcp:$SERVER_IP -U$USERNAME%$PASSWORD', 'over ncacn_ip_tcp ')
343     elif t == "smb2.durable-open" or t == "smb2.durable-v2-open" or t == "smb2.replay":
344         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/durable -U$USERNAME%$PASSWORD')
345         plansmbtorture4testsuite(t, "plugin_s4_dc", '//$SERVER_IP/durable -U$USERNAME%$PASSWORD')
346     elif t == "base.rw1":
347         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
348         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/valid-users-tmp -U$USERNAME%$PASSWORD')
349         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/write-list-tmp -U$USERNAME%$PASSWORD')
350         plansmbtorture4testsuite(t, "plugin_s4_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
351     elif t == "idmap.rfc2307":
352         plantestsuite(t, "s3member_rfc2307", [os.path.join(samba3srcdir, "../nsswitch/tests/test_idmap_rfc2307.sh"), '$DOMAIN', 'Administrator', '2000000', 'Guest', '2000001', '"Domain Users"', '2000002', 'DnsAdmins', '2000003', 'ou=idmap,dc=samba,dc=example,dc=com', '$DC_SERVER', '$DC_USERNAME', '$DC_PASSWORD'])
353     elif t == "raw.acls":
354         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
355         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/nfs4acl_simple -U$USERNAME%$PASSWORD', description='nfs4acl_xattr-simple')
356         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/nfs4acl_special -U$USERNAME%$PASSWORD', description='nfs4acl_xattr-special')
357         plansmbtorture4testsuite(t, "plugin_s4_dc", '//$SERVER_IP/tmpcase -U$USERNAME%$PASSWORD')
358     elif t == "smb2.ioctl":
359         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/fs_specific -U$USERNAME%$PASSWORD', 'fs_specific')
360         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
361         plansmbtorture4testsuite(t, "plugin_s4_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
362     elif t == "smb2.lock":
363         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/aio -U$USERNAME%$PASSWORD', 'aio')
364         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
365         plansmbtorture4testsuite(t, "plugin_s4_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
366     elif t == "raw.read":
367         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
368         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/aio -U$USERNAME%$PASSWORD', 'aio')
369         plansmbtorture4testsuite(t, "plugin_s4_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
370     elif t == "raw.search":
371         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
372 # test the dirsort module.
373         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/tmpsort -U$USERNAME%$PASSWORD')
374         plansmbtorture4testsuite(t, "plugin_s4_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
375     elif t == "vfs.fruit":
376         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/vfs_fruit -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/s3dc/share')
377         plansmbtorture4testsuite(t, "plugin_s4_dc", '//$SERVER_IP/vfs_fruit -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/plugin_s4_dc/share')
378     elif t == "smb2.notify":
379         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --signing=required')
380         plansmbtorture4testsuite(t, "plugin_s4_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD --signing=required')
381     else:
382         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
383         plansmbtorture4testsuite(t, "plugin_s4_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
384
385
386 test = 'rpc.lsa.lookupsids'
387 auth_options = ["", "ntlm", "spnego", "spnego,ntlm" ]
388 signseal_options = ["", ",connect", ",sign", ",seal"]
389 endianness_options = ["", ",bigendian"]
390 for s in signseal_options:
391     for e in endianness_options:
392         for a in auth_options:
393             binding_string = "ncacn_np:$SERVER[%s%s%s]" % (a, s, e)
394             options = binding_string + " -U$USERNAME%$PASSWORD"
395             plansmbtorture4testsuite(test, "s3dc", options, 'over ncacn_np with [%s%s%s] ' % (a, s, e))
396             plantestsuite("samba3.blackbox.rpcclient over ncacn_np with [%s%s%s] " % (a, s, e), "s3dc:local", [os.path.join(samba3srcdir, "script/tests/test_rpcclient.sh"),
397                                                              "none", options, configuration])
398
399     # We should try more combinations in future, but this is all
400     # the pre-calculated credentials cache supports at the moment
401     e = ""
402     a = ""
403     binding_string = "ncacn_np:$SERVER[%s%s%s]" % (a, s, e)
404     options = binding_string + " -k yes --krb5-ccache=$PREFIX/ktest/krb5_ccache-2"
405     plansmbtorture4testsuite(test, "ktest", options, 'krb5 with old ccache ncacn_np with [%s%s%s] ' % (a, s, e))
406
407     options = binding_string + " -k yes --krb5-ccache=$PREFIX/ktest/krb5_ccache-3"
408     plansmbtorture4testsuite(test, "ktest", options, 'krb5 ncacn_np with [%s%s%s] ' % (a, s, e))
409
410     auth_options2 = ["krb5", "spnego,krb5"]
411     for a in auth_options2:
412         binding_string = "ncacn_np:$SERVER[%s%s%s]" % (a, s, e)
413
414         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"),
415                                                                                                                               "$PREFIX/ktest/krb5_ccache-3", binding_string, "-k", configuration])
416
417 plantestsuite("samba3.blackbox.rpcclient_samlogon", "s3member:local", [os.path.join(samba3srcdir, "script/tests/test_rpcclient_samlogon.sh"),
418                                                                        "$DC_USERNAME", "$DC_PASSWORD", "ncacn_np:$DC_SERVER", configuration])
419 plantestsuite("samba3.blackbox.sharesec", "simpleserver:local",
420               [os.path.join(samba3srcdir, "script/tests/test_sharesec.sh"),
421                configuration, os.path.join(bindir(), "sharesec"), "tmp"])
422
423 options_list = ["", "-e"]
424 for options in options_list:
425     plantestsuite("samba3.blackbox.smbclient_krb5 old ccache %s" % options, "ktest:local",
426                   [os.path.join(samba3srcdir, "script/tests/test_smbclient_krb5.sh"),
427                    "$PREFIX/ktest/krb5_ccache-2",
428                    smbclient3, "$SERVER", options, configuration])
429
430     plantestsuite("samba3.blackbox.smbclient_krb5 old ccache %s" % options, "ktest:local",
431                   [os.path.join(samba3srcdir, "script/tests/test_smbclient_krb5.sh"),
432                    "$PREFIX/ktest/krb5_ccache-2",
433                    smbclient3, "$SERVER", options, configuration])
434
435     plantestsuite("samba3.blackbox.smbclient_large_file %s" % options, "ktest:local",
436                   [os.path.join(samba3srcdir, "script/tests/test_smbclient_posix_large.sh"),
437                    "$PREFIX/ktest/krb5_ccache-3",
438                    smbclient3, "$SERVER", "$PREFIX", options, "-k " + configuration])
439
440     plantestsuite("samba3.blackbox.smbclient_posix_large %s krb5" % options, "ktest:local",
441                   [os.path.join(samba3srcdir, "script/tests/test_smbclient_posix_large.sh"),
442                    "$PREFIX/ktest/krb5_ccache-3",
443                    smbclient3, "$SERVER", "$PREFIX", options, "-k " + configuration])
444
445     plantestsuite("samba3.blackbox.smbclient_posix_large %s NTLM" % options, "s3dc:local",
446                   [os.path.join(samba3srcdir, "script/tests/test_smbclient_posix_large.sh"),
447                    "none",
448                    smbclient3, "$SERVER", "$PREFIX", options, "-U$USERNAME%$PASSWORD " + configuration])
449
450 for e in endianness_options:
451     for a in auth_options:
452         for s in signseal_options:
453             binding_string = "ncacn_ip_tcp:$SERVER_IP[%s%s%s]" % (a, s, e)
454             options = binding_string + " -U$USERNAME%$PASSWORD"
455             plansmbtorture4testsuite(test, "s3dc", options, 'over ncacn_ip_tcp with [%s%s%s] ' % (a, s, e))
456
457 plansmbtorture4testsuite('rpc.epmapper', 's3dc:local', 'ncalrpc: -U$USERNAME%$PASSWORD', 'over ncalrpc')