selftest: Add tests for vfs_aio_fork
[nivanova/samba-autobuild/.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"]:
175     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])
176     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])
177
178     for t in tests:
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(
182         "samba3.wbinfo_sids2xids.(%s:local)" % env, "%s:local" % env,
183         [os.path.join(samba3srcdir, "script/tests/test_wbinfo_sids2xids.sh")])
184         
185     plantestsuite(
186         "samba3.ntlm_auth.diagnostics(%s:local)" % env, "%s:local" % env,
187         [os.path.join(samba3srcdir, "script/tests/test_ntlm_auth_diagnostics.sh"), ntlm_auth, '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', configuration])
188
189     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])
190
191 env = "s3member"
192 t = "--krb5auth=$DOMAIN\\\\$DC_USERNAME%$DC_PASSWORD"
193 plantestsuite("samba3.wbinfo_s3.(%s:local).%s" % (env, t), "%s:local" % env, [os.path.join(samba3srcdir, "script/tests/test_wbinfo_s3.sh"), t])
194
195 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])
196
197 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])
198
199
200 for env in ["maptoguest", "secshare"]:
201     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"])
202
203 env = "maptoguest"
204 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"])
205
206 # plain
207 for env in ["s3dc"]:
208     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])
209
210 for env in ["member", "s3member"]:
211     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])
212
213 for env in ["s3dc"]:
214     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"])
215
216 for env in ["member", "s3member"]:
217     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"])
218
219 for env in ["s3dc"]:
220     # encrypted
221     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"])
222
223     # Test smbclient/tarmode
224     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])
225
226 #TODO encrypted against member, with member creds, and with DC creds
227 plantestsuite("samba3.blackbox.net.misc", "s3dc:local",
228               [os.path.join(samba3srcdir, "script/tests/test_net_misc.sh"),
229                scriptdir, "$SMB_CONF_PATH", net, configuration])
230 plantestsuite("samba3.blackbox.net.local.registry", "s3dc:local",
231               [os.path.join(samba3srcdir, "script/tests/test_net_registry.sh"),
232                scriptdir, "$SMB_CONF_PATH", net, configuration])
233 plantestsuite("samba3.blackbox.net.registry.check", "s3dc:local",
234               [os.path.join(samba3srcdir, "script/tests/test_net_registry_check.sh"),
235                scriptdir, "$SMB_CONF_PATH", net, configuration,dbwrap_tool])
236 plantestsuite("samba3.blackbox.net.rpc.registry", "s3dc",
237               [os.path.join(samba3srcdir, "script/tests/test_net_registry.sh"),
238                scriptdir, "$SMB_CONF_PATH", net, configuration, 'rpc'])
239
240 plantestsuite("samba3.blackbox.net.local.registry.roundtrip", "s3dc:local",
241               [os.path.join(samba3srcdir, "script/tests/test_net_registry_roundtrip.sh"),
242                scriptdir, "$SMB_CONF_PATH", net, configuration])
243 plantestsuite("samba3.blackbox.net.rpc.registry.roundtrip", "s3dc",
244               [os.path.join(samba3srcdir, "script/tests/test_net_registry_roundtrip.sh"),
245                scriptdir, "$SMB_CONF_PATH", net, configuration, 'rpc'])
246
247 plantestsuite("samba3.blackbox.net.local.conf", "s3dc:local",
248               [os.path.join(samba3srcdir, "script/tests/test_net_conf.sh"),
249                scriptdir, "$SMB_CONF_PATH", net, configuration])
250 plantestsuite("samba3.blackbox.net.rpc.conf", "s3dc",
251               [os.path.join(samba3srcdir, "script/tests/test_net_conf.sh"),
252                scriptdir, "$SMB_CONF_PATH", net, configuration, 'rpc'])
253
254
255 plantestsuite("samba3.blackbox.testparm", "s3dc:local",
256               [os.path.join(samba3srcdir, "script/tests/test_testparm_s3.sh"),
257                "$LOCAL_PATH"])
258
259 plantestsuite(
260     "samba3.pthreadpool", "s3dc",
261     [os.path.join(samba3srcdir, "script/tests/test_pthreadpool.sh")])
262
263 #smbtorture4 tests
264
265 base = ["base.attr", "base.charset", "base.chkpath", "base.defer_open", "base.delaywrite", "base.delete",
266         "base.deny1", "base.deny2", "base.deny3", "base.denydos", "base.dir1", "base.dir2",
267         "base.disconnect", "base.fdpass", "base.lock",
268         "base.mangle", "base.negnowait", "base.ntdeny1",
269         "base.ntdeny2", "base.open", "base.openattr", "base.properties", "base.rename", "base.rw1",
270         "base.secleak", "base.tcon", "base.tcondev", "base.trans2", "base.unlink", "base.vuid",
271         "base.xcopy", "base.samba3error"]
272
273 raw = ["raw.acls", "raw.chkpath", "raw.close", "raw.composite", "raw.context", "raw.eas",
274        "raw.ioctl", "raw.lock", "raw.mkdir", "raw.mux", "raw.notify", "raw.open", "raw.oplock"
275        "raw.qfileinfo", "raw.qfsinfo", "raw.read", "raw.rename", "raw.search", "raw.seek",
276        "raw.sfileinfo.base", "raw.sfileinfo.bug", "raw.streams", "raw.unlink", "raw.write",
277        "raw.samba3hide", "raw.samba3badpath", "raw.sfileinfo.rename", "raw.session",
278        "raw.samba3caseinsensitive", "raw.samba3posixtimedlock",
279        "raw.samba3rootdirfid", "raw.sfileinfo.end-of-file",
280        "raw.bench-oplock", "raw.bench-lock", "raw.bench-open", "raw.bench-tcon",
281        "raw.samba3checkfsp", "raw.samba3closeerr", "raw.samba3oplocklogoff"]
282
283 smb2 = smb4torture_testsuites("smb2.")
284
285 rpc = ["rpc.authcontext", "rpc.samba3.bind", "rpc.samba3.srvsvc", "rpc.samba3.sharesec",
286        "rpc.samba3.spoolss", "rpc.samba3.wkssvc", "rpc.samba3.winreg",
287        "rpc.samba3.getaliasmembership-0",
288        "rpc.samba3.netlogon", "rpc.samba3.sessionkey", "rpc.samba3.getusername",
289        "rpc.samba3.smb1-pipe-name", "rpc.samba3.smb2-pipe-name",
290        "rpc.samba3.smb-reauth1", "rpc.samba3.smb-reauth2",
291        "rpc.svcctl", "rpc.ntsvcs", "rpc.winreg", "rpc.eventlog",
292        "rpc.spoolss.printserver", "rpc.spoolss.win", "rpc.spoolss.notify", "rpc.spoolss.printer",
293        "rpc.spoolss.driver",
294        "rpc.lsa", "rpc.lsa-getuser", "rpc.lsa.lookupsids", "rpc.lsa.lookupnames",
295        "rpc.lsa.privileges", "rpc.lsa.secrets",
296        "rpc.samr", "rpc.samr.users", "rpc.samr.users.privileges", "rpc.samr.passwords",
297        "rpc.samr.passwords.pwdlastset", "rpc.samr.large-dc", "rpc.samr.machine.auth",
298        "rpc.samr.priv",
299        "rpc.netlogon.admin",
300        "rpc.schannel", "rpc.schannel2", "rpc.bench-schannel1", "rpc.join", "rpc.bind"]
301
302 local = ["local.nss-wrapper", "local.ndr"]
303
304 winbind = ["winbind.struct", "winbind.wbclient"]
305
306 rap = ["rap.basic", "rap.rpc", "rap.printing", "rap.sam"]
307
308 unix = ["unix.info2", "unix.whoami"]
309
310 nbt = ["nbt.dgram" ]
311
312 libsmbclient = ["libsmbclient"]
313
314 tests= base + raw + smb2 + rpc + unix + local + winbind + rap + nbt + libsmbclient
315
316 for t in tests:
317     if t == "base.delaywrite":
318         plansmbtorturetestsuite(t, "s3dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --maximum-runtime=900')
319         plansmbtorturetestsuite(t, "plugin_s4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --maximum-runtime=900')
320     elif t == "rap.sam":
321         plansmbtorturetestsuite(t, "s3dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --option=doscharset=ISO-8859-1')
322         plansmbtorturetestsuite(t, "plugin_s4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --option=doscharset=ISO-8859-1')
323     elif t == "unix.whoami":
324         plansmbtorturetestsuite(t, "member:local", '//$SERVER/tmp --machine-pass', description="machine account")
325         plansmbtorturetestsuite(t, "s3member:local", '//$SERVER/tmp --machine-pass --option=torture:addc=$DC_SERVER', description="machine account")
326         for env in ["s3dc", "member"]:
327             plansmbtorturetestsuite(t, env, '//$SERVER/tmp -U$DC_USERNAME%$DC_PASSWORD')
328             plansmbtorturetestsuite(t, env, '//$SERVER/tmpguest -U%', description='anonymous connection')
329         for env in ["plugin_s4_dc", "s3member"]:
330             plansmbtorturetestsuite(t, env, '//$SERVER/tmp -U$DC_USERNAME@$REALM%$DC_PASSWORD --option=torture:addc=$DC_SERVER')
331             plansmbtorturetestsuite(t, env, '//$SERVER/tmp -k yes -U$DC_USERNAME@$REALM%$DC_PASSWORD --option=torture:addc=$DC_SERVER', description='kerberos connection')
332             plansmbtorturetestsuite(t, env, '//$SERVER/tmpguest -U% --option=torture:addc=$DC_SERVER', description='anonymous connection')
333     elif t == "raw.samba3posixtimedlock":
334         plansmbtorturetestsuite(t, "s3dc", '//$SERVER_IP/tmpguest -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/s3dc/share')
335         plansmbtorturetestsuite(t, "plugin_s4_dc", '//$SERVER_IP/tmpguest -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/plugin_s4_dc/share')
336     elif t == "raw.chkpath":
337         plansmbtorturetestsuite(t, "s3dc", '//$SERVER_IP/tmpcase -U$USERNAME%$PASSWORD')
338         plansmbtorturetestsuite(t, "plugin_s4_dc", '//$SERVER_IP/tmpcase -U$USERNAME%$PASSWORD')
339     elif t == "raw.samba3hide" or t == "raw.samba3checkfsp" or t ==  "raw.samba3closeerr":
340         plansmbtorturetestsuite(t, "s3dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
341         plansmbtorturetestsuite(t, "secshare", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
342         plansmbtorturetestsuite(t, "plugin_s4_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
343     elif t == "raw.session" or t == "smb2.session":
344         plansmbtorturetestsuite(t, "s3dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD', 'plain')
345         plansmbtorturetestsuite(t, "s3dc", '//$SERVER_IP/tmpenc -U$USERNAME%$PASSWORD', 'enc')
346         plansmbtorturetestsuite(t, "plugin_s4_dc", '//$SERVER/tmp -k no -U$USERNAME%$PASSWORD', 'ntlm')
347         plansmbtorturetestsuite(t, "plugin_s4_dc", '//$SERVER/tmp -k yes -U$USERNAME%$PASSWORD', 'krb5')
348     elif t == "rpc.lsa":
349         plansmbtorturetestsuite(t, "s3dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD', 'over ncacn_np ')
350         plansmbtorturetestsuite(t, "s3dc", 'ncacn_ip_tcp:$SERVER_IP -U$USERNAME%$PASSWORD', 'over ncacn_ip_tcp ')
351         plansmbtorturetestsuite(t, "plugin_s4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD', 'over ncacn_np ')
352         plansmbtorturetestsuite(t, "plugin_s4_dc", 'ncacn_ip_tcp:$SERVER_IP -U$USERNAME%$PASSWORD', 'over ncacn_ip_tcp ')
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 test = 'rpc.epmapper'
425 env = 's3dc:local'
426 binding_string = 'ncalrpc:'
427 options = binding_string + " -U$USERNAME%$PASSWORD"
428
429 plansmbtorturetestsuite(test, env, options, 'over ncalrpc')