s3-winbindd/winbindd_cm.c: remove cli_nt_error()
[Samba/vl.git] / source4 / selftest / tests.py
blob0c755d15805131b2cfab691d80440d33061499da
1 #!/usr/bin/python
2 # This script generates a list of testsuites that should be run as part of
3 # the Samba 4 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 4, 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/knownfail. This makes it
12 # very easy to see what functionality is still missing in Samba 4 and makes
13 # it possible to run the testsuite against other servers, such as Samba 3 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.join(os.path.dirname(__file__), "../../selftest"))
23 from selftesthelpers import *
24 import subprocess
26 samba4srcdir = source4dir()
27 samba4bindir = bindir()
28 smb4torture = binpath("smbtorture4")
29 smb4torture_testsuite_list = subprocess.Popen([smb4torture, "--list-suites"], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate("")[0].splitlines()
30 validate = os.getenv("VALIDATE", "")
31 if validate:
32 validate_list = [validate]
33 else:
34 validate_list = []
36 def plansmbtorturetestsuite(name, env, options, modname=None):
37 if modname is None:
38 modname = "samba4.%s" % name
39 if isinstance(options, list):
40 options = " ".join(options)
41 cmdline = "%s $LISTOPT %s %s" % (valgrindify(smb4torture), options, name)
42 plantestsuite_loadlist(modname, env, cmdline)
44 def smb4torture_testsuites(prefix):
45 return filter(lambda x: x.startswith(prefix), smb4torture_testsuite_list)
47 subprocess.call([smb4torture, "-V"])
49 bbdir = os.path.join(srcdir(), "testprogs/blackbox")
51 configuration = "--configfile=$SMB_CONF_PATH"
53 torture_options = [configuration, "--maximum-runtime=$SELFTEST_MAXTIME", "--target=samba4", "--basedir=$SELFTEST_TMPDIR"]
54 if not os.getenv("SELFTEST_VERBOSE"):
55 torture_options.append("--option=torture:progress=no")
56 torture_options.append("--format=subunit")
57 if os.getenv("SELFTEST_QUICK"):
58 torture_options.append("--option=torture:quick=yes")
59 smb4torture += " " + " ".join(torture_options)
61 print "OPTIONS %s" % " ".join(torture_options)
63 # Simple tests for LDAP and CLDAP
64 for options in ['-U"$USERNAME%$PASSWORD" --option=socket:testnonblock=true', '-U"$USERNAME%$PASSWORD"', '-U"$USERNAME%$PASSWORD" -k yes', '-U"$USERNAME%$PASSWORD" -k no', '-U"$USERNAME%$PASSWORD" -k no --sign', '-U"$USERNAME%$PASSWORD" -k no --encrypt', '-U"$USERNAME%$PASSWORD" -k yes --encrypt', '-U"$USERNAME%$PASSWORD" -k yes --sign']:
65 plantestsuite("samba4.ldb.ldap with options %s(dc)" % options, "dc", "%s/test_ldb.sh ldap $SERVER %s" % (bbdir, options))
67 # see if we support ADS on the Samba3 side
68 try:
69 config_h = os.environ["CONFIG_H"]
70 except KeyError:
71 config_h = os.path.join(samba4bindir, "default/include/config.h")
73 f = open(config_h, 'r')
74 try:
75 # The other parts of the HAVE_ADS test are always supplied by the top level build
76 have_ads_support = ("HAVE_LDAP 1" in f.read())
77 finally:
78 f.close()
80 # see if we support ldaps
81 f = open(config_h, 'r')
82 try:
83 have_tls_support = ("ENABLE_GNUTLS 1" in f.read())
84 finally:
85 f.close()
87 if have_tls_support:
88 for options in ['-U"$USERNAME%$PASSWORD"']:
89 plantestsuite("samba4.ldb.ldaps with options %s(dc)" % options, "dc",
90 "%s/test_ldb.sh ldaps $SERVER_IP %s" % (bbdir, options))
92 for options in ['-U"$USERNAME%$PASSWORD"']:
93 plantestsuite("samba4.ldb.ldapi with options %s(dc:local)" % options, "dc:local",
94 "%s/test_ldb.sh ldapi $PREFIX_ABS/dc/private/ldapi %s" % (bbdir, options))
96 for t in smb4torture_testsuites("ldap."):
97 plansmbtorturetestsuite(t, "dc", '-U"$USERNAME%$PASSWORD" //$SERVER_IP/_none_')
99 ldbdir = os.path.join(srcdir(), "lib/ldb")
100 # Don't run LDB tests when using system ldb, as we won't have ldbtest installed
101 if os.path.exists(os.path.join(samba4bindir, "ldbtest")):
102 plantestsuite("ldb.base", "none", "%s/tests/test-tdb.sh" % ldbdir,
103 allow_empty_output=True)
104 else:
105 skiptestsuite("ldb.base", "Using system LDB, ldbtest not available")
107 # Tests for RPC
109 # add tests to this list as they start passing, so we test
110 # that they stay passing
111 ncacn_np_tests = ["rpc.schannel", "rpc.join", "rpc.lsa", "rpc.dssetup", "rpc.altercontext", "rpc.multibind", "rpc.netlogon", "rpc.handles", "rpc.samsync", "rpc.samba3-sessionkey", "rpc.samba3-getusername", "rpc.samba3-lsa", "rpc.samba3-bind", "rpc.samba3-netlogon", "rpc.asyncbind", "rpc.lsalookup", "rpc.lsa-getuser", "rpc.schannel2", "rpc.authcontext"]
112 ncalrpc_tests = ["rpc.schannel", "rpc.join", "rpc.lsa", "rpc.dssetup", "rpc.altercontext", "rpc.multibind", "rpc.netlogon", "rpc.drsuapi", "rpc.asyncbind", "rpc.lsalookup", "rpc.lsa-getuser", "rpc.schannel2", "rpc.authcontext"]
113 drs_rpc_tests = smb4torture_testsuites("drs.rpc")
114 ncacn_ip_tcp_tests = ["rpc.schannel", "rpc.join", "rpc.lsa", "rpc.dssetup", "rpc.altercontext", "rpc.multibind", "rpc.netlogon", "rpc.handles", "rpc.asyncbind", "rpc.lsalookup", "rpc.lsa-getuser", "rpc.schannel2", "rpc.authcontext", "rpc.objectuuid"] + drs_rpc_tests
115 slow_ncacn_np_tests = ["rpc.samlogon", "rpc.samr.users", "rpc.samr.large-dc", "rpc.samr.users.privileges", "rpc.samr.passwords", "rpc.samr.passwords.pwdlastset"]
116 slow_ncacn_ip_tcp_tests = ["rpc.samr", "rpc.cracknames"]
118 all_rpc_tests = ncalrpc_tests + ncacn_np_tests + ncacn_ip_tcp_tests + slow_ncacn_np_tests + slow_ncacn_ip_tcp_tests + ["rpc.lsa.secrets", "rpc.pac", "rpc.samba3-sharesec", "rpc.countcalls"]
120 # Make sure all tests get run
121 rpc_tests = smb4torture_testsuites("rpc.")
122 auto_rpc_tests = filter(lambda t: t not in all_rpc_tests, rpc_tests)
124 for bindoptions in ["seal,padcheck"] + validate_list + ["bigendian"]:
125 for transport in ["ncalrpc", "ncacn_np", "ncacn_ip_tcp"]:
126 env = "dc"
127 if transport == "ncalrpc":
128 tests = ncalrpc_tests
129 env = "dc:local"
130 elif transport == "ncacn_np":
131 tests = ncacn_np_tests
132 elif transport == "ncacn_ip_tcp":
133 tests = ncacn_ip_tcp_tests
134 for t in tests:
135 plansmbtorturetestsuite(t, env, ["%s:$SERVER[%s]" % (transport, bindoptions), '-U$USERNAME%$PASSWORD', '-W', '$DOMAIN'], "samba4.%s on %s with %s" % (t, transport, bindoptions))
136 plansmbtorturetestsuite('rpc.samba3-sharesec', env, ["%s:$SERVER[%s]" % (transport, bindoptions), '-U$USERNAME%$PASSWORD', '-W', '$DOMAIN', '--option=torture:share=tmp'], "samba4.rpc.samba3.sharesec on %s with %s" % (transport, bindoptions))
138 #Plugin S4 DC tests (confirms named pipe auth forwarding). This can be expanded once kerberos is supported in the plugin DC
140 if have_ads_support:
141 for bindoptions in ["seal,padcheck"] + validate_list + ["bigendian"]:
142 for t in ncacn_np_tests:
143 env = "plugin_s4_dc"
144 transport = "ncacn_np"
145 plansmbtorturetestsuite(t, env, ["%s:$SERVER[%s]" % (transport, bindoptions), '-U$USERNAME%$PASSWORD', '-W', '$DOMAIN', '-k', 'no'], "samba4.%s with %s" % (t, bindoptions))
147 for bindoptions in [""] + validate_list + ["bigendian"]:
148 for t in auto_rpc_tests:
149 plansmbtorturetestsuite(t, "dc", ["$SERVER[%s]" % bindoptions, '-U$USERNAME%$PASSWORD', '-W', '$DOMAIN'], "samba4.%s with %s" % (t, bindoptions))
151 t = "rpc.countcalls"
152 plansmbtorturetestsuite(t, "dc:local", ["$SERVER[%s]" % bindoptions, '-U$USERNAME%$PASSWORD', '-W', '$DOMAIN'], modname="samba4.%s" % t)
154 for transport in ["ncacn_np", "ncacn_ip_tcp"]:
155 env = "dc"
156 if transport == "ncacn_np":
157 tests = slow_ncacn_np_tests
158 elif transport == "ncacn_ip_tcp":
159 tests = slow_ncacn_ip_tcp_tests
160 for t in tests:
161 plansmbtorturetestsuite(t, env, ["%s:$SERVER" % transport, '-U$USERNAME%$PASSWORD', '-W', '$DOMAIN'], "samba4.%s on %s" % (t, transport))
163 # Tests for the DFS referral calls implementation
164 for t in smb4torture_testsuites("dfs."):
165 plansmbtorturetestsuite(t, "dc", '//$SERVER/ipc\$ -U$USERNAME%$PASSWORD')
166 plansmbtorturetestsuite(t, "plugin_s4_dc", '//$SERVER/ipc\$ -U$USERNAME%$PASSWORD')
168 # Tests for the NET API (net.api.become.dc tested below against all the roles)
169 net_tests = filter(lambda x: "net.api.become.dc" not in x, smb4torture_testsuites("net."))
170 for t in net_tests:
171 plansmbtorturetestsuite(t, "dc", '$SERVER[%s] -U$USERNAME%%$PASSWORD -W $DOMAIN' % validate)
173 # Tests for session keys and encryption of RPC pipes
174 # FIXME: Integrate these into a single smbtorture test
176 transport = "ncacn_np"
177 for ntlmoptions in [
178 "-k no --option=usespnego=yes",
179 "-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no",
180 "-k no --option=usespnego=yes --option=ntlmssp_client:56bit=yes",
181 "-k no --option=usespnego=yes --option=ntlmssp_client:56bit=no",
182 "-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=yes",
183 "-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=no",
184 "-k no --option=usespnego=yes --option=clientntlmv2auth=yes",
185 "-k no --option=usespnego=yes --option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no",
186 "-k no --option=usespnego=yes --option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=yes",
187 "-k no --option=usespnego=no --option=clientntlmv2auth=yes",
188 "-k no --option=gensec:spnego=no --option=clientntlmv2auth=yes",
189 "-k no --option=usespnego=no"]:
190 name = "rpc.lsa.secrets on %s with with %s" % (transport, ntlmoptions)
191 plansmbtorturetestsuite('rpc.lsa.secrets', "dc", ["%s:$SERVER[]" % (transport), ntlmoptions, '-U$USERNAME%$PASSWORD', '-W', '$DOMAIN', '--option=gensec:target_hostname=$NETBIOSNAME'], "samba4.%s" % name)
193 transports = ["ncacn_np", "ncacn_ip_tcp"]
195 #Kerberos varies between functional levels, so it is important to check this on all of them
196 for env in ["dc", "fl2000dc", "fl2003dc", "fl2008r2dc"]:
197 transport = "ncacn_np"
198 plansmbtorturetestsuite('rpc.pac', env, ["%s:$SERVER[]" % (transport, ), '-U$USERNAME%$PASSWORD', '-W', '$DOMAIN'], "samba4.rpc.pac on %s" % (transport,))
199 for transport in transports:
200 plansmbtorturetestsuite('rpc.lsa.secrets', env, ["%s:$SERVER[]" % (transport, ), '-k', 'yes', '-U$USERNAME%$PASSWORD', '-W', '$DOMAIN', '--option=gensec:target_hostname=$NETBIOSNAME', 'rpc.lsa.secrets'], "samba4.rpc.lsa.secrets on %s with Kerberos" % (transport,))
201 plansmbtorturetestsuite('rpc.lsa.secrets', env, ["%s:$SERVER[]" % (transport, ), '-k', 'yes', '-U$USERNAME%$PASSWORD', '-W', '$DOMAIN', "--option=clientusespnegoprincipal=yes", '--option=gensec:target_hostname=$NETBIOSNAME'], "samba4.rpc.lsa.secrets on %s with Kerberos - use target principal" % (transport,))
202 plansmbtorturetestsuite('rpc.lsa.secrets.none*', env, ["%s:$SERVER" % transport, '-k', 'yes', '-U$USERNAME%$PASSWORD', '-W', '$DOMAIN', "--option=gensec:fake_gssapi_krb5=yes", '--option=gensec:gssapi_krb5=no', '--option=gensec:target_hostname=$NETBIOSNAME'], "samba4.rpc.lsa.secrets on %s with Kerberos - use Samba3 style login" % transport)
203 plansmbtorturetestsuite('rpc.lsa.secrets.none*', env, ["%s:$SERVER" % transport, '-k', 'yes', '-U$USERNAME%$PASSWORD', '-W', '$DOMAIN', "--option=clientusespnegoprincipal=yes", '--option=gensec:fake_gssapi_krb5=yes', '--option=gensec:gssapi_krb5=no', '--option=gensec:target_hostname=$NETBIOSNAME'], "samba4.rpc.lsa.secrets on %s with Kerberos - use Samba3 style login, use target principal" % transport)
204 plansmbtorturetestsuite('rpc.echo', env, ["%s:$SERVER[]" % (transport,), '-U$USERNAME%$PASSWORD', '-W', '$DOMAIN'], "samba4.rpc.echo on %s" % (transport, ))
206 # Echo tests test bulk Kerberos encryption of DCE/RPC
207 for bindoptions in ["connect", "spnego", "spnego,sign", "spnego,seal"] + validate_list + ["padcheck", "bigendian", "bigendian,seal"]:
208 echooptions = "--option=socket:testnonblock=True --option=torture:quick=yes -k yes"
209 plansmbtorturetestsuite('rpc.echo', env, ["%s:$SERVER[%s]" % (transport, bindoptions), echooptions, '-U$USERNAME%$PASSWORD', '-W', '$DOMAIN'], "samba4.rpc.echo on %s with %s and %s" % (transport, bindoptions, echooptions))
210 plansmbtorturetestsuite("net.api.become.dc", env, '$SERVER[%s] -U$USERNAME%%$PASSWORD -W $DOMAIN' % validate)
212 for bindoptions in ["sign", "seal"]:
213 plansmbtorturetestsuite('rpc.backupkey', "dc", ["ncacn_np:$SERVER[%s]" % ( bindoptions), '-U$USERNAME%$PASSWORD', '-W', '$DOMAIN'], "samba4.rpc.backupkey with %s" % (bindoptions))
215 for transport in transports:
216 for bindoptions in ["sign", "seal"]:
217 for ntlmoptions in [
218 "--option=ntlmssp_client:ntlm2=yes --option=torture:quick=yes",
219 "--option=ntlmssp_client:ntlm2=no --option=torture:quick=yes",
220 "--option=ntlmssp_client:ntlm2=yes --option=ntlmssp_client:128bit=no --option=torture:quick=yes",
221 "--option=ntlmssp_client:ntlm2=no --option=ntlmssp_client:128bit=no --option=torture:quick=yes",
222 "--option=ntlmssp_client:ntlm2=yes --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes",
223 "--option=ntlmssp_client:ntlm2=no --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes",
224 "--option=clientntlmv2auth=yes --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes",
225 "--option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:keyexchange=yes --option=torture:quick=yes",
226 "--option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes"]:
227 if transport == "ncalrpc":
228 env = "dc:local"
229 else:
230 env = "dc"
231 plansmbtorturetestsuite('rpc.echo', env, ["%s:$SERVER[%s]" % (transport, bindoptions), ntlmoptions, '-U$USERNAME%$PASSWORD', '-W', '$DOMAIN'], "samba4.rpc.echo on %s with %s and %s" % (transport, bindoptions, ntlmoptions))
233 plansmbtorturetestsuite('rpc.echo', "dc", ['ncacn_np:$SERVER[smb2]', '-U$USERNAME%$PASSWORD', '-W', '$DOMAIN'], "samba4.rpc.echo on ncacn_np over smb2")
235 plansmbtorturetestsuite('ntp.signd', "dc:local", ['ncacn_np:$SERVER', '-U$USERNAME%$PASSWORD', '-W', '$DOMAIN'], "samba4.ntp.signd")
237 nbt_tests = smb4torture_testsuites("nbt.")
238 for t in nbt_tests:
239 plansmbtorturetestsuite(t, "dc", "//$SERVER/_none_ -U\"$USERNAME%$PASSWORD\"")
241 # Tests against the NTVFS POSIX backend
242 ntvfsargs = ["--option=torture:sharedelay=10000", "--option=torture:oplocktimeout=3", "--option=torture:writetimeupdatedelay=50000"]
244 smb2 = smb4torture_testsuites("smb2.")
245 #The QFILEINFO-IPC test needs to be on ipc$
246 raw = filter(lambda x: "raw.qfileinfo.ipc" not in x, smb4torture_testsuites("raw."))
247 base = smb4torture_testsuites("base.")
249 netapi = smb4torture_testsuites("netapi.")
251 libsmbclient = smb4torture_testsuites("libsmbclient.")
253 for t in base + raw + smb2 + netapi + libsmbclient:
254 plansmbtorturetestsuite(t, "dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD' + " " + " ".join(ntvfsargs))
256 plansmbtorturetestsuite("raw.qfileinfo.ipc", "dc", '//$SERVER/ipc\$ -U$USERNAME%$PASSWORD')
258 for t in smb4torture_testsuites("rap."):
259 plansmbtorturetestsuite(t, "dc", '//$SERVER/IPC\$ -U$USERNAME%$PASSWORD')
261 # Tests against the NTVFS CIFS backend
262 for t in base + raw:
263 plansmbtorturetestsuite(t, "dc", ['//$NETBIOSNAME/cifs', '-U$USERNAME%$PASSWORD', '--kerberos=yes'] + ntvfsargs, modname="samba4.ntvfs.cifs.krb5.%s" % t)
265 # Test NTVFS CIFS backend with S4U2Self and S4U2Proxy
266 t = "base.unlink"
267 plansmbtorturetestsuite(t, "dc", ['//$NETBIOSNAME/cifs', '-U$USERNAME%$PASSWORD', '--kerberos=no'] + ntvfsargs, "samba4.ntvfs.cifs.ntlm.%s" % t)
268 plansmbtorturetestsuite(t, "rpc_proxy", ['//$NETBIOSNAME/cifs_to_dc', '-U$DC_USERNAME%$DC_PASSWORD', '--kerberos=yes'] + ntvfsargs, "samba4.ntvfs.cifs.krb5.%s" % t)
269 plansmbtorturetestsuite(t, "rpc_proxy", ['//$NETBIOSNAME/cifs_to_dc', '-U$DC_USERNAME%$DC_PASSWORD', '--kerberos=no'] + ntvfsargs, "samba4.ntvfs.cifs.ntlm.%s" % t)
271 plansmbtorturetestsuite('echo.udp', 'dc:local', '//$SERVER/whatever')
273 # Local tests
274 for t in smb4torture_testsuites("local."):
275 plansmbtorturetestsuite(t, "none", "ncalrpc:")
277 # Confirm these tests with the system iconv too
278 for t in ["local.convert_string_handle", "local.convert_string", "local.ndr"]:
279 options = "ncalrpc: --option='iconv:use_builtin_handlers=false'"
280 plansmbtorturetestsuite(t, "none", options,
281 modname="samba4.%s.system.iconv" % t)
283 tdbtorture4 = binpath("tdbtorture")
284 if os.path.exists(tdbtorture4):
285 plantestsuite("tdb.stress", "none", valgrindify(tdbtorture4))
286 else:
287 skiptestsuite("tdb.stress", "Using system TDB, tdbtorture not available")
289 plansmbtorturetestsuite("drs.unit", "none", "ncalrpc:")
291 # Pidl tests
292 for f in sorted(os.listdir(os.path.join(samba4srcdir, "../pidl/tests"))):
293 if f.endswith(".pl"):
294 planperltestsuite("pidl.%s" % f[:-3], os.path.normpath(os.path.join(samba4srcdir, "../pidl/tests", f)))
296 # Blackbox Tests:
297 # tests that interact directly with the command-line tools rather than using
298 # the API. These mainly test that the various command-line options of commands
299 # work correctly.
301 planpythontestsuite("none", "samba.tests.blackbox.ndrdump")
302 planpythontestsuite("none", "samba.tests.source")
303 plantestsuite("samba4.blackbox.samba_tool(dc:local)", "dc:local", [os.path.join(samba4srcdir, "utils/tests/test_samba_tool.sh"), '$SERVER', "$USERNAME", "$PASSWORD", "$DOMAIN"])
304 plantestsuite("samba4.blackbox.pkinit(dc:local)", "dc:local", [os.path.join(bbdir, "test_pkinit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', "aes256-cts-hmac-sha1-96", configuration])
305 plantestsuite("samba4.blackbox.kinit(dc:local)", "dc:local", [os.path.join(bbdir, "test_kinit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', "aes256-cts-hmac-sha1-96", configuration])
306 plantestsuite("samba4.blackbox.kinit(fl2000dc:local)", "fl2000dc:local", [os.path.join(bbdir, "test_kinit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', "arcfour-hmac-md5", configuration])
307 plantestsuite("samba4.blackbox.kinit(fl2008r2dc:local)", "fl2008r2dc:local", [os.path.join(bbdir, "test_kinit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', "aes256-cts-hmac-sha1-96", configuration])
308 plantestsuite("samba4.blackbox.ktpass(dc)", "dc", [os.path.join(bbdir, "test_ktpass.sh"), '$PREFIX'])
309 plantestsuite("samba4.blackbox.passwords(dc:local)", "dc:local", [os.path.join(bbdir, "test_passwords.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', "$PREFIX"])
310 plantestsuite("samba4.blackbox.export.keytab(dc:local)", "dc:local", [os.path.join(bbdir, "test_export_keytab.sh"), '$SERVER', '$USERNAME', '$REALM', '$DOMAIN', "$PREFIX"])
311 plantestsuite("samba4.blackbox.cifsdd(dc)", "dc", [os.path.join(samba4srcdir, "client/tests/test_cifsdd.sh"), '$SERVER', '$USERNAME', '$PASSWORD', "$DOMAIN"])
312 plantestsuite("samba4.blackbox.nmblookup(dc)", "dc", [os.path.join(samba4srcdir, "utils/tests/test_nmblookup.sh"), '$NETBIOSNAME', '$NETBIOSALIAS', '$SERVER', '$SERVER_IP'])
313 plantestsuite("samba4.blackbox.locktest(dc)", "dc", [os.path.join(samba4srcdir, "torture/tests/test_locktest.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$DOMAIN', '$PREFIX'])
314 plantestsuite("samba4.blackbox.masktest", "dc", [os.path.join(samba4srcdir, "torture/tests/test_masktest.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$DOMAIN', '$PREFIX'])
315 plantestsuite("samba4.blackbox.gentest(dc)", "dc", [os.path.join(samba4srcdir, "torture/tests/test_gentest.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$DOMAIN', "$PREFIX"])
316 plantestsuite("samba4.blackbox.wbinfo(dc:local)", "dc:local", [os.path.join(samba4srcdir, "../nsswitch/tests/test_wbinfo.sh"), '$DOMAIN', '$USERNAME', '$PASSWORD', "dc"])
317 plantestsuite("samba4.blackbox.wbinfo(s4member:local)", "s4member:local", [os.path.join(samba4srcdir, "../nsswitch/tests/test_wbinfo.sh"), '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', "s4member"])
318 plantestsuite("samba4.blackbox.chgdcpass(dc)", "dc", [os.path.join(bbdir, "test_chgdcpass.sh"), '$SERVER', "LOCALDC\$", '$REALM', '$DOMAIN', '$PREFIX', "aes256-cts-hmac-sha1-96", '$SELFTEST_PREFIX/dc'])
320 # Tests using the "Simple" NTVFS backend
321 for t in ["base.rw1"]:
322 plansmbtorturetestsuite(t, "dc", ["//$SERVER/simple", '-U$USERNAME%$PASSWORD'], modname="samba4.ntvfs.simple.%s" % t)
324 # Domain S4member Tests
325 plansmbtorturetestsuite('rpc.echo', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], "samba4.rpc.echo against s4member server with local creds")
326 plansmbtorturetestsuite('rpc.echo', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'], "samba4.rpc.echo against s4member server with domain creds")
327 plansmbtorturetestsuite('rpc.samr', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], "samba4.rpc.samr against s4member server with local creds")
328 plansmbtorturetestsuite('rpc.samr.users', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], "samba4.rpc.samr.users against s4member server with local creds",)
329 plansmbtorturetestsuite('rpc.samr.passwords', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], "samba4.rpc.samr.passwords against s4member server with local creds")
330 plantestsuite("samba4.blackbox.smbclient against s4member server with local creds", "s4member", [os.path.join(samba4srcdir, "client/tests/test_smbclient.sh"), '$NETBIOSNAME', '$USERNAME', '$PASSWORD', '$NETBIOSNAME', '$PREFIX'])
332 # RPC Proxy
333 plansmbtorturetestsuite("rpc.echo", "rpc_proxy", ['ncacn_ip_tcp:$NETBIOSNAME', '-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'], modname="samba4.rpc.echo against rpc proxy with domain creds")
335 # Tests SMB signing
336 for mech in [
337 "-k no",
338 "-k no --option=usespnego=no",
339 "-k no --option=gensec:spengo=no",
340 "-k yes",
341 "-k yes --option=gensec:fake_gssapi_krb5=yes --option=gensec:gssapi_krb5=no"]:
342 for signing in ["--signing=on", "--signing=required"]:
343 signoptions = "%s %s" % (mech, signing)
344 name = "smb.signing on with %s" % signoptions
345 plansmbtorturetestsuite('base.xcopy', "dc", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$USERNAME%$PASSWORD'], modname="samba4.%s" % name)
347 for mech in [
348 "-k no",
349 "-k no --option=usespnego=no",
350 "-k no --option=gensec:spengo=no",
351 "-k yes"]:
352 signoptions = "%s --signing=off" % mech
353 name = "smb.signing disabled on with %s" % signoptions
354 plansmbtorturetestsuite('base.xcopy', "s4member", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$DC_USERNAME%$DC_PASSWORD'], "samba4.%s domain-creds" % name)
355 if have_ads_support:
356 plansmbtorturetestsuite('base.xcopy', "s3member", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$DC_USERNAME%$DC_PASSWORD'], "samba4.%s domain-creds" % name)
357 plansmbtorturetestsuite('base.xcopy', "plugin_s4_dc", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$USERNAME%$PASSWORD'], "samba4.%s" % name)
358 plansmbtorturetestsuite('base.xcopy', "plugin_s4_dc",
359 ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$DC_USERNAME%$DC_PASSWORD'], "samba4.%s administrator" % name)
361 for mech in [
362 "-k no",
363 "-k no --option=usespnego=no",
364 "-k no --option=gensec:spengo=no"]:
365 signoptions = "%s --signing=off" % mech
366 plansmbtorturetestsuite('base.xcopy', "s4member", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], modname="samba4.smb.signing on with %s local-creds" % signoptions)
368 plansmbtorturetestsuite('base.xcopy', "dc", ['//$NETBIOSNAME/xcopy_share', '-k', 'no', '--signing=yes', '-U%'], modname="samba4.smb.signing --signing=yes anon")
369 plansmbtorturetestsuite('base.xcopy', "dc", ['//$NETBIOSNAME/xcopy_share', '-k', 'no', '--signing=required', '-U%'], modname="samba4.smb.signing --signing=required anon")
370 plansmbtorturetestsuite('base.xcopy', "s4member", ['//$NETBIOSNAME/xcopy_share', '-k', 'no', '--signing=no', '-U%'], modname="samba4.smb.signing --signing=no anon")
373 wb_opts = ["--option=\"torture:strict mode=no\"", "--option=\"torture:timelimit=1\"", "--option=\"torture:winbindd_separator=/\"", "--option=\"torture:winbindd_netbios_name=$SERVER\"", "--option=\"torture:winbindd_netbios_domain=$DOMAIN\""]
375 winbind_struct_tests = smb4torture_testsuites("winbind.struct")
376 winbind_ndr_tests = smb4torture_testsuites("winbind.ndr")
377 for env in ["dc", "s4member"]:
378 for t in winbind_struct_tests:
379 plansmbtorturetestsuite(t, env, "%s //_none_/_none_" % " ".join(wb_opts))
381 for t in winbind_ndr_tests:
382 plansmbtorturetestsuite(t, env, "%s //_none_/_none_" % " ".join(wb_opts))
384 nsstest4 = binpath("nsstest")
385 if os.path.exists(nsstest4):
386 plantestsuite("samba4.nss.test using winbind(s4member)", "s4member", [valgrindify(nsstest4), os.path.join(samba4bindir, "shared/libnss_winbind.so")])
387 else:
388 skiptestsuite("samba4.nss.test using winbind(s4member)", "nsstest not available")
390 subunitrun = valgrindify(python) + " " + os.path.join(samba4srcdir, "scripting/bin/subunitrun")
391 def planoldpythontestsuite(env, module, name=None, extra_path=[], environ={}, extra_args=[]):
392 environ = dict(environ)
393 py_path = list(extra_path)
394 if py_path:
395 environ["PYTHONPATH"] = ":".join(["$PYTHONPATH"] + py_path)
396 args = ["%s=%s" % item for item in environ.iteritems()]
397 args += [subunitrun, "$LISTOPT", module]
398 args += extra_args
399 if name is None:
400 name = module
401 plantestsuite(name, env, args)
403 planpythontestsuite("none", "api", name="ldb.python", extra_path=['lib/ldb/tests/python'])
404 planpythontestsuite("none", "samba.tests.credentials")
405 planoldpythontestsuite("dc:local", "samba.tests.gensec", extra_args=['-U"$USERNAME%$PASSWORD"'])
406 planpythontestsuite("none", "samba.tests.registry")
407 planoldpythontestsuite("none", "simple", extra_path=["%s/lib/tdb/python/tests" % srcdir()], name="tdb.python")
408 planpythontestsuite("none", "samba.tests.auth")
409 planpythontestsuite("none", "samba.tests.getopt")
410 planpythontestsuite("none", "samba.tests.security")
411 planpythontestsuite("none", "samba.tests.dcerpc.misc")
412 planpythontestsuite("none", "samba.tests.param")
413 planpythontestsuite("none", "samba.tests.upgrade")
414 planpythontestsuite("none", "samba.tests.core")
415 planpythontestsuite("none", "samba.tests.provision")
416 planpythontestsuite("none", "samba.tests.samba3")
417 planpythontestsuite("none", "samba.tests.strings")
418 planpythontestsuite("dc:local", "samba.tests.dcerpc.sam")
419 planpythontestsuite("dc:local", "samba.tests.dsdb")
420 planpythontestsuite("none", "samba.tests.netcmd")
421 planpythontestsuite("dc:local", "samba.tests.dcerpc.bare")
422 planpythontestsuite("dc:local", "samba.tests.dcerpc.unix")
423 planpythontestsuite("none", "samba.tests.dcerpc.rpc_talloc")
424 planpythontestsuite("none", "samba.tests.samdb")
425 planpythontestsuite("none", "samba.tests.hostconfig")
426 planpythontestsuite("none", "samba.tests.messaging")
427 planpythontestsuite("none", "samba.tests.samba3sam")
429 planpythontestsuite("dc:local", "samba.tests.samba_tool.timecmd")
430 planpythontestsuite("dc:local", "samba.tests.samba_tool.user")
432 planpythontestsuite("none", "subunit")
433 planpythontestsuite("dc:local", "samba.tests.dcerpc.rpcecho")
434 planoldpythontestsuite("dc:local", "samba.tests.dcerpc.registry", extra_args=['-U"$USERNAME%$PASSWORD"'])
435 planoldpythontestsuite("dc", "samba.tests.dcerpc.dnsserver", extra_args=['-U"$USERNAME%$PASSWORD"'])
436 plantestsuite("samba4.ldap.python(dc)", "dc", [python, os.path.join(samba4srcdir, "dsdb/tests/python/ldap.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '-W', '$DOMAIN'])
437 plantestsuite("samba4.tokengroups.python(dc)", "dc:local", [python, os.path.join(samba4srcdir, "dsdb/tests/python/token_group.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '-W', '$DOMAIN'])
438 plantestsuite("samba4.sam.python(dc)", "dc", [python, os.path.join(samba4srcdir, "dsdb/tests/python/sam.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '-W', '$DOMAIN'])
439 planoldpythontestsuite("dc", "dsdb_schema_info",
440 extra_path=[os.path.join(samba4srcdir, 'dsdb/tests/python')],
441 name="samba4.schemaInfo.python(dc)",
442 extra_args=['-U"$DOMAIN/$DC_USERNAME%$DC_PASSWORD"'])
443 plantestsuite("samba4.urgent_replication.python(dc)", "dc:local", [python, os.path.join(samba4srcdir, "dsdb/tests/python/urgent_replication.py"), '$PREFIX_ABS/dc/private/sam.ldb'], allow_empty_output=True)
444 plantestsuite("samba4.ldap.dirsync.python(dc)", "dc", [python, os.path.join(samba4srcdir, "dsdb/tests/python/dirsync.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '-W', '$DOMAIN'])
445 plantestsuite("samba4.ldap.sites.python(dc)", "dc", [python, os.path.join(samba4srcdir, "dsdb/tests/python/sites.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '-W', '$DOMAIN'])
446 for env in ["dc", "fl2000dc", "fl2003dc", "fl2008r2dc"]:
447 plantestsuite("samba4.ldap_schema.python(%s)" % env, env, [python, os.path.join(samba4srcdir, "dsdb/tests/python/ldap_schema.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '-W', '$DOMAIN'])
448 plantestsuite("samba4.ldap.possibleInferiors.python(%s)" % env, env, [python, os.path.join(samba4srcdir, "dsdb/samdb/ldb_modules/tests/possibleinferiors.py"), "ldap://$SERVER", '-U"$USERNAME%$PASSWORD"', "-W", "$DOMAIN"])
449 plantestsuite("samba4.ldap.secdesc.python(%s)" % env, env, [python, os.path.join(samba4srcdir, "dsdb/tests/python/sec_descriptor.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '-W', '$DOMAIN'])
450 plantestsuite("samba4.ldap.acl.python(%s)" % env, env, [python, os.path.join(samba4srcdir, "dsdb/tests/python/acl.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '-W', '$DOMAIN'])
451 if env != "fl2000dc":
452 # This test makes excessive use of the "userPassword" attribute which
453 # isn't available on DCs with Windows 2000 domain function level -
454 # therefore skip it in that configuration
455 plantestsuite("samba4.ldap.passwords.python(%s)" % env, env, [python, os.path.join(samba4srcdir, "dsdb/tests/python/passwords.py"), "$SERVER", '-U"$USERNAME%$PASSWORD"', "-W", "$DOMAIN"])
456 planpythontestsuite("dc:local", "samba.tests.upgradeprovisionneeddc")
457 planpythontestsuite("none", "samba.tests.upgradeprovision")
458 planpythontestsuite("none", "samba.tests.xattr")
459 planpythontestsuite("none", "samba.tests.ntacls")
460 plantestsuite("samba4.deletetest.python(dc)", "dc", ['PYTHONPATH="$PYTHONPATH:%s/lib/subunit/python:%s/lib/testtools"' % (srcdir(), srcdir()),
461 python, os.path.join(samba4srcdir, "dsdb/tests/python/deletetest.py"),
462 '$SERVER', '-U"$USERNAME%$PASSWORD"', '-W', '$DOMAIN'])
463 planpythontestsuite("none", "bindings", extra_path=["%s/lib/policy/tests/python" % samba4srcdir], name="samba4.policy.python")
464 plantestsuite("samba4.blackbox.samba3dump", "none", [python, os.path.join(samba4srcdir, "scripting/bin/samba3dump"), os.path.join(samba4srcdir, "../testdata/samba3")], allow_empty_output=True)
465 plantestsuite("samba4.blackbox.upgrade", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_s3upgrade.sh"), '$PREFIX/provision'])
466 plantestsuite("samba4.blackbox.provision.py", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_provision.sh"), '$PREFIX/provision'])
467 plantestsuite("samba4.blackbox.upgradeprovision.py", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_upgradeprovision.sh"), '$PREFIX/provision'])
468 plantestsuite("samba4.blackbox.setpassword.py", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_setpassword.sh"), '$PREFIX/provision'])
469 plantestsuite("samba4.blackbox.newuser.py", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_newuser.sh"), '$PREFIX/provision'])
470 plantestsuite("samba4.blackbox.group.py", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_group.sh"), '$PREFIX/provision'])
471 plantestsuite("samba4.blackbox.spn.py(dc:local)", "dc:local", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_spn.sh"), '$PREFIX/dc'])
472 plantestsuite("samba4.ldap.bind(dc)", "dc", [python, os.path.join(srcdir(), "auth/credentials/tests/bind.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"'])
474 # DRS python tests
475 planoldpythontestsuite("vampire_dc", "samba.tests.blackbox.samba_tool_drs",
476 environ={'DC1': '$DC_SERVER', 'DC2': '$VAMPIRE_DC_SERVER'},
477 extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
478 planoldpythontestsuite("vampire_dc", "replica_sync",
479 extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
480 name="samba4.drs.replica_sync.python(vampire_dc)",
481 environ={'DC1': '$DC_SERVER', 'DC2': '$VAMPIRE_DC_SERVER'},
482 extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
483 planoldpythontestsuite("vampire_dc", "delete_object",
484 extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
485 name="samba4.drs.delete_object.python(vampire_dc)",
486 environ={'DC1': '$DC_SERVER', 'DC2': '$VAMPIRE_DC_SERVER'},
487 extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
488 planoldpythontestsuite("vampire_dc", "fsmo",
489 name="samba4.drs.fsmo.python(vampire_dc)",
490 extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
491 environ={'DC1': "$DC_SERVER", 'DC2': "$VAMPIRE_DC_SERVER"},
492 extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
493 planoldpythontestsuite("vampire_dc", "repl_schema",
494 extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
495 name="samba4.drs.repl_schema.python(vampire_dc)",
496 environ={'DC1': "$DC_SERVER", 'DC2': '$VAMPIRE_DC_SERVER'},
497 extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
499 # This makes sure we test the rid allocation code
500 t = "rpc.samr.large-dc"
501 plansmbtorturetestsuite(t, "vampire_dc", ['$SERVER', '-U$USERNAME%$PASSWORD', '-W', '$DOMAIN'], modname=("samba4.%s.one" % t))
502 plansmbtorturetestsuite(t, "vampire_dc", ['$SERVER', '-U$USERNAME%$PASSWORD', '-W', '$DOMAIN'], modname="samba4.%s.two" % t)
504 # some RODC testing
505 for env in ['rodc']:
506 plansmbtorturetestsuite('rpc.echo', env, ['ncacn_np:$SERVER', "-k", "yes", '-U$USERNAME%$PASSWORD', '-W' '$DOMAIN'], modname="samba4.rpc.echo")
507 plansmbtorturetestsuite('rpc.echo', "%s:local" % env, ['ncacn_np:$SERVER', "-k", "yes", '-P', '-W' '$DOMAIN'], modname="samba4.rpc.echo")
508 plantestsuite("samba4.blackbox.provision-backend", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_provision-backend.sh"), '$PREFIX/provision'])
510 # Test renaming the DC
511 plantestsuite("samba4.blackbox.renamedc.sh", "none", ["PYTHON=%s" % python, os.path.join(bbdir, "renamedc.sh"), '$PREFIX/provision'])
513 # check the databases are all OK. PLEASE LEAVE THIS AS THE LAST TEST
514 for env in ["dc", "fl2000dc", "fl2003dc", "fl2008r2dc"]:
515 plantestsuite("samba4.blackbox.dbcheck(%s)" % env, env + ":local" , ["PYTHON=%s" % python, os.path.join(bbdir, "dbcheck.sh"), '$PREFIX/provision', configuration])