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