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