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