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