samba-tool: Support preloading multiple users
[Samba.git] / source4 / selftest / tests.py
blob32d47a0ccd2251919a5871c17404fc57cb3f83f8
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 import selftesthelpers
24 from selftesthelpers import *
26 print >>sys.stderr, "OPTIONS %s" % " ".join(smbtorture4_options)
28 def plansmbtorture4testsuite(name, env, options, modname=None):
29 return selftesthelpers.plansmbtorture4testsuite(name, env, options,
30 target='samba4', modname=modname)
32 samba4srcdir = source4dir()
33 samba4bindir = bindir()
34 validate = os.getenv("VALIDATE", "")
35 if validate:
36 validate_list = [validate]
37 else:
38 validate_list = []
40 nmblookup4 = binpath('nmblookup4')
41 smbclient4 = binpath('smbclient4')
43 bbdir = os.path.join(srcdir(), "testprogs/blackbox")
45 # Simple tests for LDAP and CLDAP
46 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']:
47 plantestsuite("samba4.ldb.ldap with options %s(ad_dc_ntvfs)" % options, "ad_dc_ntvfs", "%s/test_ldb.sh ldap $SERVER %s" % (bbdir, options))
49 # see if we support ADS on the Samba3 side
50 try:
51 config_h = os.environ["CONFIG_H"]
52 except KeyError:
53 config_h = os.path.join(samba4bindir, "default/include/config.h")
55 # check available features
56 config_hash = dict()
57 f = open(config_h, 'r')
58 try:
59 lines = f.readlines()
60 config_hash = dict((x[0], ' '.join(x[1:]))
61 for x in map(lambda line: line.strip().split(' ')[1:],
62 filter(lambda line: (line[0:7] == '#define') and (len(line.split(' ')) > 2), lines)))
63 finally:
64 f.close()
66 have_tls_support = ("ENABLE_GNUTLS" in config_hash)
67 have_heimdal_support = ("SAMBA4_USES_HEIMDAL" in config_hash)
69 if have_tls_support:
70 for options in ['-U"$USERNAME%$PASSWORD"']:
71 plantestsuite("samba4.ldb.ldaps with options %s(ad_dc_ntvfs)" % options, "ad_dc_ntvfs",
72 "%s/test_ldb.sh ldaps $SERVER_IP %s" % (bbdir, options))
74 for options in ['-U"$USERNAME%$PASSWORD"']:
75 plantestsuite("samba4.ldb.ldapi with options %s(ad_dc_ntvfs:local)" % options, "ad_dc_ntvfs:local",
76 "%s/test_ldb.sh ldapi $PREFIX_ABS/ad_dc_ntvfs/private/ldapi %s" % (bbdir, options))
78 for t in smbtorture4_testsuites("ldap."):
79 plansmbtorture4testsuite(t, "ad_dc_ntvfs", '-U"$USERNAME%$PASSWORD" //$SERVER_IP/_none_')
81 ldbdir = os.path.join(srcdir(), "lib/ldb")
82 # Don't run LDB tests when using system ldb, as we won't have ldbtest installed
83 if os.path.exists(os.path.join(samba4bindir, "ldbtest")):
84 plantestsuite("ldb.base", "none", "%s/tests/test-tdb-subunit.sh %s" % (ldbdir, samba4bindir))
85 else:
86 skiptestsuite("ldb.base", "Using system LDB, ldbtest not available")
88 # Tests for RPC
90 # add tests to this list as they start passing, so we test
91 # that they stay passing
92 ncacn_np_tests = ["rpc.schannel", "rpc.join", "rpc.lsa", "rpc.dssetup", "rpc.altercontext", "rpc.netlogon", "rpc.netlogon.admin", "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"]
93 ncalrpc_tests = ["rpc.schannel", "rpc.join", "rpc.lsa", "rpc.dssetup", "rpc.altercontext", "rpc.netlogon", "rpc.drsuapi", "rpc.asyncbind", "rpc.lsalookup", "rpc.lsa-getuser", "rpc.schannel2", "rpc.authcontext"]
94 drs_rpc_tests = smbtorture4_testsuites("drs.rpc")
95 ncacn_ip_tcp_tests = ["rpc.schannel", "rpc.join", "rpc.lsa", "rpc.dssetup", "rpc.netlogon", "rpc.asyncbind", "rpc.lsalookup", "rpc.lsa-getuser", "rpc.schannel2", "rpc.authcontext", "rpc.samr.passwords.validate"] + drs_rpc_tests
96 slow_ncacn_np_tests = ["rpc.samlogon", "rpc.samr.users", "rpc.samr.large-dc", "rpc.samr.users.privileges", "rpc.samr.passwords", "rpc.samr.passwords.pwdlastset", "rpc.samr.passwords.lockout", "rpc.samr.passwords.badpwdcount"]
97 slow_ncacn_ip_tcp_tests = ["rpc.samr", "rpc.cracknames"]
99 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"]
101 # Make sure all tests get run
102 rpc_tests = smbtorture4_testsuites("rpc.")
103 auto_rpc_tests = filter(lambda t: t not in all_rpc_tests, rpc_tests)
105 for bindoptions in ["seal,padcheck"] + validate_list + ["bigendian"]:
106 for transport in ["ncalrpc", "ncacn_np", "ncacn_ip_tcp"]:
107 env = "ad_dc_ntvfs"
108 if transport == "ncalrpc":
109 tests = ncalrpc_tests
110 env = "ad_dc_ntvfs:local"
111 elif transport == "ncacn_np":
112 tests = ncacn_np_tests
113 elif transport == "ncacn_ip_tcp":
114 tests = ncacn_ip_tcp_tests
115 else:
116 raise AssertionError("invalid transport %r"% transport)
117 for t in tests:
118 plansmbtorture4testsuite(t, env, ["%s:$SERVER[%s]" % (transport, bindoptions), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.%s on %s with %s" % (t, transport, bindoptions))
119 plansmbtorture4testsuite('rpc.samba3-sharesec', env, ["%s:$SERVER[%s]" % (transport, bindoptions), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', '--option=torture:share=tmp'], "samba4.rpc.samba3.sharesec on %s with %s" % (transport, bindoptions))
121 #Plugin S4 DC tests (confirms named pipe auth forwarding). This can be expanded once kerberos is supported in the plugin DC
123 for bindoptions in ["seal,padcheck"] + validate_list + ["bigendian"]:
124 for t in ncacn_np_tests:
125 env = "ad_dc"
126 transport = "ncacn_np"
127 plansmbtorture4testsuite(t, env, ["%s:$SERVER[%s]" % (transport, bindoptions), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.%s with %s" % (t, bindoptions))
129 for bindoptions in [""] + validate_list + ["bigendian"]:
130 for t in auto_rpc_tests:
131 plansmbtorture4testsuite(t, "ad_dc_ntvfs", ["$SERVER[%s]" % bindoptions, '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.%s with %s" % (t, bindoptions))
133 t = "rpc.countcalls"
134 plansmbtorture4testsuite(t, "ad_dc_ntvfs:local", ["$SERVER[%s]" % bindoptions, '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], modname="samba4.%s" % t)
136 for transport in ["ncacn_np", "ncacn_ip_tcp"]:
137 env = "ad_dc_ntvfs"
138 if transport == "ncacn_np":
139 tests = slow_ncacn_np_tests
140 elif transport == "ncacn_ip_tcp":
141 tests = slow_ncacn_ip_tcp_tests
142 else:
143 raise AssertionError("Invalid transport %r" % transport)
144 for t in tests:
145 plansmbtorture4testsuite(t, env, ["%s:$SERVER" % transport, '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.%s on %s" % (t, transport))
147 # Tests for the DFS referral calls implementation
148 for t in smbtorture4_testsuites("dfs."):
149 plansmbtorture4testsuite(t, "ad_dc_ntvfs", '//$SERVER/ipc\$ -U$USERNAME%$PASSWORD')
150 plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/ipc\$ -U$USERNAME%$PASSWORD')
152 # Tests for the NET API (net.api.become.dc tested below against all the roles)
153 net_tests = filter(lambda x: "net.api.become.dc" not in x, smbtorture4_testsuites("net."))
154 for t in net_tests:
155 plansmbtorture4testsuite(t, "ad_dc_ntvfs", '$SERVER[%s] -U$USERNAME%%$PASSWORD -W$DOMAIN' % validate)
157 # Tests for session keys and encryption of RPC pipes
158 # FIXME: Integrate these into a single smbtorture test
160 transport = "ncacn_np"
161 for env in ["ad_dc_ntvfs", "nt4_dc"]:
162 for ntlmoptions in [
163 "-k no --option=usespnego=yes",
164 "-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no",
165 "-k no --option=usespnego=yes --option=ntlmssp_client:56bit=yes",
166 "-k no --option=usespnego=yes --option=ntlmssp_client:56bit=no",
167 "-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=yes",
168 "-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=no",
169 "-k no --option=usespnego=yes --option=clientntlmv2auth=yes",
170 "-k no --option=usespnego=yes --option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no",
171 "-k no --option=usespnego=yes --option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=yes",
172 "-k no --option=usespnego=no --option=clientntlmv2auth=yes",
173 "-k no --option=gensec:spnego=no --option=clientntlmv2auth=yes",
174 "-k no --option=usespnego=no"]:
175 name = "rpc.lsa.secrets on %s with with %s" % (transport, ntlmoptions)
176 plansmbtorture4testsuite('rpc.lsa.secrets', env, ["%s:$SERVER[]" % (transport), ntlmoptions, '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', '--option=gensec:target_hostname=$NETBIOSNAME'], "samba4.%s" % name)
177 plantestsuite("samba.blackbox.pdbtest(%s)" % env, "%s:local" % env, [os.path.join(bbdir, "test_pdbtest.sh"), '$SERVER', "$PREFIX", "pdbtest", smbclient4, '$SMB_CONF_PATH', configuration])
178 plantestsuite("samba.blackbox.pdbtest.winbind(%s)" % env, "%s:local" % env, [os.path.join(bbdir, "test_pdbtest.sh"), '$SERVER', "$PREFIX", "pdbtest2", smbclient4, '$SMB_CONF_PATH', configuration + " --option='authmethods=wbc'"])
180 plantestsuite("samba.blackbox.pdbtest.s4winbind(ad_dc_ntvfs)", "ad_dc_ntvfs:local", [os.path.join(bbdir, "test_pdbtest.sh"), '$SERVER', "$PREFIX", "pdbtest3", smbclient4, '$SMB_CONF_PATH', configuration + " --option='authmethods=samba4:winbind'"])
181 plantestsuite("samba.blackbox.pdbtest.s4winbind_wbclient(ad_dc_ntvfs)", "ad_dc_ntvfs:local", [os.path.join(bbdir, "test_pdbtest.sh"), '$SERVER', "$PREFIX", "pdbtest4", smbclient4, '$SMB_CONF_PATH', configuration + " --option='authmethods=samba4:winbind_wbclient'"])
183 transports = ["ncacn_np", "ncacn_ip_tcp"]
185 #Kerberos varies between functional levels, so it is important to check this on all of them
186 for env in ["ad_dc_ntvfs", "fl2000dc", "fl2003dc", "fl2008r2dc", "ad_dc"]:
187 transport = "ncacn_np"
188 plansmbtorture4testsuite('rpc.pac', env, ["%s:$SERVER[]" % (transport, ), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.pac on %s" % (transport,))
189 plansmbtorture4testsuite('rpc.lsa.secrets', env, ["%s:$SERVER[]" % (transport, ), '-k', 'yes', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', '--option=gensec:target_hostname=$NETBIOSNAME', 'rpc.lsa.secrets'], "samba4.rpc.lsa.secrets on %s with Kerberos" % (transport,))
190 plansmbtorture4testsuite('rpc.lsa.secrets', env, ["%s:$SERVER[]" % (transport, ), '-k', 'yes', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', "--option=clientusespnegoprincipal=yes", '--option=gensec:target_hostname=$NETBIOSNAME'], "samba4.rpc.lsa.secrets on %s with Kerberos - use target principal" % (transport,))
191 plansmbtorture4testsuite('rpc.lsa.secrets', env, ["%s:$SERVER[target_principal=dcom/$NETBIOSNAME]" % (transport, ), '-k', 'yes', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.lsa.secrets on %s with Kerberos - netbios name principal dcom" % (transport,))
192 plansmbtorture4testsuite('rpc.lsa.secrets', env, ["%s:$SERVER[target_principal=$NETBIOSNAME\$]" % (transport, ), '-k', 'yes', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.lsa.secrets on %s with Kerberos - netbios name principal dollar" % (transport,))
193 plansmbtorture4testsuite('rpc.lsa.secrets', env, ["%s:$SERVER[target_principal=$NETBIOSNAME]" % (transport, ), '-k', 'yes', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.lsa.secrets on %s with Kerberos - netbios name principal" % (transport,))
194 plansmbtorture4testsuite('rpc.lsa.secrets.none*', env, ["%s:$SERVER" % transport, '-k', 'yes', '-U$USERNAME%$PASSWORD', '--workgroup=$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)
195 plansmbtorture4testsuite('rpc.lsa.secrets.none*', env, ["%s:$SERVER" % transport, '-k', 'yes', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', "--option=gensec:fake_gssapi_krb5=yes", '--option=gensec:gssapi_krb5=no', '--option=gensec:target_hostname=$NETBIOSNAME', '--option=gensec_krb5:send_authenticator_checksum=false'], "samba4.rpc.lsa.secrets on %s with Kerberos - use raw-krb5-no-authenticator-checksum style login" % transport)
196 plansmbtorture4testsuite('rpc.lsa.secrets.none*', env, ["%s:$SERVER" % transport, '-k', 'yes', '-U$USERNAME%$PASSWORD', '--workgroup=$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)
198 # Winreg tests test bulk Kerberos encryption of DCE/RPC
199 # We test rpc.winreg here too, because the winreg interface if
200 # handled by the source3/rpc_server code.
201 for bindoptions in ["connect", "krb5", "krb5,sign", "krb5,seal", "spnego", "spnego,sign", "spnego,seal"]:
202 plansmbtorture4testsuite('rpc.winreg', env, ["%s:$SERVER[%s]" % (transport, bindoptions), '-k', 'yes', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.winreg on %s with %s" % (transport, bindoptions))
204 for transport in transports:
205 plansmbtorture4testsuite('rpc.echo', env, ["%s:$SERVER[]" % (transport,), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.echo on %s" % (transport, ))
207 # Echo tests test bulk Kerberos encryption of DCE/RPC
208 for bindoptions in ["connect", "krb5", "krb5,sign", "krb5,seal", "spnego", "spnego,sign", "spnego,seal"] + validate_list + ["padcheck", "bigendian", "bigendian,seal"]:
209 echooptions = "--option=socket:testnonblock=True --option=torture:quick=yes -k yes"
210 plansmbtorture4testsuite('rpc.echo', env, ["%s:$SERVER[%s]" % (transport, bindoptions), echooptions, '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.echo on %s with %s and %s" % (transport, bindoptions, echooptions))
211 plansmbtorture4testsuite("net.api.become.dc", env, '$SERVER[%s] -U$USERNAME%%$PASSWORD -W$DOMAIN' % validate)
213 for bindoptions in ["sign", "seal"]:
214 plansmbtorture4testsuite('rpc.backupkey', "ad_dc_ntvfs", ["ncacn_np:$SERVER[%s]" % ( bindoptions), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.backupkey with %s" % (bindoptions))
216 for transport in transports:
217 for bindoptions in ["sign", "seal"]:
218 for ntlmoptions in [
219 "--option=ntlmssp_client:ntlm2=yes --option=torture:quick=yes",
220 "--option=ntlmssp_client:ntlm2=no --option=torture:quick=yes",
221 "--option=ntlmssp_client:ntlm2=yes --option=ntlmssp_client:128bit=no --option=torture:quick=yes",
222 "--option=ntlmssp_client:ntlm2=no --option=ntlmssp_client:128bit=no --option=torture:quick=yes",
223 "--option=ntlmssp_client:ntlm2=yes --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes",
224 "--option=ntlmssp_client:ntlm2=no --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes",
225 "--option=clientntlmv2auth=yes --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes",
226 "--option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:keyexchange=yes --option=torture:quick=yes",
227 "--option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes"]:
228 if transport == "ncalrpc":
229 env = "ad_dc_ntvfs:local"
230 else:
231 env = "ad_dc_ntvfs"
232 plansmbtorture4testsuite('rpc.echo', env, ["%s:$SERVER[%s]" % (transport, bindoptions), ntlmoptions, '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.echo on %s with %s and %s" % (transport, bindoptions, ntlmoptions))
234 plansmbtorture4testsuite('rpc.echo', "ad_dc_ntvfs", ['ncacn_np:$SERVER[smb2]', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.echo on ncacn_np over smb2")
236 plansmbtorture4testsuite('ntp.signd', "ad_dc_ntvfs:local", ['ncacn_np:$SERVER', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.ntp.signd")
238 nbt_tests = smbtorture4_testsuites("nbt.")
239 for t in nbt_tests:
240 plansmbtorture4testsuite(t, "ad_dc_ntvfs", "//$SERVER/_none_ -U\"$USERNAME%$PASSWORD\"")
242 # Tests against the NTVFS POSIX backend
243 ntvfsargs = ["--option=torture:sharedelay=100000", "--option=torture:oplocktimeout=3", "--option=torture:writetimeupdatedelay=500000"]
245 # smb2.change_notify_disabled must only run against env fileserver-notify-disabled
246 smb2 = filter(lambda x: "smb2.change_notify_disabled" not in x, smbtorture4_testsuites("smb2."))
248 #The QFILEINFO-IPC test needs to be on ipc$
249 raw = filter(lambda x: "raw.qfileinfo.ipc" not in x, smbtorture4_testsuites("raw."))
250 base = smbtorture4_testsuites("base.")
252 netapi = smbtorture4_testsuites("netapi.")
254 libsmbclient = smbtorture4_testsuites("libsmbclient.")
256 for t in base + raw + smb2 + netapi + libsmbclient:
257 plansmbtorture4testsuite(t, "ad_dc_ntvfs", ['//$SERVER/tmp', '-U$USERNAME%$PASSWORD'] + ntvfsargs)
259 plansmbtorture4testsuite("raw.qfileinfo.ipc", "ad_dc_ntvfs", '//$SERVER/ipc\$ -U$USERNAME%$PASSWORD')
261 for t in smbtorture4_testsuites("rap."):
262 plansmbtorture4testsuite(t, "ad_dc_ntvfs", '//$SERVER/IPC\$ -U$USERNAME%$PASSWORD')
264 # Tests against the NTVFS CIFS backend
265 for t in base + raw:
266 plansmbtorture4testsuite(t, "ad_dc_ntvfs", ['//$NETBIOSNAME/cifs', '-U$USERNAME%$PASSWORD', '--kerberos=yes'] + ntvfsargs, modname="samba4.ntvfs.cifs.krb5.%s" % t)
268 # Test NTVFS CIFS backend with S4U2Self and S4U2Proxy
269 t = "base.unlink"
270 plansmbtorture4testsuite(t, "ad_dc_ntvfs", ['//$NETBIOSNAME/cifs', '-U$USERNAME%$PASSWORD', '--kerberos=no'] + ntvfsargs, "samba4.ntvfs.cifs.ntlm.%s" % t)
271 plansmbtorture4testsuite(t, "rpc_proxy", ['//$NETBIOSNAME/cifs_to_dc', '-U$DC_USERNAME%$DC_PASSWORD', '--kerberos=yes'] + ntvfsargs, "samba4.ntvfs.cifs.krb5.%s" % t)
272 plansmbtorture4testsuite(t, "rpc_proxy", ['//$NETBIOSNAME/cifs_to_dc', '-U$DC_USERNAME%$DC_PASSWORD', '--kerberos=no'] + ntvfsargs, "samba4.ntvfs.cifs.ntlm.%s" % t)
274 plansmbtorture4testsuite('echo.udp', 'ad_dc_ntvfs:local', '//$SERVER/whatever')
276 # Local tests
277 for t in smbtorture4_testsuites("local."):
278 #The local.resolve test needs a name to look up using real system (not emulated) name routines
279 plansmbtorture4testsuite(t, "none", "ncalrpc:localhost")
281 # Confirm these tests with the system iconv too
282 for t in ["local.convert_string_handle", "local.convert_string", "local.ndr"]:
283 options = "ncalrpc: --option='iconv:use_builtin_handlers=false'"
284 plansmbtorture4testsuite(t, "none", options,
285 modname="samba4.%s.system.iconv" % t)
287 tdbtorture4 = binpath("tdbtorture")
288 if os.path.exists(tdbtorture4):
289 plantestsuite("tdb.stress", "none", valgrindify(tdbtorture4))
290 else:
291 skiptestsuite("tdb.stress", "Using system TDB, tdbtorture not available")
293 plansmbtorture4testsuite("drs.unit", "none", "ncalrpc:")
295 # Pidl tests
296 for f in sorted(os.listdir(os.path.join(samba4srcdir, "../pidl/tests"))):
297 if f.endswith(".pl"):
298 planperltestsuite("pidl.%s" % f[:-3], os.path.normpath(os.path.join(samba4srcdir, "../pidl/tests", f)))
300 # DNS tests
301 planpythontestsuite("fl2003dc:local", "samba.tests.dns")
302 for t in smbtorture4_testsuites("dns_internal."):
303 plansmbtorture4testsuite(t, "ad_dc_ntvfs:local", '//$SERVER/whavever')
305 # Local tests
306 for t in smbtorture4_testsuites("dlz_bind9."):
307 #The dlz_bind9 tests needs to look at the DNS database
308 plansmbtorture4testsuite(t, "chgdcpass:local", ["ncalrpc:$SERVER", '-U$USERNAME%$PASSWORD'])
310 planpythontestsuite("nt4_dc", "samba.tests.libsmb_samba_internal");
312 # Blackbox Tests:
313 # tests that interact directly with the command-line tools rather than using
314 # the API. These mainly test that the various command-line options of commands
315 # work correctly.
317 for env in ["ad_member", "s4member", "ad_dc_ntvfs", "chgdcpass"]:
318 plantestsuite("samba4.blackbox.smbclient(%s:local)" % env, "%s:local" % env, [os.path.join(samba4srcdir, "utils/tests/test_smbclient.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$DOMAIN', smbclient4])
320 plantestsuite("samba4.blackbox.samba_tool(ad_dc_ntvfs:local)", "ad_dc_ntvfs:local", [os.path.join(samba4srcdir, "utils/tests/test_samba_tool.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$DOMAIN', smbclient4])
322 if have_heimdal_support:
323 plantestsuite("samba4.blackbox.pkinit(ad_dc_ntvfs:local)", "ad_dc_ntvfs:local", [os.path.join(bbdir, "test_pkinit_heimdal.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX/ad_dc_ntvfs', "aes256-cts-hmac-sha1-96", smbclient4, configuration])
324 plantestsuite("samba4.blackbox.kinit(ad_dc_ntvfs:local)", "ad_dc_ntvfs:local", [os.path.join(bbdir, "test_kinit_heimdal.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', "aes256-cts-hmac-sha1-96", smbclient4, configuration])
325 plantestsuite("samba4.blackbox.kinit(fl2000dc:local)", "fl2000dc:local", [os.path.join(bbdir, "test_kinit_heimdal.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', "arcfour-hmac-md5", smbclient4, configuration])
326 plantestsuite("samba4.blackbox.kinit(fl2008r2dc:local)", "fl2008r2dc:local", [os.path.join(bbdir, "test_kinit_heimdal.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', "aes256-cts-hmac-sha1-96", smbclient4, configuration])
327 plantestsuite("samba4.blackbox.kinit_trust(fl2008r2dc:local)", "fl2008r2dc:local", [os.path.join(bbdir, "test_kinit_trusts_heimdal.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$TRUST_SERVER', '$TRUST_USERNAME', '$TRUST_PASSWORD', '$TRUST_REALM', '$TRUST_DOMAIN', '$PREFIX', "forest", "aes256-cts-hmac-sha1-96"])
328 plantestsuite("samba4.blackbox.kinit_trust(fl2003dc:local)", "fl2003dc:local", [os.path.join(bbdir, "test_kinit_trusts_heimdal.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$TRUST_SERVER', '$TRUST_USERNAME', '$TRUST_PASSWORD', '$TRUST_REALM', '$TRUST_DOMAIN', '$PREFIX', "external", "arcfour-hmac-md5"])
330 plantestsuite("samba4.blackbox.trust_utils(fl2008r2dc:local)", "fl2008r2dc:local", [os.path.join(bbdir, "test_trust_utils.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$TRUST_SERVER', '$TRUST_USERNAME', '$TRUST_PASSWORD', '$TRUST_REALM', '$TRUST_DOMAIN', '$PREFIX', "forest"])
331 plantestsuite("samba4.blackbox.trust_utils(fl2003dc:local)", "fl2003dc:local", [os.path.join(bbdir, "test_trust_utils.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$TRUST_SERVER', '$TRUST_USERNAME', '$TRUST_PASSWORD', '$TRUST_REALM', '$TRUST_DOMAIN', '$PREFIX', "external"])
332 plantestsuite("samba4.blackbox.ktpass(ad_dc_ntvfs)", "ad_dc_ntvfs", [os.path.join(bbdir, "test_ktpass.sh"), '$PREFIX/ad_dc_ntvfs'])
333 plantestsuite("samba4.blackbox.passwords(ad_dc_ntvfs:local)", "ad_dc_ntvfs:local", [os.path.join(bbdir, "test_passwords.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', "$PREFIX/ad_dc_ntvfs", smbclient4])
334 plantestsuite("samba4.blackbox.export.keytab(ad_dc_ntvfs:local)", "ad_dc_ntvfs:local", [os.path.join(bbdir, "test_export_keytab.sh"), '$SERVER', '$USERNAME', '$REALM', '$DOMAIN', "$PREFIX", smbclient4])
335 plantestsuite("samba4.blackbox.cifsdd(ad_dc_ntvfs)", "ad_dc_ntvfs", [os.path.join(samba4srcdir, "client/tests/test_cifsdd.sh"), '$SERVER', '$USERNAME', '$PASSWORD', "$DOMAIN"])
336 plantestsuite("samba4.blackbox.nmblookup(ad_dc_ntvfs)", "ad_dc_ntvfs", [os.path.join(samba4srcdir, "utils/tests/test_nmblookup.sh"), '$NETBIOSNAME', '$NETBIOSALIAS', '$SERVER', '$SERVER_IP', nmblookup4])
337 plantestsuite("samba4.blackbox.locktest(ad_dc_ntvfs)", "ad_dc_ntvfs", [os.path.join(samba4srcdir, "torture/tests/test_locktest.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$DOMAIN', '$PREFIX'])
338 plantestsuite("samba4.blackbox.masktest", "ad_dc_ntvfs", [os.path.join(samba4srcdir, "torture/tests/test_masktest.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$DOMAIN', '$PREFIX'])
339 plantestsuite("samba4.blackbox.gentest(ad_dc_ntvfs)", "ad_dc_ntvfs", [os.path.join(samba4srcdir, "torture/tests/test_gentest.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$DOMAIN', "$PREFIX"])
340 plantestsuite("samba4.blackbox.rfc2307_mapping(ad_dc_ntvfs:local)", "ad_dc_ntvfs:local", [os.path.join(samba4srcdir, "../nsswitch/tests/test_rfc2307_mapping.sh"), '$DOMAIN', '$USERNAME', '$PASSWORD', "$SERVER", "$UID_RFC2307TEST", "$GID_RFC2307TEST", configuration])
341 plantestsuite("samba4.blackbox.chgdcpass", "chgdcpass", [os.path.join(bbdir, "test_chgdcpass.sh"), '$SERVER', "CHGDCPASS\$", '$REALM', '$DOMAIN', '$PREFIX', "aes256-cts-hmac-sha1-96", '$SELFTEST_PREFIX/chgdcpass', smbclient4])
342 plantestsuite("samba4.blackbox.samba_upgradedns(chgdcpass:local)", "chgdcpass:local", [os.path.join(bbdir, "test_samba_upgradedns.sh"), '$SERVER', '$REALM', '$PREFIX', '$SELFTEST_PREFIX/chgdcpass'])
343 plantestsuite("samba4.blackbox.net_ads(ad_member:local)", "ad_member:local", [os.path.join(bbdir, "test_net_ads.sh"), '$DC_SERVER', '$DC_USERNAME', '$DC_PASSWORD'])
344 plantestsuite_loadlist("samba4.rpc.echo against NetBIOS alias", "ad_dc_ntvfs", [valgrindify(smbtorture4), "$LISTOPT", "$LOADLIST", 'ncacn_np:$NETBIOSALIAS', '-U$DOMAIN/$USERNAME%$PASSWORD', 'rpc.echo'])
346 # Tests using the "Simple" NTVFS backend
347 for t in ["base.rw1"]:
348 plansmbtorture4testsuite(t, "ad_dc_ntvfs", ["//$SERVER/simple", '-U$USERNAME%$PASSWORD'], modname="samba4.ntvfs.simple.%s" % t)
350 # Domain S4member Tests
351 plansmbtorture4testsuite('rpc.echo', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], "samba4.rpc.echo against s4member server with local creds")
352 plansmbtorture4testsuite('rpc.echo', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'], "samba4.rpc.echo against s4member server with domain creds")
353 plansmbtorture4testsuite('rpc.samr', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], "samba4.rpc.samr against s4member server with local creds")
354 plansmbtorture4testsuite('rpc.samr.users', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], "samba4.rpc.samr.users against s4member server with local creds",)
355 plansmbtorture4testsuite('rpc.samr.passwords', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], "samba4.rpc.samr.passwords against s4member server with local creds")
356 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', smbclient4])
358 # RPC Proxy
359 plansmbtorture4testsuite("rpc.echo", "rpc_proxy", ['ncacn_ip_tcp:$NETBIOSNAME', '-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'], modname="samba4.rpc.echo against rpc proxy with domain creds")
361 # Tests SMB signing
362 for mech in [
363 "-k no",
364 "-k no --option=usespnego=no",
365 "-k no --option=gensec:spengo=no",
366 "-k yes",
367 "-k yes --option=gensec:fake_gssapi_krb5=yes --option=gensec:gssapi_krb5=no"]:
368 for signing in ["--signing=on", "--signing=required"]:
369 signoptions = "%s %s" % (mech, signing)
370 name = "smb.signing on with %s" % signoptions
371 plansmbtorture4testsuite('base.xcopy', "ad_dc_ntvfs", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$USERNAME%$PASSWORD'], modname="samba4.%s" % name)
373 for mech in [
374 "-k no",
375 "-k no --option=usespnego=no",
376 "-k no --option=gensec:spengo=no",
377 "-k yes"]:
378 signoptions = "%s --signing=off" % mech
379 name = "smb.signing disabled on with %s" % signoptions
380 plansmbtorture4testsuite('base.xcopy', "s4member", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$DC_USERNAME%$DC_PASSWORD'], "samba4.%s domain-creds" % name)
381 plansmbtorture4testsuite('base.xcopy', "ad_member", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$DC_USERNAME%$DC_PASSWORD'], "samba4.%s domain-creds" % name)
382 plansmbtorture4testsuite('base.xcopy', "ad_dc", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$USERNAME%$PASSWORD'], "samba4.%s" % name)
383 plansmbtorture4testsuite('base.xcopy', "ad_dc",
384 ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$DC_USERNAME%$DC_PASSWORD'], "samba4.%s administrator" % name)
386 plantestsuite("samba4.blackbox.bogusdomain", "ad_member", ["testprogs/blackbox/bogus.sh", "$NETBIOSNAME", "xcopy_share", '$USERNAME', '$PASSWORD', '$DC_USERNAME', '$DC_PASSWORD', smbclient4])
387 for mech in [
388 "-k no",
389 "-k no --option=usespnego=no",
390 "-k no --option=gensec:spengo=no"]:
391 signoptions = "%s --signing=off" % mech
392 plansmbtorture4testsuite('base.xcopy', "s4member", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], modname="samba4.smb.signing on with %s local-creds" % signoptions)
394 plansmbtorture4testsuite('base.xcopy', "ad_dc_ntvfs", ['//$NETBIOSNAME/xcopy_share', '-k', 'no', '--signing=yes', '-U%'], modname="samba4.smb.signing --signing=yes anon")
395 plansmbtorture4testsuite('base.xcopy', "ad_dc_ntvfs", ['//$NETBIOSNAME/xcopy_share', '-k', 'no', '--signing=required', '-U%'], modname="samba4.smb.signing --signing=required anon")
396 plansmbtorture4testsuite('base.xcopy', "s4member", ['//$NETBIOSNAME/xcopy_share', '-k', 'no', '--signing=no', '-U%'], modname="samba4.smb.signing --signing=no anon")
399 wb_opts_default = ["--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\""]
401 winbind_ad_client_tests = smbtorture4_testsuites("winbind.struct") + smbtorture4_testsuites("winbind.pac")
402 winbind_wbclient_tests = smbtorture4_testsuites("winbind.wbclient")
403 for env in ["ad_dc", "ad_dc_ntvfs", "s4member", "ad_member", "nt4_member"]:
404 wb_opts = wb_opts_default[:]
405 if env in ["ad_member"]:
406 wb_opts += ["--option=\"torture:winbindd_domain_without_prefix=$DOMAIN\""]
407 for t in winbind_ad_client_tests:
408 plansmbtorture4testsuite(t, "%s:local" % env, wb_opts + ['//$SERVER/tmp', '--realm=$REALM', '--machine-pass', '--option=torture:addc=$DC_SERVER'])
410 for env in ["nt4_dc", "fl2003dc"]:
411 for t in winbind_wbclient_tests:
412 plansmbtorture4testsuite(t, "%s:local" % env, '//$SERVER/tmp -U$DC_USERNAME%$DC_PASSWORD')
414 for env in ["nt4_dc", "nt4_member", "ad_dc", "ad_dc_ntvfs", "ad_member", "s4member", "chgdcpass"]:
415 tests = ["--ping", "--separator",
416 "--own-domain",
417 "--all-domains",
418 "--trusted-domains",
419 "--domain-info=BUILTIN",
420 "--domain-info=$DOMAIN",
421 "--online-status",
422 "--online-status --domain=BUILTIN",
423 "--online-status --domain=$DOMAIN",
424 "--check-secret --domain=$DOMAIN",
425 "--change-secret --domain=$DOMAIN",
426 "--check-secret --domain=$DOMAIN",
427 "--online-status --domain=$DOMAIN",
428 "--domain-users",
429 "--domain-groups",
430 "--name-to-sid=$DC_USERNAME",
431 "--name-to-sid=$DOMAIN/$DC_USERNAME",
432 "--user-info=$DOMAIN/$DC_USERNAME",
433 "--user-groups=$DOMAIN/$DC_USERNAME",
434 "--authenticate=$DOMAIN/$DC_USERNAME%$DC_PASSWORD",
435 "--allocate-uid",
436 "--allocate-gid"]
438 for t in tests:
439 plantestsuite("samba.wbinfo_simple.(%s:local).%s" % (env, t), "%s:local" % env, [os.path.join(srcdir(), "nsswitch/tests/test_wbinfo_simple.sh"), t])
441 plantestsuite(
442 "samba.wbinfo_sids2xids.(%s:local)" % env, "%s:local" % env,
443 [os.path.join(samba3srcdir, "script/tests/test_wbinfo_sids2xids.sh")])
445 plantestsuite(
446 "samba.ntlm_auth.diagnostics(%s:local)" % env, "%s:local" % env,
447 [os.path.join(samba3srcdir, "script/tests/test_ntlm_auth_diagnostics.sh"), ntlm_auth3, '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', configuration])
449 plantestsuite("samba.ntlm_auth.(%s:local)" % env, "%s:local" % env, [os.path.join(samba3srcdir, "script/tests/test_ntlm_auth_s3.sh"), valgrindify(python), samba3srcdir, ntlm_auth3, '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', configuration])
452 nsstest4 = binpath("nsstest")
453 for env in ["ad_dc:local", "ad_dc_ntvfs:local", "s4member:local", "nt4_dc:local", "ad_member:local", "nt4_member:local"]:
454 if os.path.exists(nsstest4):
455 plantestsuite("samba.nss.test using winbind(%s)" % env, env, [os.path.join(bbdir, "nsstest.sh"), nsstest4, os.path.join(samba4bindir, "shared/libnss_wrapper_winbind.so.2")])
456 else:
457 skiptestsuite("samba.nss.test using winbind(%s)" % env, "nsstest not available")
459 subunitrun = valgrindify(python) + " " + os.path.join(samba4srcdir, "scripting/bin/subunitrun")
460 def planoldpythontestsuite(env, module, name=None, extra_path=[], environ={}, extra_args=[]):
461 environ = dict(environ)
462 py_path = list(extra_path)
463 if py_path:
464 environ["PYTHONPATH"] = ":".join(["$PYTHONPATH"] + py_path)
465 args = ["%s=%s" % item for item in environ.iteritems()]
466 args += [subunitrun, "$LISTOPT", "$LOADLIST", module]
467 args += extra_args
468 if name is None:
469 name = module
470 plantestsuite_loadlist(name, env, args)
472 planoldpythontestsuite("ad_dc_ntvfs:local", "samba.tests.gensec", extra_args=['-U"$USERNAME%$PASSWORD"'])
473 planoldpythontestsuite("none", "simple", extra_path=["%s/lib/tdb/python/tests" % srcdir()], name="tdb.python")
474 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dcerpc.sam")
475 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dsdb")
476 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dcerpc.bare")
477 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dcerpc.unix")
478 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dcerpc.srvsvc")
479 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.samba_tool.timecmd")
481 # We run this test against both AD DC implemetnations because it is
482 # the only test we have of GPO get/set behaviour, and this involves
483 # the file server as well as the LDAP server.
484 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.samba_tool.gpo")
485 planpythontestsuite("ad_dc:local", "samba.tests.samba_tool.gpo")
487 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.samba_tool.processes")
488 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.samba_tool.user")
489 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.samba_tool.group")
490 planpythontestsuite("ad_dc:local", "samba.tests.samba_tool.ntacl")
492 planpythontestsuite("ad_dc:local", "samba.tests.samba_tool.sites")
494 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dcerpc.rpcecho")
495 planoldpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dcerpc.registry", extra_args=['-U"$USERNAME%$PASSWORD"'])
496 planoldpythontestsuite("ad_dc_ntvfs", "samba.tests.dcerpc.dnsserver", extra_args=['-U"$USERNAME%$PASSWORD"'])
497 planoldpythontestsuite("ad_dc", "samba.tests.dcerpc.dnsserver", extra_args=['-U"$USERNAME%$PASSWORD"'])
498 plantestsuite_loadlist("samba4.ldap.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/ldap.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
499 plantestsuite_loadlist("samba4.tokengroups.python(ad_dc_ntvfs)", "ad_dc_ntvfs:local", [python, os.path.join(samba4srcdir, "dsdb/tests/python/token_group.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
500 plantestsuite("samba4.sam.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/sam.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
501 plantestsuite("samba4.user_account_control.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/user_account_control.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
502 planoldpythontestsuite("ad_dc_ntvfs", "dsdb_schema_info",
503 extra_path=[os.path.join(samba4srcdir, 'dsdb/tests/python')],
504 name="samba4.schemaInfo.python(ad_dc_ntvfs)",
505 extra_args=['-U"$DOMAIN/$DC_USERNAME%$DC_PASSWORD"'])
506 plantestsuite_loadlist("samba4.urgent_replication.python(ad_dc_ntvfs)", "ad_dc_ntvfs:local", [python, os.path.join(samba4srcdir, "dsdb/tests/python/urgent_replication.py"), '$PREFIX_ABS/ad_dc_ntvfs/private/sam.ldb', '$LOADLIST', '$LISTOPT'])
507 plantestsuite_loadlist("samba4.ldap.dirsync.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/dirsync.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
508 plantestsuite_loadlist("samba4.ldap.match_rules.python", "ad_dc_ntvfs", [python, os.path.join(srcdir(), "lib/ldb-samba/tests/match_rules.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
509 plantestsuite_loadlist("samba4.ldap.notification.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/notification.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
510 plantestsuite_loadlist("samba4.ldap.sites.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/sites.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
511 for env in ["ad_dc_ntvfs", "fl2000dc", "fl2003dc", "fl2008r2dc"]:
512 plantestsuite_loadlist("samba4.ldap_schema.python(%s)" % env, env, [python, os.path.join(samba4srcdir, "dsdb/tests/python/ldap_schema.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
513 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"])
514 plantestsuite_loadlist("samba4.ldap.secdesc.python(%s)" % env, env, [python, os.path.join(samba4srcdir, "dsdb/tests/python/sec_descriptor.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
515 plantestsuite_loadlist("samba4.ldap.acl.python(%s)" % env, env, [python, os.path.join(samba4srcdir, "dsdb/tests/python/acl.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
516 if env != "fl2000dc":
517 # This test makes excessive use of the "userPassword" attribute which
518 # isn't available on DCs with Windows 2000 domain function level -
519 # therefore skip it in that configuration
520 plantestsuite_loadlist("samba4.ldap.passwords.python(%s)" % env, env, [python, os.path.join(samba4srcdir, "dsdb/tests/python/passwords.py"), "$SERVER", '-U"$USERNAME%$PASSWORD"', "-W$DOMAIN", '$LOADLIST', '$LISTOPT'])
521 plantestsuite_loadlist("samba4.ldap.password_lockout.python(%s)" % env, env, [python, os.path.join(samba4srcdir, "dsdb/tests/python/password_lockout.py"), "$SERVER", '-U"$USERNAME%$PASSWORD"', "-W$DOMAIN", "--realm=$REALM", '$LOADLIST', '$LISTOPT'])
523 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.upgradeprovisionneeddc")
524 planpythontestsuite("ad_dc:local", "samba.tests.posixacl")
525 planpythontestsuite("ad_dc_no_nss:local", "samba.tests.posixacl")
526 plantestsuite_loadlist("samba4.deletetest.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/deletetest.py"),
527 '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
528 plantestsuite("samba4.blackbox.samba3dump", "none", [os.path.join(samba4srcdir, "selftest/test_samba3dump.sh")])
529 plantestsuite("samba4.blackbox.upgrade", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_s3upgrade.sh"), '$PREFIX/provision'])
530 plantestsuite("samba4.blackbox.provision.py", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_provision.sh"), '$PREFIX/provision'])
531 plantestsuite("samba4.blackbox.upgradeprovision.current", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_upgradeprovision.sh"), '$PREFIX/provision'])
532 plantestsuite("samba4.blackbox.setpassword.py", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_setpassword.sh"), '$PREFIX/provision'])
533 plantestsuite("samba4.blackbox.newuser.py", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_newuser.sh"), '$PREFIX/provision'])
534 plantestsuite("samba4.blackbox.group.py", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_group.sh"), '$PREFIX/provision'])
535 plantestsuite("samba4.blackbox.spn.py(ad_dc_ntvfs:local)", "ad_dc_ntvfs:local", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_spn.sh"), '$PREFIX/ad_dc_ntvfs'])
536 plantestsuite_loadlist("samba4.ldap.bind(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(srcdir(), "auth/credentials/tests/bind.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '$LOADLIST', '$LISTOPT'])
538 # This makes sure we test the rid allocation code
539 t = "rpc.samr.large-dc"
540 plansmbtorture4testsuite(t, "vampire_dc", ['$SERVER', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], modname=("samba4.%s.one" % t))
541 plansmbtorture4testsuite(t, "vampire_dc", ['$SERVER', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], modname="samba4.%s.two" % t)
543 # some RODC testing
544 for env in ['rodc']:
545 plansmbtorture4testsuite('rpc.echo', env, ['ncacn_np:$SERVER', "-k", "yes", '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], modname="samba4.rpc.echo")
546 plansmbtorture4testsuite('rpc.echo', "%s:local" % env, ['ncacn_np:$SERVER', "-k", "yes", '-P', '--workgroup=$DOMAIN'], modname="samba4.rpc.echo")
547 planpythontestsuite("rodc:local", "samba.tests.samba_tool.rodc")
549 plantestsuite("samba4.blackbox.provision-backend", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_provision-backend.sh"), '$PREFIX/provision'])
551 # Test renaming the DC
552 plantestsuite("samba4.blackbox.renamedc.sh", "none", ["PYTHON=%s" % python, os.path.join(bbdir, "renamedc.sh"), '$PREFIX/provision'])
554 for env in ['vampire_dc', 'promoted_dc']:
556 # DRS python tests
557 planoldpythontestsuite(env, "samba.tests.blackbox.samba_tool_drs",
558 environ={'DC1': '$DC_SERVER', 'DC2': '$%s_SERVER' % env.upper()},
559 extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
560 planoldpythontestsuite("%s:local" % env, "replica_sync",
561 extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
562 name="samba4.drs.replica_sync.python(%s)" % env,
563 environ={'DC1': '$DC_SERVER', 'DC2': '$%s_SERVER' % env.upper()},
564 extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
565 planoldpythontestsuite(env, "delete_object",
566 extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
567 name="samba4.drs.delete_object.python(%s)" % env,
568 environ={'DC1': '$DC_SERVER', 'DC2': '$%s_SERVER' % env.upper()},
569 extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
570 planoldpythontestsuite(env, "fsmo",
571 name="samba4.drs.fsmo.python(%s)" % env,
572 extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
573 environ={'DC1': "$DC_SERVER", 'DC2': '$%s_SERVER' % env.upper()},
574 extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
575 planoldpythontestsuite(env, "repl_schema",
576 extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
577 name="samba4.drs.repl_schema.python(%s)" % env,
578 environ={'DC1': "$DC_SERVER", 'DC2': '$%s_SERVER' % env.upper()},
579 extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
582 for env in ["ad_dc_ntvfs", "s4member", "rodc", "promoted_dc", "ad_dc", "ad_member"]:
583 plantestsuite("samba.blackbox.wbinfo(%s:local)" % env, "%s:local" % env, [os.path.join(samba4srcdir, "../nsswitch/tests/test_wbinfo.sh"), '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', env])
585 for env in ["ad_dc_ntvfs", "rodc", "promoted_dc", "ad_dc", "fl2000dc", "fl2003dc", "fl2008r2dc"]:
586 if env == "rodc":
587 extra_options = ['--option=torture:expect_rodc=true']
588 else:
589 extra_options = []
591 plansmbtorture4testsuite('krb5.kdc', env, ['ncacn_np:$SERVER_IP', "-k", "yes", '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', '--realm=$REALM'] + extra_options,
592 "samba4.krb5.kdc with specified account")
593 plansmbtorture4testsuite('krb5.kdc', env, ['ncacn_np:$SERVER_IP', "-k", "yes", '-Utestdenied%$PASSWORD', '--workgroup=$DOMAIN', '--realm=$REALM', '--option=torture:krb5-upn=testdenied_upn@$REALM.upn'] + extra_options,
594 "samba4.krb5.kdc with account DENIED permission to replicate to an RODC")
596 # These last two tests are for users cached at the RODC
597 if env == "rodc":
598 extra_options = ['--option=torture:expect_rodc=true', '--option=torture:expect_cached_at_rodc=true']
599 else:
600 extra_options = []
602 plansmbtorture4testsuite('krb5.kdc', "%s:local" % env, ['ncacn_np:$SERVER_IP', "-k", "yes", '-P',
603 '--workgroup=$DOMAIN', '--realm=$REALM',
604 '--option=torture:krb5-hostname=$SERVER',
605 '--option=torture:run_removedollar_test=true',
606 '--option=torture:expect_machine_account=true'] + extra_options,
607 "samba4.krb5.kdc with machine account")
608 plansmbtorture4testsuite('krb5.kdc', env, ['ncacn_np:$SERVER_IP', "-k", "yes", '-Utestallowed\ account%$PASSWORD',
609 '--workgroup=$DOMAIN', '--realm=$REALM',
610 '--option=torture:expect_machine_account=true',
611 '--option=torture:krb5-upn=testallowed\ upn@$REALM',
612 '--option=torture:krb5-hostname=testallowed'] + extra_options,
613 "samba4.krb5.kdc with account ALLOWED permission to replicate to an RODC")
616 for env in [
617 'vampire_dc',
618 'promoted_dc']:
619 planoldpythontestsuite(env, "samba.tests.kcc",
620 name="samba.tests.kcc",
621 environ={'TEST_SERVER': '$SERVER', 'TEST_USERNAME': '$USERNAME',
622 'TEST_PASSWORD': '$PASSWORD',
623 'TEST_ENV': env
625 extra_path=[os.path.join(srcdir(), "samba/python"), ]
628 # Demote the vampire DC, it must be the last test each DC, before the dbcheck
629 for env in ['vampire_dc', 'promoted_dc', 'rodc']:
630 plantestsuite("samba4.blackbox.samba_tool_demote(%s)" % env, env, [os.path.join(samba4srcdir, "utils/tests/test_demote.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$DOMAIN', '$DC_SERVER', '$PREFIX/%s' % env, smbclient4])
632 # TODO: Verifying the databases really should be a part of the
633 # environment teardown.
634 # check the databases are all OK. PLEASE LEAVE THIS AS THE LAST TEST
635 for env in ["ad_dc_ntvfs", "ad_dc", "fl2000dc", "fl2003dc", "fl2008r2dc", 'vampire_dc', 'promoted_dc']:
636 plantestsuite("samba4.blackbox.dbcheck(%s)" % env, env + ":local" , ["PYTHON=%s" % python, os.path.join(bbdir, "dbcheck.sh"), '$PREFIX/provision', configuration])