tests password_hash: Add ldap based tests for WDigest
[Samba.git] / source4 / selftest / tests.py
blob00e15aa8a33f3eec8433844038896e8434b861da
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 auth_type in ['', '-k no', '-k yes']:
47 for auth_level in ['--option=clientldapsaslwrapping=plain', '--sign', '--encrypt']:
48 creds = '-U"$USERNAME%$PASSWORD"'
49 options = creds + ' ' + auth_type + ' ' + auth_level
50 plantestsuite("samba4.ldb.ldap with options %r(ad_dc_ntvfs)" % options, "ad_dc_ntvfs", "%s/test_ldb.sh ldap $SERVER %s" % (bbdir, options))
52 # see if we support ADS on the Samba3 side
53 try:
54 config_h = os.environ["CONFIG_H"]
55 except KeyError:
56 config_h = os.path.join(samba4bindir, "default/include/config.h")
58 # check available features
59 config_hash = dict()
60 f = open(config_h, 'r')
61 try:
62 lines = f.readlines()
63 config_hash = dict((x[0], ' '.join(x[1:]))
64 for x in map(lambda line: line.strip().split(' ')[1:],
65 filter(lambda line: (line[0:7] == '#define') and (len(line.split(' ')) > 2), lines)))
66 finally:
67 f.close()
69 have_tls_support = ("ENABLE_GNUTLS" in config_hash)
70 have_heimdal_support = ("SAMBA4_USES_HEIMDAL" in config_hash)
71 have_jansson_support = ("HAVE_JANSSON" in config_hash)
73 if have_tls_support:
74 for options in ['-U"$USERNAME%$PASSWORD"']:
75 plantestsuite("samba4.ldb.ldaps with options %s(ad_dc_ntvfs)" % options, "ad_dc_ntvfs",
76 "%s/test_ldb.sh ldaps $SERVER_IP %s" % (bbdir, options))
78 creds_options = [
79 '--simple-bind-dn=$USERNAME@$REALM --password=$PASSWORD',
81 peer_options = {
82 'SERVER_IP': '$SERVER_IP',
83 'SERVER_NAME': '$SERVER',
84 'SERVER.REALM': '$SERVER.$REALM',
86 tls_verify_options = [
87 '--option="tlsverifypeer=no_check"',
88 '--option="tlsverifypeer=ca_only"',
89 '--option="tlsverifypeer=ca_and_name_if_available"',
90 '--option="tlsverifypeer=ca_and_name"',
91 '--option="tlsverifypeer=as_strict_as_possible"',
94 # we use :local for fl2008r2dc because of the self-signed certificate
95 for env in ["ad_dc_ntvfs", "fl2008r2dc:local"]:
96 for peer_key in peer_options.keys():
97 peer_val = peer_options[peer_key]
98 for creds in creds_options:
99 for tls_verify in tls_verify_options:
100 options = creds + ' ' + tls_verify
101 plantestsuite("samba4.ldb.simple.ldaps with options %s %s(%s)" % (
102 peer_key, options, env), env,
103 "%s/test_ldb_simple.sh ldaps %s %s" % (bbdir, peer_val, options))
105 # test all "ldap server require strong auth" combinations
106 for env in ["ad_dc_ntvfs", "fl2008r2dc", "fl2003dc"]:
107 options = '--simple-bind-dn="$USERNAME@$REALM" --password="$PASSWORD"'
108 plantestsuite("samba4.ldb.simple.ldap with SIMPLE-BIND %s(%s)" % (options, env),
109 env, "%s/test_ldb_simple.sh ldap $SERVER %s" % (bbdir, options))
110 if have_tls_support:
111 options += ' --option="tlsverifypeer=no_check"'
112 plantestsuite("samba4.ldb.simple.ldaps with SIMPLE-BIND %s(%s)" % (options, env),
113 env, "%s/test_ldb_simple.sh ldaps $SERVER %s" % (bbdir, options))
115 auth_options = [
116 '--option=clientldapsaslwrapping=plain',
117 '--sign',
118 '--encrypt',
121 for auth_option in auth_options:
122 options = '-U"$USERNAME%$PASSWORD"' + ' ' + auth_option
123 plantestsuite("samba4.ldb.simple.ldap with SASL-BIND %s(%s)" % (options, env),
124 env, "%s/test_ldb_simple.sh ldap $SERVER %s" % (bbdir, options))
125 if have_tls_support:
126 options = '-U"$USERNAME%$PASSWORD" --option="tlsverifypeer=no_check"'
127 plantestsuite("samba4.ldb.simple.ldaps with SASL-BIND %s(%s)" % (options, env),
128 env, "%s/test_ldb_simple.sh ldaps $SERVER %s" % (bbdir, options))
130 for options in ['-U"$USERNAME%$PASSWORD"']:
131 plantestsuite("samba4.ldb.ldapi with options %s(ad_dc_ntvfs:local)" % options, "ad_dc_ntvfs:local",
132 "%s/test_ldb.sh ldapi $PREFIX_ABS/ad_dc_ntvfs/private/ldapi %s" % (bbdir, options))
134 for t in smbtorture4_testsuites("ldap."):
135 plansmbtorture4testsuite(t, "ad_dc_ntvfs", '-U"$USERNAME%$PASSWORD" //$SERVER_IP/_none_')
137 ldbdir = os.path.join(srcdir(), "lib/ldb")
138 # Don't run LDB tests when using system ldb, as we won't have ldbtest installed
139 if os.path.exists(os.path.join(samba4bindir, "ldbtest")):
140 plantestsuite("ldb.base", "none", "%s/tests/test-tdb-subunit.sh %s" % (ldbdir, samba4bindir))
141 else:
142 skiptestsuite("ldb.base", "Using system LDB, ldbtest not available")
144 # Tests for RPC
146 # add tests to this list as they start passing, so we test
147 # that they stay passing
148 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"]
149 ncalrpc_tests = ["rpc.schannel", "rpc.join", "rpc.lsa", "rpc.dssetup", "rpc.altercontext", "rpc.netlogon", "rpc.netlogon.admin", "rpc.asyncbind", "rpc.lsalookup", "rpc.lsa-getuser", "rpc.schannel2", "rpc.authcontext"]
150 drs_rpc_tests = smbtorture4_testsuites("drs.rpc")
151 ncacn_ip_tcp_tests = ["rpc.schannel", "rpc.join", "rpc.lsa", "rpc.dssetup", "rpc.drsuapi", "rpc.drsuapi_w2k8", "rpc.netlogon", "rpc.netlogon.admin", "rpc.asyncbind", "rpc.lsalookup", "rpc.lsa-getuser", "rpc.schannel2", "rpc.authcontext", "rpc.samr.passwords.validate"] + drs_rpc_tests
152 slow_ncacn_np_tests = ["rpc.samlogon", "rpc.samr", "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"]
153 slow_ncacn_ip_tcp_tests = ["rpc.cracknames"]
155 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"]
157 # Make sure all tests get run
158 rpc_tests = smbtorture4_testsuites("rpc.")
159 auto_rpc_tests = filter(lambda t: t not in all_rpc_tests, rpc_tests)
161 for bindoptions in ["seal,padcheck"] + validate_list + ["bigendian"]:
162 for transport in ["ncalrpc", "ncacn_np", "ncacn_ip_tcp"]:
163 env = "ad_dc_ntvfs"
164 if transport == "ncalrpc":
165 tests = ncalrpc_tests
166 env = "ad_dc_ntvfs:local"
167 elif transport == "ncacn_np":
168 tests = ncacn_np_tests
169 elif transport == "ncacn_ip_tcp":
170 tests = ncacn_ip_tcp_tests
171 else:
172 raise AssertionError("invalid transport %r"% transport)
173 for t in tests:
174 plansmbtorture4testsuite(t, env, ["%s:$SERVER[%s]" % (transport, bindoptions), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.%s on %s with %s" % (t, transport, bindoptions))
175 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))
177 #Plugin S4 DC tests (confirms named pipe auth forwarding). This can be expanded once kerberos is supported in the plugin DC
179 for bindoptions in ["seal,padcheck"] + validate_list + ["bigendian"]:
180 for t in ncacn_np_tests:
181 env = "ad_dc"
182 transport = "ncacn_np"
183 plansmbtorture4testsuite(t, env, ["%s:$SERVER[%s]" % (transport, bindoptions), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.%s with %s" % (t, bindoptions))
185 for bindoptions in [""] + validate_list + ["bigendian"]:
186 for t in auto_rpc_tests:
187 plansmbtorture4testsuite(t, "ad_dc_ntvfs", ["$SERVER[%s]" % bindoptions, '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.%s with %s" % (t, bindoptions))
189 t = "rpc.countcalls"
190 plansmbtorture4testsuite(t, "ad_dc_ntvfs:local", ["$SERVER[%s]" % bindoptions, '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], modname="samba4.%s" % t)
192 for transport in ["ncacn_np", "ncacn_ip_tcp"]:
193 env = "ad_dc_ntvfs"
194 if transport == "ncacn_np":
195 tests = slow_ncacn_np_tests
196 elif transport == "ncacn_ip_tcp":
197 tests = slow_ncacn_ip_tcp_tests
198 else:
199 raise AssertionError("Invalid transport %r" % transport)
200 for t in tests:
201 bindoptions = ''
202 if t == 'rpc.cracknames':
203 bindoptions = 'seal'
204 plansmbtorture4testsuite(t, env, ["%s:$SERVER[%s]" % (transport,bindoptions), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.%s on %s with %s" % (t, transport, bindoptions))
206 # Tests for the DFS referral calls implementation
207 for t in smbtorture4_testsuites("dfs."):
208 plansmbtorture4testsuite(t, "ad_dc_ntvfs", '//$SERVER/ipc\$ -U$USERNAME%$PASSWORD')
209 plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/ipc\$ -U$USERNAME%$PASSWORD')
211 # Tests for the NET API (net.api.become.dc tested below against all the roles)
212 net_tests = filter(lambda x: "net.api.become.dc" not in x, smbtorture4_testsuites("net."))
213 for t in net_tests:
214 plansmbtorture4testsuite(t, "ad_dc_ntvfs", '$SERVER[%s] -U$USERNAME%%$PASSWORD -W$DOMAIN' % validate)
216 # Tests for session keys and encryption of RPC pipes
217 # FIXME: Integrate these into a single smbtorture test
219 transport = "ncacn_np"
220 for env in ["ad_dc_ntvfs", "nt4_dc"]:
221 for ntlmoptions in [
222 "-k no --option=usespnego=yes",
223 "-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no",
224 "-k no --option=usespnego=yes --option=ntlmssp_client:56bit=yes",
225 "-k no --option=usespnego=yes --option=ntlmssp_client:56bit=no",
226 "-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=yes",
227 "-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=no",
228 "-k no --option=usespnego=yes --option=clientntlmv2auth=yes",
229 "-k no --option=usespnego=yes --option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no",
230 "-k no --option=usespnego=yes --option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=yes",
231 "-k no --option=usespnego=no --option=clientntlmv2auth=yes",
232 "-k no --option=gensec:spnego=no --option=clientntlmv2auth=yes",
233 "-k no --option=usespnego=no"]:
234 name = "rpc.lsa.secrets on %s with with %s" % (transport, ntlmoptions)
235 plansmbtorture4testsuite('rpc.lsa.secrets', env, ["%s:$SERVER[]" % (transport), ntlmoptions, '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', '--option=gensec:target_hostname=$NETBIOSNAME'], "samba4.%s" % name)
236 plantestsuite("samba.blackbox.pdbtest(%s)" % env, "%s:local" % env, [os.path.join(bbdir, "test_pdbtest.sh"), '$SERVER', "$PREFIX", "pdbtest", smbclient4, '$SMB_CONF_PATH', configuration])
238 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=winbind'"])
239 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=winbind_wbclient'"])
241 transports = ["ncacn_np", "ncacn_ip_tcp"]
243 #Kerberos varies between functional levels, so it is important to check this on all of them
244 for env in ["ad_dc_ntvfs", "fl2000dc", "fl2003dc", "fl2008r2dc", "ad_dc"]:
245 transport = "ncacn_np"
246 plansmbtorture4testsuite('rpc.pac', env, ["%s:$SERVER[]" % (transport, ), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.pac on %s" % (transport,))
247 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,))
248 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,))
249 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,))
250 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,))
251 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,))
252 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)
253 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)
254 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)
256 # Winreg tests test bulk Kerberos encryption of DCE/RPC
257 # We test rpc.winreg here too, because the winreg interface if
258 # handled by the source3/rpc_server code.
259 for bindoptions in ["connect", "packet", "krb5", "krb5,packet", "krb5,sign", "krb5,seal", "spnego", "spnego,packet", "spnego,sign", "spnego,seal"]:
260 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))
262 for transport in transports:
263 plansmbtorture4testsuite('rpc.echo', env, ["%s:$SERVER[]" % (transport,), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.echo on %s" % (transport, ))
265 # Echo tests test bulk Kerberos encryption of DCE/RPC
266 for bindoptions in ["connect", "krb5", "krb5,sign", "krb5,seal", "spnego", "spnego,sign", "spnego,seal"] + validate_list + ["padcheck", "bigendian", "bigendian,seal"]:
267 echooptions = "--option=socket:testnonblock=True --option=torture:quick=yes -k yes"
268 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))
269 plansmbtorture4testsuite("net.api.become.dc", env, '$SERVER[%s] -U$USERNAME%%$PASSWORD -W$DOMAIN' % validate)
271 for bindoptions in ["sign", "seal"]:
272 plansmbtorture4testsuite('rpc.backupkey', "ad_dc_ntvfs", ["ncacn_np:$SERVER[%s]" % ( bindoptions), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.backupkey with %s" % (bindoptions))
274 for transport in transports:
275 for bindoptions in ["sign", "seal"]:
276 for ntlmoptions in [
277 "--option=ntlmssp_client:ntlm2=yes --option=torture:quick=yes",
278 "--option=ntlmssp_client:ntlm2=no --option=torture:quick=yes",
279 "--option=ntlmssp_client:ntlm2=yes --option=ntlmssp_client:128bit=no --option=torture:quick=yes",
280 "--option=ntlmssp_client:ntlm2=no --option=ntlmssp_client:128bit=no --option=torture:quick=yes",
281 "--option=ntlmssp_client:ntlm2=yes --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes",
282 "--option=ntlmssp_client:ntlm2=no --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes",
283 "--option=clientntlmv2auth=yes --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes",
284 "--option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:keyexchange=yes --option=torture:quick=yes",
285 "--option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes"]:
286 if transport == "ncalrpc":
287 env = "ad_dc_ntvfs:local"
288 else:
289 env = "ad_dc_ntvfs"
290 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))
292 plansmbtorture4testsuite('rpc.echo', "ad_dc_ntvfs", ['ncacn_np:$SERVER[smb2]', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.echo on ncacn_np over smb2")
293 for env in ["ad_dc", "nt4_dc"]:
294 plansmbtorture4testsuite('rpc.echo', env, ['60a15ec5-4de8-11d7-a637-005056a20182@ncacn_np:$SERVER[]', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', '--option=torture:quick=yes'], "samba4.rpc.echo on ncacn_np with object")
295 plansmbtorture4testsuite('rpc.echo', env, ['60a15ec5-4de8-11d7-a637-005056a20182@ncacn_ip_tcp:$SERVER[]', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', '--option=torture:quick=yes'], "samba4.rpc.echo on ncacn_ip_tcp with object")
297 plansmbtorture4testsuite('ntp.signd', "ad_dc_ntvfs:local", ['ncacn_np:$SERVER', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.ntp.signd")
299 nbt_tests = smbtorture4_testsuites("nbt.")
300 for t in nbt_tests:
301 plansmbtorture4testsuite(t, "ad_dc_ntvfs", "//$SERVER/_none_ -U\"$USERNAME%$PASSWORD\"")
303 # Tests against the NTVFS POSIX backend
304 ntvfsargs = ["--option=torture:sharedelay=100000", "--option=torture:oplocktimeout=3", "--option=torture:writetimeupdatedelay=500000"]
306 # Filter smb2 tests that should not run against ad_dc_ntvfs
307 smb2_s3only = ["smb2.change_notify_disabled", "smb2.dosmode", "smb2.credits", "smb2.kernel-oplocks"]
308 smb2 = [x for x in smbtorture4_testsuites("smb2.") if x not in smb2_s3only]
310 #The QFILEINFO-IPC test needs to be on ipc$
311 raw = filter(lambda x: "raw.qfileinfo.ipc" not in x, smbtorture4_testsuites("raw."))
312 base = smbtorture4_testsuites("base.")
314 netapi = smbtorture4_testsuites("netapi.")
316 libsmbclient = smbtorture4_testsuites("libsmbclient.")
318 for t in base + raw + smb2 + netapi + libsmbclient:
319 plansmbtorture4testsuite(t, "ad_dc_ntvfs", ['//$SERVER/tmp', '-U$USERNAME%$PASSWORD'] + ntvfsargs)
321 plansmbtorture4testsuite("raw.qfileinfo.ipc", "ad_dc_ntvfs", '//$SERVER/ipc\$ -U$USERNAME%$PASSWORD')
323 for t in smbtorture4_testsuites("rap."):
324 plansmbtorture4testsuite(t, "ad_dc_ntvfs", '//$SERVER/IPC\$ -U$USERNAME%$PASSWORD')
326 # Tests against the NTVFS CIFS backend
327 for t in base + raw:
328 plansmbtorture4testsuite(t, "ad_dc_ntvfs", ['//$NETBIOSNAME/cifs', '-U$USERNAME%$PASSWORD', '--kerberos=yes'] + ntvfsargs, modname="samba4.ntvfs.cifs.krb5.%s" % t)
330 # Test NTVFS CIFS backend with S4U2Self and S4U2Proxy
331 t = "base.unlink"
332 plansmbtorture4testsuite(t, "ad_dc_ntvfs", ['//$NETBIOSNAME/cifs', '-U$USERNAME%$PASSWORD', '--kerberos=no'] + ntvfsargs, "samba4.ntvfs.cifs.ntlm.%s" % t)
333 plansmbtorture4testsuite(t, "rpc_proxy", ['//$NETBIOSNAME/cifs_to_dc', '-U$DC_USERNAME%$DC_PASSWORD', '--kerberos=yes'] + ntvfsargs, "samba4.ntvfs.cifs.krb5.%s" % t)
334 plansmbtorture4testsuite(t, "rpc_proxy", ['//$NETBIOSNAME/cifs_to_dc', '-U$DC_USERNAME%$DC_PASSWORD', '--kerberos=no'] + ntvfsargs, "samba4.ntvfs.cifs.ntlm.%s" % t)
336 plansmbtorture4testsuite('echo.udp', 'ad_dc_ntvfs:local', '//$SERVER/whatever')
338 # Local tests
339 for t in smbtorture4_testsuites("local."):
340 #The local.resolve test needs a name to look up using real system (not emulated) name routines
341 plansmbtorture4testsuite(t, "none", "ncalrpc:localhost")
343 # Confirm these tests with the system iconv too
344 for t in ["local.convert_string_handle", "local.convert_string", "local.ndr"]:
345 options = "ncalrpc: --option='iconv:use_builtin_handlers=false'"
346 plansmbtorture4testsuite(t, "none", options,
347 modname="samba4.%s.system.iconv" % t)
349 tdbtorture4 = binpath("tdbtorture")
350 if os.path.exists(tdbtorture4):
351 plantestsuite("tdb.stress", "none", valgrindify(tdbtorture4))
352 else:
353 skiptestsuite("tdb.stress", "Using system TDB, tdbtorture not available")
355 plansmbtorture4testsuite("drs.unit", "none", "ncalrpc:")
357 # Pidl tests
358 for f in sorted(os.listdir(os.path.join(samba4srcdir, "../pidl/tests"))):
359 if f.endswith(".pl"):
360 planperltestsuite("pidl.%s" % f[:-3], os.path.normpath(os.path.join(samba4srcdir, "../pidl/tests", f)))
362 # DNS tests
363 plantestsuite_loadlist("samba.tests.dns", "fl2003dc:local", [python, os.path.join(srcdir(), "python/samba/tests/dns.py"), '$SERVER', '$SERVER_IP', '--machine-pass', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
365 plantestsuite_loadlist("samba.tests.dns_forwarder", "fl2003dc:local", [python, os.path.join(srcdir(), "python/samba/tests/dns_forwarder.py"), '$SERVER', '$SERVER_IP', '$DNS_FORWARDER1', '$DNS_FORWARDER2', '--machine-pass', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
367 plantestsuite_loadlist("samba.tests.dns_tkey", "fl2008r2dc", [python, os.path.join(srcdir(), "python/samba/tests/dns_tkey.py"), '$SERVER', '$SERVER_IP', '--machine-pass', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
369 for t in smbtorture4_testsuites("dns_internal."):
370 plansmbtorture4testsuite(t, "ad_dc_ntvfs:local", '//$SERVER/whavever')
372 # Local tests
373 for t in smbtorture4_testsuites("dlz_bind9."):
374 #The dlz_bind9 tests needs to look at the DNS database
375 plansmbtorture4testsuite(t, "chgdcpass:local", ["ncalrpc:$SERVER", '-U$USERNAME%$PASSWORD'])
377 planpythontestsuite("nt4_dc", "samba.tests.libsmb_samba_internal");
379 # Blackbox Tests:
380 # tests that interact directly with the command-line tools rather than using
381 # the API. These mainly test that the various command-line options of commands
382 # work correctly.
384 for env in ["ad_member", "s4member", "ad_dc_ntvfs", "chgdcpass"]:
385 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])
387 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])
388 plantestsuite("samba4.blackbox.net_rpc_user(ad_dc)", "ad_dc", [os.path.join(bbdir, "test_net_rpc_user.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$DOMAIN'])
390 if have_heimdal_support:
391 for env in ["ad_dc_ntvfs", "ad_dc"]:
392 plantestsuite("samba4.blackbox.pkinit(%s:local)" % env, "%s:local" % env, [os.path.join(bbdir, "test_pkinit_heimdal.sh"), '$SERVER', 'pkinit', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX/%s' % env, "aes256-cts-hmac-sha1-96", smbclient4, configuration])
393 plantestsuite("samba4.blackbox.pkinit_pac(%s:local)" % env, "%s:local" % env, [os.path.join(bbdir, "test_pkinit_pac_heimdal.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX/%s' % env, "aes256-cts-hmac-sha1-96", configuration])
394 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])
395 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])
396 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])
397 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"])
398 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"])
399 plantestsuite("samba4.blackbox.export.keytab(ad_dc_ntvfs:local)", "ad_dc_ntvfs:local", [os.path.join(bbdir, "test_export_keytab_heimdal.sh"), '$SERVER', '$USERNAME', '$REALM', '$DOMAIN', "$PREFIX", smbclient4])
400 plantestsuite("samba4.blackbox.kpasswd(ad_dc_ntvfs:local)", "ad_dc_ntvfs:local", [os.path.join(bbdir, "test_kpasswd_heimdal.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', "$PREFIX/ad_dc_ntvfs"])
401 else:
402 plantestsuite("samba4.blackbox.kinit(ad_dc_ntvfs:local)", "ad_dc_ntvfs:local", [os.path.join(bbdir, "test_kinit_mit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', smbclient4, configuration])
403 plantestsuite("samba4.blackbox.kinit(fl2000dc:local)", "fl2000dc:local", [os.path.join(bbdir, "test_kinit_mit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', smbclient4, configuration])
404 plantestsuite("samba4.blackbox.kinit(fl2008r2dc:local)", "fl2008r2dc:local", [os.path.join(bbdir, "test_kinit_mit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', smbclient4, configuration])
405 plantestsuite("samba4.blackbox.kinit_trust(fl2008r2dc:local)", "fl2008r2dc:local", [os.path.join(bbdir, "test_kinit_trusts_mit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$TRUST_SERVER', '$TRUST_USERNAME', '$TRUST_PASSWORD', '$TRUST_REALM', '$TRUST_DOMAIN', '$PREFIX', "forest"])
406 plantestsuite("samba4.blackbox.kinit_trust(fl2003dc:local)", "fl2003dc:local", [os.path.join(bbdir, "test_kinit_trusts_mit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$TRUST_SERVER', '$TRUST_USERNAME', '$TRUST_PASSWORD', '$TRUST_REALM', '$TRUST_DOMAIN', '$PREFIX', "external"])
407 plantestsuite("samba4.blackbox.export.keytab(ad_dc_ntvfs:local)", "ad_dc_ntvfs:local", [os.path.join(bbdir, "test_export_keytab_mit.sh"), '$SERVER', '$USERNAME', '$REALM', '$DOMAIN', "$PREFIX", smbclient4])
408 plantestsuite("samba4.blackbox.kpasswd(ad_dc_ntvfs:local)", "ad_dc_ntvfs:local", [os.path.join(bbdir, "test_kpasswd_mit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', "$PREFIX/ad_dc_ntvfs"])
410 plantestsuite("samba4.blackbox.trust_ntlm", "fl2008r2dc:local", [os.path.join(bbdir, "test_trust_ntlm.sh"), '$SERVER_IP', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$TRUST_USERNAME', '$TRUST_PASSWORD', '$TRUST_REALM', '$TRUST_DOMAIN', 'forest', 'auto', 'NT_STATUS_NO_TRUST_LSA_SECRET'])
411 plantestsuite("samba4.blackbox.trust_ntlm", "fl2003dc:local", [os.path.join(bbdir, "test_trust_ntlm.sh"), '$SERVER_IP', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$TRUST_USERNAME', '$TRUST_PASSWORD', '$TRUST_REALM', '$TRUST_DOMAIN', 'external', 'auto', 'NT_STATUS_NO_TRUST_LSA_SECRET'])
412 plantestsuite("samba4.blackbox.trust_ntlm", "ad_member:local", [os.path.join(bbdir, "test_trust_ntlm.sh"), '$SERVER_IP', '$USERNAME', '$PASSWORD', '$SERVER', '$SERVER', '$DC_USERNAME', '$DC_PASSWORD', '$REALM', '$DOMAIN', 'member', 'auto', 'NT_STATUS_LOGON_FAILURE'])
413 plantestsuite("samba4.blackbox.trust_ntlm", "nt4_member:local", [os.path.join(bbdir, "test_trust_ntlm.sh"), '$SERVER_IP', '$USERNAME', '$PASSWORD', '$SERVER', '$SERVER', '$DC_USERNAME', '$DC_PASSWORD', '$DOMAIN', '$DOMAIN', 'member', 'auto', 'NT_STATUS_LOGON_FAILURE'])
415 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"])
416 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"])
417 plantestsuite("samba4.blackbox.ktpass(ad_dc_ntvfs)", "ad_dc_ntvfs", [os.path.join(bbdir, "test_ktpass.sh"), '$PREFIX/ad_dc_ntvfs'])
418 plantestsuite("samba4.blackbox.password_settings(ad_dc_ntvfs:local)", "ad_dc_ntvfs:local", [os.path.join(bbdir, "test_password_settings.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', "$PREFIX/ad_dc_ntvfs"])
419 plantestsuite("samba4.blackbox.cifsdd(ad_dc_ntvfs)", "ad_dc_ntvfs", [os.path.join(samba4srcdir, "client/tests/test_cifsdd.sh"), '$SERVER', '$USERNAME', '$PASSWORD', "$DOMAIN"])
420 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])
421 plantestsuite("samba4.blackbox.locktest(ad_dc_ntvfs)", "ad_dc_ntvfs", [os.path.join(samba4srcdir, "torture/tests/test_locktest.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$DOMAIN', '$PREFIX'])
422 plantestsuite("samba4.blackbox.masktest", "ad_dc_ntvfs", [os.path.join(samba4srcdir, "torture/tests/test_masktest.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$DOMAIN', '$PREFIX'])
423 plantestsuite("samba4.blackbox.gentest(ad_dc_ntvfs)", "ad_dc_ntvfs", [os.path.join(samba4srcdir, "torture/tests/test_gentest.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$DOMAIN', "$PREFIX"])
424 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])
425 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])
426 plantestsuite("samba4.blackbox.samba_upgradedns(chgdcpass:local)", "chgdcpass:local", [os.path.join(bbdir, "test_samba_upgradedns.sh"), '$SERVER', '$REALM', '$PREFIX', '$SELFTEST_PREFIX/chgdcpass'])
427 plantestsuite("samba4.blackbox.net_ads(ad_dc:client)", "ad_dc:client", [os.path.join(bbdir, "test_net_ads.sh"), '$DC_SERVER', '$DC_USERNAME', '$DC_PASSWORD', '$PREFIX_ABS'])
428 plantestsuite("samba4.blackbox.client_etypes_all(ad_dc:client)", "ad_dc:client", [os.path.join(bbdir, "test_client_etypes.sh"), '$DC_SERVER', '$DC_USERNAME', '$DC_PASSWORD', '$PREFIX_ABS', 'all', '17_18_23'])
429 plantestsuite("samba4.blackbox.client_etypes_legacy(ad_dc:client)", "ad_dc:client", [os.path.join(bbdir, "test_client_etypes.sh"), '$DC_SERVER', '$DC_USERNAME', '$DC_PASSWORD', '$PREFIX_ABS', 'legacy', '23'])
430 plantestsuite("samba4.blackbox.client_etypes_strong(ad_dc:client)", "ad_dc:client", [os.path.join(bbdir, "test_client_etypes.sh"), '$DC_SERVER', '$DC_USERNAME', '$DC_PASSWORD', '$PREFIX_ABS', 'strong', '17_18'])
431 plantestsuite("samba4.blackbox.net_ads_dns(ad_member:local)", "ad_member:local", [os.path.join(bbdir, "test_net_ads_dns.sh"), '$DC_SERVER', '$DC_USERNAME', '$DC_PASSWORD', '$REALM', '$USERNAME', '$PASSWORD'])
432 plantestsuite_loadlist("samba4.rpc.echo against NetBIOS alias", "ad_dc_ntvfs", [valgrindify(smbtorture4), "$LISTOPT", "$LOADLIST", 'ncacn_np:$NETBIOSALIAS', '-U$DOMAIN/$USERNAME%$PASSWORD', 'rpc.echo'])
434 # Tests using the "Simple" NTVFS backend
435 for t in ["base.rw1"]:
436 plansmbtorture4testsuite(t, "ad_dc_ntvfs", ["//$SERVER/simple", '-U$USERNAME%$PASSWORD'], modname="samba4.ntvfs.simple.%s" % t)
438 # Domain S4member Tests
439 plansmbtorture4testsuite('rpc.echo', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], "samba4.rpc.echo against s4member server with local creds")
440 plansmbtorture4testsuite('rpc.echo', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'], "samba4.rpc.echo against s4member server with domain creds")
441 plansmbtorture4testsuite('rpc.samr', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], "samba4.rpc.samr against s4member server with local creds")
442 plansmbtorture4testsuite('rpc.samr.users', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], "samba4.rpc.samr.users against s4member server with local creds",)
443 plansmbtorture4testsuite('rpc.samr.passwords', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], "samba4.rpc.samr.passwords against s4member server with local creds")
444 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])
446 # RPC Proxy
447 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")
449 # Tests SMB signing
450 for mech in [
451 "-k no",
452 "-k no --option=usespnego=no",
453 "-k no --option=gensec:spengo=no",
454 "-k yes",
455 "-k yes --option=gensec:fake_gssapi_krb5=yes --option=gensec:gssapi_krb5=no"]:
456 for signing in ["--signing=on", "--signing=required"]:
457 signoptions = "%s %s" % (mech, signing)
458 name = "smb.signing on with %s" % signoptions
459 plansmbtorture4testsuite('base.xcopy', "ad_dc_ntvfs", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$USERNAME%$PASSWORD'], modname="samba4.%s" % name)
461 for mech in [
462 "-k no",
463 "-k no --option=usespnego=no",
464 "-k no --option=gensec:spengo=no",
465 "-k yes"]:
466 signoptions = "%s --signing=off" % mech
467 name = "smb.signing disabled on with %s" % signoptions
468 plansmbtorture4testsuite('base.xcopy', "s4member", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$DC_USERNAME%$DC_PASSWORD'], "samba4.%s domain-creds" % name)
469 plansmbtorture4testsuite('base.xcopy', "ad_member", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$DC_USERNAME%$DC_PASSWORD'], "samba4.%s domain-creds" % name)
470 plansmbtorture4testsuite('base.xcopy', "ad_dc", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$USERNAME%$PASSWORD'], "samba4.%s" % name)
471 plansmbtorture4testsuite('base.xcopy', "ad_dc",
472 ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$DC_USERNAME%$DC_PASSWORD'], "samba4.%s administrator" % name)
474 plantestsuite("samba4.blackbox.bogusdomain", "ad_member", ["testprogs/blackbox/bogus.sh", "$NETBIOSNAME", "xcopy_share", '$USERNAME', '$PASSWORD', '$DC_USERNAME', '$DC_PASSWORD', smbclient4])
475 for mech in [
476 "-k no",
477 "-k no --option=usespnego=no",
478 "-k no --option=gensec:spengo=no"]:
479 signoptions = "%s --signing=off" % mech
480 plansmbtorture4testsuite('base.xcopy', "s4member", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], modname="samba4.smb.signing on with %s local-creds" % signoptions)
482 plansmbtorture4testsuite('base.xcopy', "ad_dc_ntvfs", ['//$NETBIOSNAME/xcopy_share', '-k', 'no', '--signing=yes', '-U%'], modname="samba4.smb.signing --signing=yes anon")
483 plansmbtorture4testsuite('base.xcopy', "ad_dc_ntvfs", ['//$NETBIOSNAME/xcopy_share', '-k', 'no', '--signing=required', '-U%'], modname="samba4.smb.signing --signing=required anon")
484 plansmbtorture4testsuite('base.xcopy', "s4member", ['//$NETBIOSNAME/xcopy_share', '-k', 'no', '--signing=no', '-U%'], modname="samba4.smb.signing --signing=no anon")
487 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\""]
489 winbind_ad_client_tests = smbtorture4_testsuites("winbind.struct") + smbtorture4_testsuites("winbind.pac")
490 winbind_wbclient_tests = smbtorture4_testsuites("winbind.wbclient")
491 for env in ["ad_dc", "s4member", "ad_member", "nt4_member"]:
492 wb_opts = wb_opts_default[:]
493 if env in ["ad_member"]:
494 wb_opts += ["--option=\"torture:winbindd_domain_without_prefix=$DOMAIN\""]
495 for t in winbind_ad_client_tests:
496 plansmbtorture4testsuite(t, "%s:local" % env, wb_opts + ['//$SERVER/tmp', '--realm=$REALM', '--machine-pass', '--option=torture:addc=$DC_SERVER'])
498 for env in ["nt4_dc", "fl2003dc"]:
499 for t in winbind_wbclient_tests:
500 plansmbtorture4testsuite(t, "%s:local" % env, '//$SERVER/tmp -U$DC_USERNAME%$DC_PASSWORD')
502 for env in ["nt4_dc", "nt4_member", "ad_dc", "ad_member", "s4member", "chgdcpass", "rodc"]:
503 tests = ["--ping", "--separator",
504 "--own-domain",
505 "--all-domains",
506 "--trusted-domains",
507 "--domain-info=BUILTIN",
508 "--domain-info=$DOMAIN",
509 "--online-status",
510 "--online-status --domain=BUILTIN",
511 "--online-status --domain=$DOMAIN",
512 "--check-secret --domain=$DOMAIN",
513 "--change-secret --domain=$DOMAIN",
514 "--check-secret --domain=$DOMAIN",
515 "--online-status --domain=$DOMAIN",
516 "--domain-users",
517 "--domain-groups",
518 "--name-to-sid=$DC_USERNAME",
519 "--name-to-sid=$DOMAIN/$DC_USERNAME",
520 "--user-info=$DOMAIN/$DC_USERNAME",
521 "--user-groups=$DOMAIN/$DC_USERNAME",
522 "--authenticate=$DOMAIN/$DC_USERNAME%$DC_PASSWORD",
523 "--allocate-uid",
524 "--allocate-gid"]
526 for t in tests:
527 plantestsuite("samba.wbinfo_simple.(%s:local).%s" % (env, t), "%s:local" % env, [os.path.join(srcdir(), "nsswitch/tests/test_wbinfo_simple.sh"), t])
529 plantestsuite(
530 "samba.wbinfo_sids2xids.(%s:local)" % env, "%s:local" % env,
531 [os.path.join(samba3srcdir, "script/tests/test_wbinfo_sids2xids.sh")])
533 plantestsuite(
534 "samba.ntlm_auth.diagnostics(%s:local)" % env, "%s:local" % env,
535 [os.path.join(samba3srcdir, "script/tests/test_ntlm_auth_diagnostics.sh"), ntlm_auth3, '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', configuration])
537 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])
539 for env in ["s4member_dflt_domain", "s4member"]:
540 for cmd in ["id", "getent"]:
541 users = ["$DC_USERNAME", "$DC_USERNAME@$REALM"]
542 if env == "s4member":
543 users = ["$DOMAIN/$DC_USERNAME", "$DC_USERNAME@$REALM"]
544 for usr in users:
545 plantestsuite("samba4.winbind.dom_name_parse.cmd", env, "%s/dom_parse.sh %s %s" % (bbdir,cmd,usr))
547 nsstest4 = binpath("nsstest")
548 for env in ["ad_dc:local", "s4member:local", "nt4_dc:local", "ad_member:local", "nt4_member:local"]:
549 if os.path.exists(nsstest4):
550 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")])
551 else:
552 skiptestsuite("samba.nss.test using winbind(%s)" % env, "nsstest not available")
554 subunitrun = valgrindify(python) + " " + os.path.join(samba4srcdir, "scripting/bin/subunitrun")
555 if extra_python is not None:
556 subunitrun3 = valgrindify(extra_python) + " " + os.path.join(samba4srcdir, "scripting/bin/subunitrun")
557 def planoldpythontestsuite(env, module, name=None, extra_path=[], environ={}, extra_args=[], py3_compatible=False):
558 environ = dict(environ)
559 py_path = list(extra_path)
560 if py_path:
561 environ["PYTHONPATH"] = ":".join(["$PYTHONPATH"] + py_path)
562 args = ["%s=%s" % item for item in environ.iteritems()]
563 args += [subunitrun, "$LISTOPT", "$LOADLIST", module]
564 args += extra_args
565 if name is None:
566 name = module
567 plantestsuite_loadlist(name, env, args)
568 if py3_compatible and extra_python is not None:
569 args[0] = subunitrun3
570 plantestsuite_loadlist(name, env, args)
573 planoldpythontestsuite("ad_dc_ntvfs:local", "samba.tests.gensec", extra_args=['-U"$USERNAME%$PASSWORD"'], py3_compatible=True)
574 planoldpythontestsuite("none", "simple", extra_path=["%s/lib/tdb/python/tests" % srcdir()], name="tdb.python")
575 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dcerpc.sam")
576 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dsdb")
577 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dcerpc.bare")
578 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dcerpc.unix")
579 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dcerpc.srvsvc")
580 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.samba_tool.timecmd")
581 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.samba_tool.join")
583 # test fsmo show
584 for env in ["ad_dc_ntvfs", "fl2000dc", "fl2003dc", "fl2008r2dc"]:
585 planpythontestsuite(env + ":local", "samba.tests.samba_tool.fsmo")
587 # We run this test against both AD DC implemetnations because it is
588 # the only test we have of GPO get/set behaviour, and this involves
589 # the file server as well as the LDAP server.
590 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.samba_tool.gpo")
591 planpythontestsuite("ad_dc:local", "samba.tests.samba_tool.gpo")
593 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.samba_tool.processes")
594 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.samba_tool.user")
595 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.samba_tool.user_wdigest")
596 planpythontestsuite("ad_dc:local", "samba.tests.samba_tool.user")
597 planpythontestsuite("ad_dc:local", "samba.tests.samba_tool.user_virtualCryptSHA")
598 planpythontestsuite("chgdcpass:local", "samba.tests.samba_tool.user_check_password_script")
599 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.samba_tool.group")
600 planpythontestsuite("ad_dc:local", "samba.tests.samba_tool.ntacl")
602 planpythontestsuite("ad_dc:local", "samba.tests.samba_tool.sites")
603 planpythontestsuite("ad_dc:local", "samba.tests.samba_tool.dnscmd")
605 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dcerpc.rpcecho")
606 planoldpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dcerpc.registry", extra_args=['-U"$USERNAME%$PASSWORD"'])
607 planoldpythontestsuite("ad_dc_ntvfs", "samba.tests.dcerpc.dnsserver", extra_args=['-U"$USERNAME%$PASSWORD"'])
608 if have_jansson_support and have_heimdal_support:
609 planoldpythontestsuite("ad_dc:local", "samba.tests.auth_log", extra_args=['-U"$USERNAME%$PASSWORD"'],
610 environ={'CLIENT_IP': '127.0.0.11',
611 'SOCKET_WRAPPER_DEFAULT_IFACE': 11})
612 planoldpythontestsuite("ad_dc_ntvfs:local", "samba.tests.auth_log", extra_args=['-U"$USERNAME%$PASSWORD"'],
613 environ={'CLIENT_IP': '127.0.0.11',
614 'SOCKET_WRAPPER_DEFAULT_IFACE': 11})
615 planoldpythontestsuite("ad_dc:local", "samba.tests.auth_log_pass_change", extra_args=['-U"$USERNAME%$PASSWORD"'],
616 environ={'CLIENT_IP': '127.0.0.11',
617 'SOCKET_WRAPPER_DEFAULT_IFACE': 11})
618 planoldpythontestsuite("ad_dc_ntvfs:local", "samba.tests.auth_log_pass_change", extra_args=['-U"$USERNAME%$PASSWORD"'],
619 environ={'CLIENT_IP': '127.0.0.11',
620 'SOCKET_WRAPPER_DEFAULT_IFACE': 11})
621 planoldpythontestsuite("ad_dc_ntvfs:local", "samba.tests.auth_log_ncalrpc", extra_args=['-U"$USERNAME%$PASSWORD"'])
622 planoldpythontestsuite("ad_dc:local", "samba.tests.auth_log_ncalrpc", extra_args=['-U"$USERNAME%$PASSWORD"'])
623 planoldpythontestsuite("ad_dc:local",
624 "samba.tests.net_join_no_spnego",
625 extra_args=['-U"$USERNAME%$PASSWORD"'])
626 # Need to test the password hashing in multiple environments to ensure that
627 # all the possible options are covered
629 # ad_dc:local functional_level >= 2008, gpg keys available
630 planoldpythontestsuite("ad_dc:local",
631 "samba.tests.password_hash_gpgme",
632 extra_args=['-U"$USERNAME%$PASSWORD"'])
633 # ad_dc_ntvfs:local functional level >= 2008, gpg keys not available
634 planoldpythontestsuite("ad_dc_ntvfs:local",
635 "samba.tests.password_hash_fl2008",
636 extra_args=['-U"$USERNAME%$PASSWORD"'])
637 # fl2003dc:local functional level < 2008, gpg keys not available
638 planoldpythontestsuite("fl2003dc:local",
639 "samba.tests.password_hash_fl2003",
640 extra_args=['-U"$USERNAME%$PASSWORD"'])
641 # ad_dc: wDigest values over ldap
642 planoldpythontestsuite("ad_dc",
643 "samba.tests.password_hash_ldap",
644 extra_args=['-U"$USERNAME%$PASSWORD"'])
645 planoldpythontestsuite("ad_dc", "samba.tests.dcerpc.dnsserver", extra_args=['-U"$USERNAME%$PASSWORD"'])
646 planoldpythontestsuite("ad_dc", "samba.tests.dcerpc.raw_protocol", extra_args=['-U"$USERNAME%$PASSWORD"'])
647 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'])
648 plantestsuite_loadlist("samba4.tokengroups.krb5.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', '-k', 'yes', '$LOADLIST', '$LISTOPT'])
649 plantestsuite_loadlist("samba4.tokengroups.ntlm.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', '-k', 'no', '$LOADLIST', '$LISTOPT'])
650 plantestsuite("samba4.sam.python(fl2008r2dc)", "fl2008r2dc", [python, os.path.join(samba4srcdir, "dsdb/tests/python/sam.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
651 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'])
652 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'])
653 planoldpythontestsuite("ad_dc_ntvfs", "dsdb_schema_info",
654 extra_path=[os.path.join(samba4srcdir, 'dsdb/tests/python')],
655 name="samba4.schemaInfo.python(ad_dc_ntvfs)",
656 extra_args=['-U"$DOMAIN/$DC_USERNAME%$DC_PASSWORD"'])
657 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'])
658 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'])
659 plantestsuite_loadlist("samba4.ldap.match_rules.python", "ad_dc_ntvfs", [python, os.path.join(srcdir(), "lib/ldb-samba/tests/match_rules.py"), '$PREFIX_ABS/ad_dc_ntvfs/private/sam.ldb', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
660 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'])
661 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'])
663 plantestsuite_loadlist("samba4.ldap.sort.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/sort.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
664 plantestsuite_loadlist("samba4.ldap.vlv.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/vlv.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
665 plantestsuite_loadlist("samba4.ldap.linked_attributes.python(ad_dc_ntvfs)", "ad_dc_ntvfs:local", [python, os.path.join(samba4srcdir, "dsdb/tests/python/linked_attributes.py"), '$PREFIX_ABS/ad_dc_ntvfs/private/sam.ldb', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
667 plantestsuite_loadlist("samba4.ldap.rodc.python(rodc)", "rodc",
668 [python,
669 os.path.join(samba4srcdir, "dsdb/tests/python/rodc.py"),
670 '$SERVER', '-U"$USERNAME%$PASSWORD"',
671 '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
673 plantestsuite_loadlist("samba4.ldap.rodc_rwdc.python(rodc)", "rodc:local",
674 [python,
675 os.path.join(samba4srcdir,
676 "dsdb/tests/python/rodc_rwdc.py"),
677 '$SERVER', '$DC_SERVER', '-U"$USERNAME%$PASSWORD"',
678 '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
680 for env in ["ad_dc_ntvfs", "fl2000dc", "fl2003dc", "fl2008r2dc"]:
681 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'])
682 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"])
683 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'])
684 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'])
685 if env != "fl2000dc":
686 # This test makes excessive use of the "userPassword" attribute which
687 # isn't available on DCs with Windows 2000 domain function level -
688 # therefore skip it in that configuration
689 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'])
691 for env in ["ad_dc_ntvfs"]:
692 # This test takes a lot of time, so we run it against a minimum of
693 # environments, please only add new ones if there's really a
694 # difference we need to test
695 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'])
696 planoldpythontestsuite(env, "tombstone_reanimation",
697 name="samba4.tombstone_reanimation.python",
698 environ={'TEST_SERVER': '$SERVER', 'TEST_USERNAME': '$USERNAME', 'TEST_PASSWORD': '$PASSWORD'},
699 extra_path=[os.path.join(samba4srcdir, 'dsdb/tests/python')]
702 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.upgradeprovisionneeddc")
703 planpythontestsuite("ad_dc:local", "samba.tests.posixacl")
704 planpythontestsuite("ad_dc_no_nss:local", "samba.tests.posixacl")
705 plantestsuite_loadlist("samba4.deletetest.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/deletetest.py"),
706 '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
707 plantestsuite("samba4.blackbox.samba3dump", "none", [os.path.join(samba4srcdir, "selftest/test_samba3dump.sh")])
708 plantestsuite("samba4.blackbox.upgrade", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_s3upgrade.sh"), '$PREFIX/provision'])
709 plantestsuite("samba4.blackbox.provision.py", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_provision.sh"), '$PREFIX/provision'])
710 plantestsuite("samba4.blackbox.supported_features", "none",
711 ["PYTHON=%s" % python,
712 os.path.join(samba4srcdir,
713 "setup/tests/blackbox_supported_features.sh"),
714 '$PREFIX/provision'])
715 plantestsuite("samba4.blackbox.upgradeprovision.current", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_upgradeprovision.sh"), '$PREFIX/provision'])
716 plantestsuite("samba4.blackbox.setpassword.py", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_setpassword.sh"), '$PREFIX/provision'])
717 plantestsuite("samba4.blackbox.newuser.py", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_newuser.sh"), '$PREFIX/provision'])
718 plantestsuite("samba4.blackbox.group.py", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_group.sh"), '$PREFIX/provision'])
719 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'])
720 plantestsuite_loadlist("samba4.ldap.bind(fl2008r2dc)", "fl2008r2dc", [python, os.path.join(srcdir(), "auth/credentials/tests/bind.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '$LOADLIST', '$LISTOPT'])
722 # This makes sure we test the rid allocation code
723 t = "rpc.samr.large-dc"
724 plansmbtorture4testsuite(t, "vampire_dc", ['$SERVER', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], modname=("samba4.%s.one" % t))
725 plansmbtorture4testsuite(t, "vampire_dc", ['$SERVER', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], modname="samba4.%s.two" % t)
727 # some RODC testing
728 for env in ['rodc']:
729 plansmbtorture4testsuite('rpc.echo', env, ['ncacn_np:$SERVER', "-k", "yes", '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], modname="samba4.rpc.echo")
730 plansmbtorture4testsuite('rpc.echo', "%s:local" % env, ['ncacn_np:$SERVER', "-k", "yes", '-P', '--workgroup=$DOMAIN'], modname="samba4.rpc.echo")
731 plansmbtorture4testsuite('rpc.echo', "%s:local" % env, ['ncacn_np:$SERVER', "-k", "no", '-Utestallowed\ account%$DC_PASSWORD', '--workgroup=$DOMAIN'], modname="samba4.rpc.echo.testallowed")
732 plansmbtorture4testsuite('rpc.echo', "%s:local" % env, ['ncacn_np:$SERVER', "-k", "no", '-Utestdenied%$DC_PASSWORD', '--workgroup=$DOMAIN'], modname="samba4.rpc.echo.testdenied")
733 planpythontestsuite("rodc:local", "samba.tests.samba_tool.rodc")
735 plantestsuite("samba.blackbox.rpcclient_samlogon", "rodc:local", [os.path.join(samba3srcdir, "script/tests/test_rpcclient_samlogon.sh"),
736 "$DC_USERNAME", "$DC_PASSWORD", "ncacn_np:$SERVER", configuration])
738 plantestsuite("samba.blackbox.rpcclient_samlogon_testallowed", "rodc:local", [os.path.join(samba3srcdir, "script/tests/test_rpcclient_samlogon.sh"),
739 "testallowed\ account", "$DC_PASSWORD", "ncacn_np:$SERVER", configuration])
741 plantestsuite("samba.blackbox.rpcclient_samlogon_testdenied", "rodc:local", [os.path.join(samba3srcdir, "script/tests/test_rpcclient_samlogon.sh"),
742 "testdenied", "$DC_PASSWORD", "ncacn_np:$SERVER", configuration])
746 plantestsuite("samba4.blackbox.provision-backend", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_provision-backend.sh"), '$PREFIX/provision'])
748 # Test renaming the DC
749 plantestsuite("samba4.blackbox.renamedc.sh", "none", ["PYTHON=%s" % python, os.path.join(bbdir, "renamedc.sh"), '$PREFIX/provision'])
751 # DRS python tests
753 env = 'vampire_dc'
754 planoldpythontestsuite(env, "ridalloc_exop",
755 extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
756 name="samba4.drs.ridalloc_exop.python(%s)" % env,
757 environ={'DC1': "$DC_SERVER", 'DC2': '$%s_SERVER' % env.upper()},
758 extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
760 for env in ['vampire_dc', 'promoted_dc']:
761 planoldpythontestsuite("%s:local" % env, "samba_tool_drs",
762 extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
763 name="samba4.drs.samba_tool_drs.python(%s)" % env,
764 environ={'DC1': '$DC_SERVER', 'DC2': '$%s_SERVER' % env.upper()},
765 extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
766 planoldpythontestsuite("%s:local" % env, "replica_sync",
767 extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
768 name="samba4.drs.replica_sync.python(%s)" % env,
769 environ={'DC1': '$DC_SERVER', 'DC2': '$%s_SERVER' % env.upper()},
770 extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
771 planoldpythontestsuite(env, "delete_object",
772 extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
773 name="samba4.drs.delete_object.python(%s)" % env,
774 environ={'DC1': '$DC_SERVER', 'DC2': '$%s_SERVER' % env.upper()},
775 extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
776 planoldpythontestsuite(env, "fsmo",
777 name="samba4.drs.fsmo.python(%s)" % env,
778 extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
779 environ={'DC1': "$DC_SERVER", 'DC2': '$%s_SERVER' % env.upper()},
780 extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
781 planoldpythontestsuite(env, "repl_move",
782 extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
783 name="samba4.drs.repl_move.python(%s)" % env,
784 environ={'DC1': "$DC_SERVER", 'DC2': '$%s_SERVER' % env.upper()},
785 extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
786 planoldpythontestsuite(env, "getnc_exop",
787 extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
788 name="samba4.drs.getnc_exop.python(%s)" % env,
789 environ={'DC1': "$DC_SERVER", 'DC2': '$%s_SERVER' % env.upper()},
790 extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
791 planoldpythontestsuite(env, "linked_attributes_drs",
792 extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
793 name="samba4.drs.linked_attributes_drs.python(%s)" % env,
794 environ={'DC1': "$DC_SERVER", 'DC2': '$%s_SERVER' % env.upper()},
795 extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
797 for env in ['vampire_dc', 'promoted_dc', 'vampire_2000_dc']:
798 planoldpythontestsuite(env, "repl_schema",
799 extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
800 name="samba4.drs.repl_schema.python(%s)" % env,
801 environ={'DC1': "$DC_SERVER", 'DC2': '$%s_SERVER' % env.upper()},
802 extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
804 for env in ['ad_dc_ntvfs']:
805 planoldpythontestsuite(env, "repl_rodc",
806 extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
807 name="samba4.drs.repl_rodc.python(%s)" % env,
808 environ={'DC1': "$DC_SERVER", 'DC2': '$DC_SERVER'},
809 extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
811 planoldpythontestsuite("chgdcpass:local", "samba.tests.blackbox.samba_dnsupdate",
812 environ={'DNS_SERVER_IP': '$SERVER_IP'})
814 for env in ["ad_dc_ntvfs", "s4member", "rodc", "promoted_dc", "ad_dc", "ad_member"]:
815 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])
818 # KDC Tests
821 # This test is for users cached at the RODC
822 plansmbtorture4testsuite('krb5.kdc', "rodc", ['ncacn_np:$SERVER_IP', "-k", "yes", '-Utestdenied%$PASSWORD',
823 '--workgroup=$DOMAIN', '--realm=$REALM',
824 '--option=torture:krb5-upn=testdenied_upn@$REALM.upn',
825 '--option=torture:expect_rodc=true'],
826 "samba4.krb5.kdc with account DENIED permission to replicate to an RODC")
827 plansmbtorture4testsuite('krb5.kdc', "rodc", ['ncacn_np:$SERVER_IP', "-k", "yes", '-Utestallowed\ account%$PASSWORD',
828 '--workgroup=$DOMAIN', '--realm=$REALM',
829 '--option=torture:expect_machine_account=true',
830 '--option=torture:krb5-upn=testallowed\ upn@$REALM',
831 '--option=torture:krb5-hostname=testallowed',
832 '--option=torture:expect_rodc=true',
833 '--option=torture:expect_cached_at_rodc=true'],
834 "samba4.krb5.kdc with account ALLOWED permission to replicate to an RODC")
836 # This ensures we have correct behaviour on a server that is not not the PDC emulator
837 env="promoted_dc"
838 plansmbtorture4testsuite('krb5.kdc', env, ['ncacn_np:$SERVER_IP', "-k", "yes", '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', '--realm=$REALM'],
839 "samba4.krb5.kdc with specified account")
842 for env in ["rodc", "promoted_dc", "ad_dc", "fl2000dc", "fl2008r2dc"]:
843 if env == "rodc":
844 # The machine account is cached at the RODC, as it is the local account
845 extra_options = ['--option=torture:expect_rodc=true', '--option=torture:expect_cached_at_rodc=true']
846 else:
847 extra_options = []
849 plansmbtorture4testsuite('krb5.kdc', "%s:local" % env, ['ncacn_np:$SERVER_IP', "-k", "yes", '-P',
850 '--workgroup=$DOMAIN', '--realm=$REALM',
851 '--option=torture:krb5-hostname=$SERVER',
852 '--option=torture:run_removedollar_test=true',
853 '--option=torture:expect_machine_account=true'] + extra_options,
854 "samba4.krb5.kdc with machine account")
857 for env in [
858 'vampire_dc',
859 'promoted_dc']:
860 planoldpythontestsuite(env, "samba.tests.kcc",
861 name="samba.tests.kcc",
862 environ={'TEST_SERVER': '$SERVER', 'TEST_USERNAME': '$USERNAME',
863 'TEST_PASSWORD': '$PASSWORD',
864 'TEST_ENV': env
866 extra_path=[os.path.join(srcdir(), "samba/python"), ]
869 # Demote the vampire DC, it must be the last test each DC, before the dbcheck
870 for env in ['vampire_dc', 'promoted_dc', 'rodc']:
871 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])
873 # TODO: Verifying the databases really should be a part of the
874 # environment teardown.
875 # check the databases are all OK. PLEASE LEAVE THIS AS THE LAST TEST
876 for env in ["ad_dc_ntvfs", "ad_dc", "fl2000dc", "fl2003dc", "fl2008r2dc", 'vampire_dc', 'promoted_dc']:
877 plantestsuite("samba4.blackbox.dbcheck(%s)" % env, env + ":local" , ["PYTHON=%s" % python, os.path.join(bbdir, "dbcheck.sh"), '$PREFIX/provision', configuration])