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