s2-selftest: run shadow_copy2 test both in NT1 and SMB3 modes
[Samba.git] / source3 / selftest / tests.py
blob7d0dcc16c26c96bfb49f38521fb73a89ab6dc213
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.
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".
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.
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.
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 smbtorture4_options.extend([
26 '--option=torture:sharedelay=100000',
27 '--option=torture:writetimeupdatedelay=500000',
30 def plansmbtorture4testsuite(name, env, options, description=''):
31 if description == '':
32 modname = "samba3.%s" % (name, )
33 else:
34 modname = "samba3.%s %s" % (name, description)
36 selftesthelpers.plansmbtorture4testsuite(
37 name, env, options, target='samba3', modname=modname)
40 plantestsuite("samba3.blackbox.success", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/test_success.sh")])
41 plantestsuite("samba3.blackbox.failure", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/test_failure.sh")])
43 plantestsuite("samba3.local_s3", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/test_local_s3.sh")])
45 plantestsuite("samba3.blackbox.registry.upgrade", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/test_registry_upgrade.sh"), net, dbwrap_tool])
47 tests = ["FDPASS", "LOCK1", "LOCK2", "LOCK3", "LOCK4", "LOCK5", "LOCK6", "LOCK7", "LOCK9",
48 "UNLINK", "BROWSE", "ATTR", "TRANS2", "TORTURE",
49 "OPLOCK1", "OPLOCK2", "OPLOCK4", "STREAMERROR",
50 "DIR", "DIR1", "DIR-CREATETIME", "TCON", "TCONDEV", "RW1", "RW2", "RW3", "LARGE_READX", "RW-SIGNING",
51 "OPEN", "XCOPY", "RENAME", "DELETE", "DELETE-LN", "WILDDELETE", "PROPERTIES", "W2K",
52 "TCON2", "IOCTL", "CHKPATH", "FDSESS", "CHAIN1", "CHAIN2",
53 "CHAIN3", "PIDHIGH",
54 "GETADDRINFO", "UID-REGRESSION-TEST", "SHORTNAME-TEST",
55 "CASE-INSENSITIVE-CREATE", "SMB2-BASIC", "NTTRANS-FSCTL", "SMB2-NEGPROT",
56 "SMB2-SESSION-REAUTH", "SMB2-SESSION-RECONNECT",
57 "CLEANUP1",
58 "CLEANUP2",
59 "CLEANUP4",
60 "BAD-NBT-SESSION"]
62 for t in tests:
63 plantestsuite("samba3.smbtorture_s3.plain(nt4_dc).%s" % t, "nt4_dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
64 plantestsuite("samba3.smbtorture_s3.crypt_client(nt4_dc).%s" % t, "nt4_dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', smbtorture3, "-e", "-l $LOCAL_PATH"])
65 if t == "TORTURE":
66 # this is a negative test to verify that the server rejects
67 # access without encryption
68 plantestsuite("samba3.smbtorture_s3.crypt_server(nt4_dc).%s" % t, "nt4_dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmpenc', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
69 plantestsuite("samba3.smbtorture_s3.plain(ad_dc_ntvfs).%s" % t, "ad_dc_ntvfs", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
71 # non-crypt only
73 tests = ["OPLOCK-CANCEL"]
74 for t in tests:
75 plantestsuite("samba3.smbtorture_s3.plain(nt4_dc).%s" % t, "nt4_dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
77 tests = ["RW1", "RW2", "RW3"]
78 for t in tests:
79 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"])
81 posix_tests = ["POSIX", "POSIX-APPEND", "POSIX-SYMLINK-ACL", "POSIX-SYMLINK-EA", "POSIX-OFD-LOCK",
82 "POSIX-STREAM-DELETE" ]
84 for t in posix_tests:
85 plantestsuite("samba3.smbtorture_s3.plain(nt4_dc).%s" % t, "nt4_dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/posix_share', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
86 plantestsuite("samba3.smbtorture_s3.crypt(nt4_dc).%s" % t, "nt4_dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/posix_share', '$USERNAME', '$PASSWORD', smbtorture3, "-e", "-l $LOCAL_PATH"])
87 plantestsuite("samba3.smbtorture_s3.plain(ad_dc_ntvfs).%s" % t, "ad_dc_ntvfs", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/posix_share', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
89 env = "nt4_dc:local"
90 t = "CLEANUP3"
91 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"])
93 local_tests = [
94 "LOCAL-SUBSTITUTE",
95 "LOCAL-GENCACHE",
96 "LOCAL-TALLOC-DICT",
97 "LOCAL-BASE64",
98 "LOCAL-RBTREE",
99 "LOCAL-MEMCACHE",
100 "LOCAL-STREAM-NAME",
101 "LOCAL-string_to_sid",
102 "LOCAL-sid_to_string",
103 "LOCAL-binary_to_sid",
104 "LOCAL-DBTRANS",
105 "LOCAL-TEVENT-SELECT",
106 "LOCAL-CONVERT-STRING",
107 "LOCAL-CONV-AUTH-INFO",
108 "LOCAL-IDMAP-TDB-COMMON",
109 "LOCAL-MESSAGING-READ1",
110 "LOCAL-MESSAGING-READ2",
111 "LOCAL-MESSAGING-READ3",
112 "LOCAL-MESSAGING-READ4",
113 "LOCAL-MESSAGING-FDPASS1",
114 "LOCAL-MESSAGING-FDPASS2",
115 "LOCAL-MESSAGING-FDPASS2a",
116 "LOCAL-MESSAGING-FDPASS2b",
117 "LOCAL-PTHREADPOOL-TEVENT",
118 "LOCAL-hex_encode_buf",
119 "LOCAL-remove_duplicate_addrs2"]
121 for t in local_tests:
122 plantestsuite("samba3.smbtorture_s3.%s" % t, "none", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//foo/bar', '""', '""', smbtorture3, ""])
124 plantestsuite("samba.vfstest.stream_depot", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/stream-depot/run.sh"), binpath("vfstest"), "$PREFIX", configuration])
125 plantestsuite("samba.vfstest.xattr-tdb-1", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/xattr-tdb-1/run.sh"), binpath("vfstest"), "$PREFIX", configuration])
126 plantestsuite("samba.vfstest.acl", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/vfstest-acl/run.sh"), binpath("vfstest"), "$PREFIX", configuration])
127 plantestsuite("samba.vfstest.catia", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/vfstest-catia/run.sh"), binpath("vfstest"), "$PREFIX", configuration])
129 for options in ["", "--option=clientntlmv2auth=no", "--option=clientusespnego=no", "--option=clientusespnego=no --option=clientntlmv2auth=no", "--option=clientntlmv2auth=no --option=clientlanmanauth=yes --max-protocol=LANMAN2", "--option=clientntlmv2auth=no --option=clientlanmanauth=yes --option=clientmaxprotocol=NT1"]:
130 env = "nt4_dc"
131 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])
133 for env in ["nt4_dc", "nt4_member", "ad_member", "ad_dc", "ad_dc_ntvfs", "s4member", "fl2000dc"]:
134 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])
135 plantestsuite("samba3.blackbox.smbclient_ntlm.plain (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_ntlm.sh"), '$SERVER', '$DC_USERNAME', '$DC_PASSWORD', "never", smbclient3, configuration])
137 for options in ["--option=clientntlmv2auth=no", "--option=clientusespnego=no --option=clientntlmv2auth=no", ""]:
138 for env in ["nt4_member", "ad_member"]:
139 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])
140 plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) %s member creds" % (env, options), env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$SERVER/$USERNAME', '$PASSWORD', smbclient3, configuration, options])
142 env="nt4_dc"
143 plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) ipv6" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IPV6', '$SERVER/$USERNAME', '$PASSWORD', smbclient3, configuration])
145 for env in ["nt4_member", "ad_member"]:
146 plantestsuite("samba3.blackbox.net_cred_change.(%s:local)" % env, "%s:local" % env, [os.path.join(samba3srcdir, "script/tests/test_net_cred_change.sh"), configuration])
148 env = "ad_member"
149 t = "--krb5auth=$DOMAIN/$DC_USERNAME%$DC_PASSWORD"
150 plantestsuite("samba3.wbinfo_simple.(%s:local).%s" % (env, t), "%s:local" % env, [os.path.join(srcdir(), "nsswitch/tests/test_wbinfo_simple.sh"), t])
151 t = "WBCLIENT-MULTI-PING"
152 plantestsuite("samba3.smbtorture_s3.%s" % t, env, [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//foo/bar', '""', '""', smbtorture3, ""])
155 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])
157 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])
160 for env in ["maptoguest", "simpleserver"]:
161 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"])
163 env = "maptoguest"
164 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"])
165 plantestsuite("samba3.blackbox.smbclient_ntlm.plain (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_ntlm.sh"), '$SERVER', '$USERNAME', '$PASSWORD', "baduser", smbclient3, configuration])
167 # plain
168 for env in ["nt4_dc"]:
169 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, net, configuration])
171 for env in ["nt4_member", "ad_member"]:
172 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, net, configuration])
174 for env in ["nt4_dc"]:
175 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, net, configuration, "--signing=required"])
177 for env in ["nt4_member", "ad_member"]:
178 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, net, configuration, "--signing=required"])
180 for env in ["nt4_dc"]:
181 # encrypted
182 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, net, configuration, "-e"])
184 for env in ["fileserver"]:
185 plantestsuite("samba3.blackbox.preserve_case (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_preserve_case.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3])
186 plantestsuite("samba3.blackbox.dfree_command (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_dfree_command.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3])
187 plantestsuite("samba3.blackbox.dfree_quota (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_dfree_quota.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH', smbclient3, smbcquotas, smbcacls])
188 plantestsuite("samba3.blackbox.valid_users (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_valid_users.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3])
189 plantestsuite("samba3.blackbox.offline (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_offline.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH/offline', smbclient3])
190 plantestsuite("samba3.blackbox.shadow_copy2 NT1 (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_shadow_copy.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH/shadow', smbclient3, '-m', 'NT1'])
191 plantestsuite("samba3.blackbox.shadow_copy2 SMB3 (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_shadow_copy.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH/shadow', smbclient3, '-m', 'SMB3'])
192 plantestsuite("samba3.blackbox.smbclient.forceuser_validusers (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_forceuser_validusers.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH', smbclient3])
193 plantestsuite("samba3.blackbox.smbget (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbget.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', 'smbget_user', '$PASSWORD', '$LOCAL_PATH/smbget', smbget])
194 plantestsuite("samba3.blackbox.netshareenum (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_shareenum.sh"), '$SERVER', '$USERNAME', '$PASSWORD', rpcclient])
195 plantestsuite("samba3.blackbox.acl_xattr (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_acl_xattr.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3, smbcacls])
196 plantestsuite("samba3.blackbox.smb2.not_casesensitive (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smb2_not_casesensitive.sh"), '//$SERVER/tmp', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$LOCAL_PATH', smbclient3])
197 plantestsuite("samba3.blackbox.inherit_owner.default(%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_inherit_owner.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3, smbcacls, 'tmp', '0', '0', '-m', 'NT1'])
198 plantestsuite("samba3.blackbox.inherit_owner.full (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_inherit_owner.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3, smbcacls, 'inherit_owner', '1', '1', '-m', 'NT1'])
199 plantestsuite("samba3.blackbox.inherit_owner.unix (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_inherit_owner.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3, smbcacls, 'inherit_owner_u', '0', '1', '-m', 'NT1'])
202 # tar command tests
205 # find config.h
206 try:
207 config_h = os.environ["CONFIG_H"]
208 except KeyError:
209 config_h = os.path.join(samba4bindir, "default/include/config.h")
211 # see if libarchive is supported
212 f = open(config_h, 'r')
213 try:
214 have_libarchive = ("HAVE_LIBARCHIVE 1" in f.read())
215 finally:
216 f.close()
218 # tar command enabled only if built with libarchive
219 if have_libarchive:
220 # Test smbclient/tarmode
221 plantestsuite("samba3.blackbox.smbclient_tarmode (%s)" % env, env,
222 [os.path.join(samba3srcdir, "script/tests/test_smbclient_tarmode.sh"),
223 '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD',
224 '$LOCAL_PATH', '$PREFIX', smbclient3, configuration])
226 # Test suite for new smbclient/tar with libarchive (GSoC 13)
227 plantestsuite("samba3.blackbox.smbclient_tar (%s)" % env, env,
228 [os.path.join(samba3srcdir, "script/tests/test_smbclient_tarmode.pl"),
229 '-n', '$SERVER', '-i', '$SERVER_IP', '-s', 'tmp',
230 '-u', '$USERNAME', '-p', '$PASSWORD', '-l', '$LOCAL_PATH',
231 '-d', '$PREFIX', '-b', smbclient3,
232 '--subunit', '--', configuration])
234 #TODO encrypted against member, with member creds, and with DC creds
235 plantestsuite("samba3.blackbox.net.misc", "nt4_dc:local",
236 [os.path.join(samba3srcdir, "script/tests/test_net_misc.sh"),
237 scriptdir, "$SMB_CONF_PATH", net, configuration])
238 plantestsuite("samba3.blackbox.net.local.registry", "nt4_dc:local",
239 [os.path.join(samba3srcdir, "script/tests/test_net_registry.sh"),
240 scriptdir, "$SMB_CONF_PATH", net, configuration])
241 plantestsuite("samba3.blackbox.net.registry.check", "nt4_dc:local",
242 [os.path.join(samba3srcdir, "script/tests/test_net_registry_check.sh"),
243 scriptdir, "$SMB_CONF_PATH", net, configuration, dbwrap_tool])
244 plantestsuite("samba3.blackbox.net.rpc.registry", "nt4_dc",
245 [os.path.join(samba3srcdir, "script/tests/test_net_registry.sh"),
246 scriptdir, "$SMB_CONF_PATH", net, configuration, 'rpc'])
248 plantestsuite("samba3.blackbox.net.local.registry.roundtrip", "nt4_dc:local",
249 [os.path.join(samba3srcdir, "script/tests/test_net_registry_roundtrip.sh"),
250 scriptdir, "$SMB_CONF_PATH", net, configuration])
251 plantestsuite("samba3.blackbox.net.rpc.registry.roundtrip", "nt4_dc",
252 [os.path.join(samba3srcdir, "script/tests/test_net_registry_roundtrip.sh"),
253 scriptdir, "$SMB_CONF_PATH", net, configuration, 'rpc'])
255 plantestsuite("samba3.blackbox.net.local.conf", "nt4_dc:local",
256 [os.path.join(samba3srcdir, "script/tests/test_net_conf.sh"),
257 scriptdir, "$SMB_CONF_PATH", net, configuration])
258 plantestsuite("samba3.blackbox.net.rpc.conf", "nt4_dc",
259 [os.path.join(samba3srcdir, "script/tests/test_net_conf.sh"),
260 scriptdir, "$SMB_CONF_PATH", net, configuration, 'rpc'])
263 plantestsuite("samba3.blackbox.testparm", "nt4_dc:local",
264 [os.path.join(samba3srcdir, "script/tests/test_testparm_s3.sh"),
265 "$LOCAL_PATH"])
267 plantestsuite(
268 "samba3.pthreadpool", "nt4_dc",
269 [os.path.join(samba3srcdir, "script/tests/test_pthreadpool.sh")])
271 plantestsuite("samba3.async_req", "nt4_dc",
272 [os.path.join(samba3srcdir, "script/tests/test_async_req.sh")])
274 #smbtorture4 tests
276 base = ["base.attr", "base.charset", "base.chkpath", "base.defer_open", "base.delaywrite", "base.delete",
277 "base.deny1", "base.deny2", "base.deny3", "base.denydos", "base.dir1", "base.dir2",
278 "base.disconnect", "base.fdpass", "base.lock",
279 "base.mangle", "base.negnowait", "base.ntdeny1",
280 "base.ntdeny2", "base.open", "base.openattr", "base.properties", "base.rename", "base.rw1",
281 "base.secleak", "base.tcon", "base.tcondev", "base.trans2", "base.unlink", "base.vuid",
282 "base.xcopy", "base.samba3error"]
284 raw = ["raw.acls", "raw.chkpath", "raw.close", "raw.composite", "raw.context", "raw.eas",
285 "raw.ioctl", "raw.lock", "raw.mkdir", "raw.mux", "raw.notify", "raw.open", "raw.oplock",
286 "raw.qfileinfo", "raw.qfsinfo", "raw.read", "raw.rename", "raw.search", "raw.seek",
287 "raw.sfileinfo.base", "raw.sfileinfo.bug", "raw.streams", "raw.unlink", "raw.write",
288 "raw.samba3hide", "raw.samba3badpath", "raw.sfileinfo.rename", "raw.session",
289 "raw.samba3caseinsensitive", "raw.samba3posixtimedlock",
290 "raw.samba3rootdirfid", "raw.sfileinfo.end-of-file",
291 "raw.bench-oplock", "raw.bench-lock", "raw.bench-open", "raw.bench-tcon",
292 "raw.samba3checkfsp", "raw.samba3closeerr", "raw.samba3oplocklogoff", "raw.samba3badnameblob"]
294 smb2 = smbtorture4_testsuites("smb2.")
296 rpc = ["rpc.authcontext", "rpc.samba3.bind", "rpc.samba3.srvsvc", "rpc.samba3.sharesec",
297 "rpc.samba3.spoolss", "rpc.samba3.wkssvc", "rpc.samba3.winreg",
298 "rpc.samba3.getaliasmembership-0",
299 "rpc.samba3.netlogon", "rpc.samba3.sessionkey", "rpc.samba3.getusername",
300 "rpc.samba3.smb1-pipe-name", "rpc.samba3.smb2-pipe-name",
301 "rpc.samba3.smb-reauth1", "rpc.samba3.smb-reauth2",
302 "rpc.svcctl", "rpc.ntsvcs", "rpc.winreg", "rpc.eventlog",
303 "rpc.spoolss.printserver", "rpc.spoolss.win", "rpc.spoolss.notify", "rpc.spoolss.printer",
304 "rpc.spoolss.driver",
305 "rpc.lsa", "rpc.lsa-getuser", "rpc.lsa.lookupsids", "rpc.lsa.lookupnames",
306 "rpc.lsa.privileges", "rpc.lsa.secrets",
307 "rpc.samr", "rpc.samr.users", "rpc.samr.users.privileges", "rpc.samr.passwords",
308 "rpc.samr.passwords.pwdlastset", "rpc.samr.passwords.lockout", "rpc.samr.passwords.badpwdcount", "rpc.samr.large-dc", "rpc.samr.machine.auth",
309 "rpc.samr.priv", "rpc.samr.passwords.validate",
310 "rpc.netlogon.admin",
311 "rpc.schannel", "rpc.schannel2", "rpc.bench-schannel1", "rpc.schannel_anon_setpw", "rpc.join", "rpc.bind"]
313 local = ["local.nss"]
315 idmap = ["idmap.rfc2307", "idmap.alloc"]
317 rap = ["rap.basic", "rap.rpc", "rap.printing", "rap.sam"]
319 unix = ["unix.info2", "unix.whoami"]
321 nbt = ["nbt.dgram" ]
323 libsmbclient = ["libsmbclient"]
325 vfs = ["vfs.fruit"]
327 tests= base + raw + smb2 + rpc + unix + local + rap + nbt + libsmbclient + idmap + vfs
329 for t in tests:
330 if t == "base.delaywrite":
331 plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD -k yes --maximum-runtime=900')
332 elif t == "rap.sam":
333 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --option=doscharset=ISO-8859-1')
334 plansmbtorture4testsuite(t, "ad_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --option=doscharset=ISO-8859-1')
335 elif t == "winbind.pac":
336 plansmbtorture4testsuite(t, "ad_member:local", '//$SERVER/tmp --realm=$REALM --machine-pass --option=torture:addc=$DC_SERVER', description="machine account")
337 elif t == "unix.whoami":
338 plansmbtorture4testsuite(t, "nt4_member:local", '//$SERVER/tmp --machine-pass', description="machine account")
339 plansmbtorture4testsuite(t, "ad_member:local", '//$SERVER/tmp --machine-pass --option=torture:addc=$DC_SERVER', description="machine account")
340 for env in ["nt4_dc", "nt4_member"]:
341 plansmbtorture4testsuite(t, env, '//$SERVER/tmp -U$DC_USERNAME%$DC_PASSWORD')
342 plansmbtorture4testsuite(t, env, '//$SERVER/tmpguest -U%', description='anonymous connection')
343 for env in ["ad_dc", "ad_member"]:
344 plansmbtorture4testsuite(t, env, '//$SERVER/tmp -U$DC_USERNAME@$REALM%$DC_PASSWORD --option=torture:addc=$DC_SERVER')
345 plansmbtorture4testsuite(t, env, '//$SERVER/tmp -k yes -U$DC_USERNAME@$REALM%$DC_PASSWORD --option=torture:addc=$DC_SERVER', description='kerberos connection')
346 plansmbtorture4testsuite(t, env, '//$SERVER/tmpguest -U% --option=torture:addc=$DC_SERVER', description='anonymous connection')
347 elif t == "raw.samba3posixtimedlock":
348 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmpguest -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share')
349 plansmbtorture4testsuite(t, "ad_dc", '//$SERVER_IP/tmpguest -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/ad_dc/share')
350 elif t == "raw.chkpath":
351 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmpcase -U$USERNAME%$PASSWORD')
352 plansmbtorture4testsuite(t, "ad_dc", '//$SERVER_IP/tmpcase -U$USERNAME%$PASSWORD')
353 elif t == "raw.samba3hide" or t == "raw.samba3checkfsp" or t == "raw.samba3closeerr":
354 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
355 plansmbtorture4testsuite(t, "simpleserver", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
356 plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
357 elif t == "raw.session" or t == "smb2.session":
358 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD', 'plain')
359 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmpenc -U$USERNAME%$PASSWORD', 'enc')
360 plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -k no -U$USERNAME%$PASSWORD', 'ntlm')
361 plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -k yes -U$USERNAME%$PASSWORD', 'krb5')
362 elif t == "rpc.lsa":
363 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD', 'over ncacn_np ')
364 plansmbtorture4testsuite(t, "nt4_dc", 'ncacn_ip_tcp:$SERVER_IP -U$USERNAME%$PASSWORD', 'over ncacn_ip_tcp ')
365 plansmbtorture4testsuite(t, "ad_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD', 'over ncacn_np ')
366 plansmbtorture4testsuite(t, "ad_dc", 'ncacn_ip_tcp:$SERVER_IP -U$USERNAME%$PASSWORD', 'over ncacn_ip_tcp ')
367 elif t == "rpc.samr.passwords.validate":
368 plansmbtorture4testsuite(t, "nt4_dc", 'ncacn_ip_tcp:$SERVER_IP[seal] -U$USERNAME%$PASSWORD', 'over ncacn_ip_tcp ')
369 plansmbtorture4testsuite(t, "ad_dc", 'ncacn_ip_tcp:$SERVER_IP[seal] -U$USERNAME%$PASSWORD', 'over ncacn_ip_tcp ')
370 elif t == "smb2.durable-open" or t == "smb2.durable-v2-open" or t == "smb2.replay":
371 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/durable -U$USERNAME%$PASSWORD')
372 plansmbtorture4testsuite(t, "ad_dc", '//$SERVER_IP/durable -U$USERNAME%$PASSWORD')
373 elif t == "base.rw1":
374 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
375 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/valid-users-tmp -U$USERNAME%$PASSWORD')
376 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/write-list-tmp -U$USERNAME%$PASSWORD')
377 plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
378 elif t == "idmap.rfc2307":
379 plantestsuite(t, "ad_member_rfc2307", [os.path.join(samba3srcdir, "../nsswitch/tests/test_idmap_rfc2307.sh"), '$DOMAIN', 'Administrator', '2000000', 'Guest', '2000001', '"Domain Users"', '2000002', 'DnsAdmins', '2000003', 'ou=idmap,dc=samba,dc=example,dc=com', '$DC_SERVER', '$DC_USERNAME', '$DC_PASSWORD'])
380 elif t == "idmap.alloc":
381 plantestsuite(t, "ad_member_rfc2307", [os.path.join(samba3srcdir, "../nsswitch/tests/test_idmap_nss.sh"), '$DOMAIN'])
382 elif t == "raw.acls":
383 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
384 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/nfs4acl_simple -U$USERNAME%$PASSWORD', description='nfs4acl_xattr-simple')
385 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/nfs4acl_special -U$USERNAME%$PASSWORD', description='nfs4acl_xattr-special')
386 plansmbtorture4testsuite(t, "ad_dc", '//$SERVER_IP/tmpcase -U$USERNAME%$PASSWORD')
387 elif t == "smb2.ioctl":
388 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/fs_specific -U$USERNAME%$PASSWORD', 'fs_specific')
389 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
390 plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
391 elif t == "smb2.lock":
392 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/aio -U$USERNAME%$PASSWORD', 'aio')
393 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
394 plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
395 elif t == "raw.read":
396 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
397 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/aio -U$USERNAME%$PASSWORD', 'aio')
398 plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
399 elif t == "raw.search":
400 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
401 # test the dirsort module.
402 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmpsort -U$USERNAME%$PASSWORD')
403 plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
404 elif t == "vfs.fruit":
405 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share')
406 plansmbtorture4testsuite(t, "ad_dc", '//$SERVER_IP/vfs_fruit -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/ad_dc/share')
407 elif t == "rpc.schannel_anon_setpw":
408 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$%', description="anonymous password set")
409 plansmbtorture4testsuite(t, "nt4_dc_schannel", '//$SERVER_IP/tmp -U$%', description="anonymous password set (schannel enforced server-side)")
410 plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$%', description="anonymous password set")
411 elif t == "local.nss":
412 for env in ["nt4_dc:local", "ad_member:local", "nt4_member:local", "ad_dc:local"]:
413 plansmbtorture4testsuite(t, env, '//$SERVER/tmp -U$USERNAME%$PASSWORD')
414 elif t == "smb2.change_notify_disabled":
415 plansmbtorture4testsuite(t, "simpleserver", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
416 elif t == "smb2.notify":
417 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --signing=required')
418 plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD --signing=required')
419 elif t == "smb2.dosmode":
420 plansmbtorture4testsuite(t, "simpleserver", '//$SERVER/dosmode -U$USERNAME%$PASSWORD')
421 else:
422 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
423 plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
426 test = 'rpc.lsa.lookupsids'
427 auth_options = ["", "ntlm", "spnego", "spnego,ntlm" ]
428 signseal_options = ["", ",connect", ",sign", ",seal"]
429 endianness_options = ["", ",bigendian"]
430 for s in signseal_options:
431 for e in endianness_options:
432 for a in auth_options:
433 binding_string = "ncacn_np:$SERVER[%s%s%s]" % (a, s, e)
434 options = binding_string + " -U$USERNAME%$PASSWORD"
435 plansmbtorture4testsuite(test, "nt4_dc", options, 'over ncacn_np with [%s%s%s] ' % (a, s, e))
436 plantestsuite("samba3.blackbox.rpcclient over ncacn_np with [%s%s%s] " % (a, s, e), "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/test_rpcclient.sh"),
437 "none", options, configuration])
439 # We should try more combinations in future, but this is all
440 # the pre-calculated credentials cache supports at the moment
441 e = ""
442 a = ""
443 binding_string = "ncacn_np:$SERVER[%s%s%s]" % (a, s, e)
444 options = binding_string + " -k yes --krb5-ccache=$PREFIX/ktest/krb5_ccache-2"
445 plansmbtorture4testsuite(test, "ktest", options, 'krb5 with old ccache ncacn_np with [%s%s%s] ' % (a, s, e))
447 options = binding_string + " -k yes --krb5-ccache=$PREFIX/ktest/krb5_ccache-3"
448 plansmbtorture4testsuite(test, "ktest", options, 'krb5 ncacn_np with [%s%s%s] ' % (a, s, e))
450 auth_options2 = ["krb5", "spnego,krb5"]
451 for a in auth_options2:
452 binding_string = "ncacn_np:$SERVER[%s%s%s]" % (a, s, e)
454 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"),
455 "$PREFIX/ktest/krb5_ccache-3", binding_string, "-k", configuration])
457 plantestsuite("samba3.blackbox.rpcclient_samlogon", "ad_member:local", [os.path.join(samba3srcdir, "script/tests/test_rpcclient_samlogon.sh"),
458 "$DC_USERNAME", "$DC_PASSWORD", "ncacn_np:$DC_SERVER", configuration])
459 plantestsuite("samba3.blackbox.sharesec", "simpleserver:local",
460 [os.path.join(samba3srcdir, "script/tests/test_sharesec.sh"),
461 configuration, os.path.join(bindir(), "sharesec"), "tmp"])
463 plantestsuite("samba3.blackbox.net_dom_join_fail_dc", "nt4_dc",
464 [os.path.join(samba3srcdir, "script/tests/test_net_dom_join_fail_dc.sh"),
465 "$USERNAME", "$PASSWORD", "$SERVER", "$PREFIX/net_dom_join_fail_dc",
466 configuration])
467 plantestsuite("samba3.blackbox.net_rpc_join", "nt4_dc",
468 [os.path.join(samba3srcdir, "script/tests/test_net_rpc_join.sh"),
469 "$USERNAME", "$PASSWORD", "$SERVER", "$PREFIX/net_rpc_join",
470 configuration])
472 plantestsuite("samba3.blackbox.rpcclient_srvsvc", "simpleserver",
473 [os.path.join(samba3srcdir, "script/tests/test_rpcclientsrvsvc.sh"),
474 "$USERNAME", "$PASSWORD", "$SERVER",
475 os.path.join(bindir(), "rpcclient"), "tmp"])
477 plantestsuite("samba3.blackbox.rpcclient.pw-nt-hash", "simpleserver",
478 [os.path.join(samba3srcdir, "script/tests/test_rpcclient_pw_nt_hash.sh"),
479 "$USERNAME", "$PASSWORD", "$SERVER",
480 os.path.join(bindir(), "rpcclient")])
482 options_list = ["", "-e"]
483 for options in options_list:
484 plantestsuite("samba3.blackbox.smbclient_krb5 old ccache %s" % options, "ktest:local",
485 [os.path.join(samba3srcdir, "script/tests/test_smbclient_krb5.sh"),
486 "$PREFIX/ktest/krb5_ccache-2",
487 smbclient3, "$SERVER", options, configuration])
489 plantestsuite("samba3.blackbox.smbclient_krb5 old ccache %s" % options, "ktest:local",
490 [os.path.join(samba3srcdir, "script/tests/test_smbclient_krb5.sh"),
491 "$PREFIX/ktest/krb5_ccache-2",
492 smbclient3, "$SERVER", options, configuration])
494 plantestsuite("samba3.blackbox.smbclient_large_file %s" % options, "ktest:local",
495 [os.path.join(samba3srcdir, "script/tests/test_smbclient_posix_large.sh"),
496 "$PREFIX/ktest/krb5_ccache-3",
497 smbclient3, "$SERVER", "$PREFIX", options, "-k " + configuration])
499 plantestsuite("samba3.blackbox.smbclient_posix_large %s krb5" % options, "ktest:local",
500 [os.path.join(samba3srcdir, "script/tests/test_smbclient_posix_large.sh"),
501 "$PREFIX/ktest/krb5_ccache-3",
502 smbclient3, "$SERVER", "$PREFIX", options, "-k " + configuration])
504 plantestsuite("samba3.blackbox.smbclient_posix_large %s NTLM" % options, "nt4_dc:local",
505 [os.path.join(samba3srcdir, "script/tests/test_smbclient_posix_large.sh"),
506 "none",
507 smbclient3, "$SERVER", "$PREFIX", options, "-U$USERNAME%$PASSWORD " + configuration])
509 for alias in ["foo", "bar"]:
510 plantestsuite("samba3.blackbox.smbclient_netbios_aliases [%s]" % alias, "ad_member:local",
511 [os.path.join(samba3srcdir, "script/tests/test_smbclient_netbios_aliases.sh"),
512 smbclient3, alias, "$DC_USERNAME", "$DC_PASSWORD", "$PREFIX", options, configuration])
514 for e in endianness_options:
515 for a in auth_options:
516 for s in signseal_options:
517 binding_string = "ncacn_ip_tcp:$SERVER_IP[%s%s%s]" % (a, s, e)
518 options = binding_string + " -U$USERNAME%$PASSWORD"
519 plansmbtorture4testsuite(test, "nt4_dc", options, 'over ncacn_ip_tcp with [%s%s%s] ' % (a, s, e))
521 plansmbtorture4testsuite('rpc.epmapper', 'nt4_dc:local', 'ncalrpc: -U$USERNAME%$PASSWORD', 'over ncalrpc')
522 plansmbtorture4testsuite('rpc.fsrvp', 'nt4_dc:local', 'ncacn_np:$SERVER_IP[/pipe/FssagentRpc] -U$USERNAME%$PASSWORD', 'over ncacn_np')