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
22 sys
.path
.insert(0, os
.path
.join(os
.path
.dirname(__file__
), "../../selftest"))
23 from selftesthelpers
import *
26 samba4srcdir
= source4dir()
27 samba4bindir
= bindir()
28 smb4torture
= binpath("smbtorture4")
29 smb4torture_testsuite_list
= subprocess
.Popen([smb4torture
, "--list-suites"], stdout
=subprocess
.PIPE
, stderr
=subprocess
.PIPE
).communicate("")[0].splitlines()
30 validate
= os
.getenv("VALIDATE", "")
32 validate_list
= [validate
]
36 nmblookup
= binpath('nmblookup4')
37 smbclient
= binpath('smbclient4')
39 def plansmbtorturetestsuite(name
, env
, options
, modname
=None):
41 modname
= "samba4.%s" % name
42 if isinstance(options
, list):
43 options
= " ".join(options
)
44 cmdline
= "%s $LISTOPT %s %s" % (valgrindify(smb4torture
), options
, name
)
45 plantestsuite_loadlist(modname
, env
, cmdline
)
47 def smb4torture_testsuites(prefix
):
48 return filter(lambda x
: x
.startswith(prefix
), smb4torture_testsuite_list
)
50 subprocess
.call([smb4torture
, "-V"], stdout
=sys
.stderr
)
52 bbdir
= os
.path
.join(srcdir(), "testprogs/blackbox")
54 torture_options
= [configuration
, "--maximum-runtime=$SELFTEST_MAXTIME", "--target=samba4", "--basedir=$SELFTEST_TMPDIR"]
55 if not os
.getenv("SELFTEST_VERBOSE"):
56 torture_options
.append("--option=torture:progress=no")
57 torture_options
.append("--format=subunit")
58 if os
.getenv("SELFTEST_QUICK"):
59 torture_options
.append("--option=torture:quick=yes")
60 smb4torture
+= " " + " ".join(torture_options
)
62 print >>sys
.stderr
, "OPTIONS %s" % " ".join(torture_options
)
64 # Simple tests for LDAP and CLDAP
65 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']:
66 plantestsuite("samba4.ldb.ldap with options %s(dc)" % options
, "dc", "%s/test_ldb.sh ldap $SERVER %s" % (bbdir
, options
))
68 # see if we support ADS on the Samba3 side
70 config_h
= os
.environ
["CONFIG_H"]
72 config_h
= os
.path
.join(samba4bindir
, "default/include/config.h")
74 # see if we support ldaps
75 f
= open(config_h
, 'r')
77 have_tls_support
= ("ENABLE_GNUTLS 1" in f
.read())
82 for options
in ['-U"$USERNAME%$PASSWORD"']:
83 plantestsuite("samba4.ldb.ldaps with options %s(dc)" % options
, "dc",
84 "%s/test_ldb.sh ldaps $SERVER_IP %s" % (bbdir
, options
))
86 for options
in ['-U"$USERNAME%$PASSWORD"']:
87 plantestsuite("samba4.ldb.ldapi with options %s(dc:local)" % options
, "dc:local",
88 "%s/test_ldb.sh ldapi $PREFIX_ABS/dc/private/ldapi %s" % (bbdir
, options
))
90 for t
in smb4torture_testsuites("ldap."):
91 plansmbtorturetestsuite(t
, "dc", '-U"$USERNAME%$PASSWORD" //$SERVER_IP/_none_')
93 ldbdir
= os
.path
.join(srcdir(), "lib/ldb")
94 # Don't run LDB tests when using system ldb, as we won't have ldbtest installed
95 if os
.path
.exists(os
.path
.join(samba4bindir
, "ldbtest")):
96 plantestsuite("ldb.base", "none", "%s/tests/test-tdb-subunit.sh %s" % (ldbdir
, samba4bindir
))
98 skiptestsuite("ldb.base", "Using system LDB, ldbtest not available")
102 # add tests to this list as they start passing, so we test
103 # that they stay passing
104 ncacn_np_tests
= ["rpc.schannel", "rpc.join", "rpc.lsa", "rpc.dssetup", "rpc.altercontext", "rpc.multibind", "rpc.netlogon", "rpc.handles", "rpc.samsync", "rpc.samba3-sessionkey", "rpc.samba3-getusername", "rpc.samba3-lsa", "rpc.samba3-bind", "rpc.samba3-netlogon", "rpc.asyncbind", "rpc.lsalookup", "rpc.lsa-getuser", "rpc.schannel2", "rpc.authcontext"]
105 ncalrpc_tests
= ["rpc.schannel", "rpc.join", "rpc.lsa", "rpc.dssetup", "rpc.altercontext", "rpc.multibind", "rpc.netlogon", "rpc.drsuapi", "rpc.asyncbind", "rpc.lsalookup", "rpc.lsa-getuser", "rpc.schannel2", "rpc.authcontext"]
106 drs_rpc_tests
= smb4torture_testsuites("drs.rpc")
107 ncacn_ip_tcp_tests
= ["rpc.schannel", "rpc.join", "rpc.lsa", "rpc.dssetup", "rpc.multibind", "rpc.netlogon", "rpc.asyncbind", "rpc.lsalookup", "rpc.lsa-getuser", "rpc.schannel2", "rpc.authcontext"] + drs_rpc_tests
108 slow_ncacn_np_tests
= ["rpc.samlogon", "rpc.samr.users", "rpc.samr.large-dc", "rpc.samr.users.privileges", "rpc.samr.passwords", "rpc.samr.passwords.pwdlastset"]
109 slow_ncacn_ip_tcp_tests
= ["rpc.samr", "rpc.cracknames"]
111 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"]
113 # Make sure all tests get run
114 rpc_tests
= smb4torture_testsuites("rpc.")
115 auto_rpc_tests
= filter(lambda t
: t
not in all_rpc_tests
, rpc_tests
)
117 for bindoptions
in ["seal,padcheck"] + validate_list
+ ["bigendian"]:
118 for transport
in ["ncalrpc", "ncacn_np", "ncacn_ip_tcp"]:
120 if transport
== "ncalrpc":
121 tests
= ncalrpc_tests
123 elif transport
== "ncacn_np":
124 tests
= ncacn_np_tests
125 elif transport
== "ncacn_ip_tcp":
126 tests
= ncacn_ip_tcp_tests
128 raise AssertionError("invalid transport %r"% transport
)
130 plansmbtorturetestsuite(t
, env
, ["%s:$SERVER[%s]" % (transport
, bindoptions
), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.%s on %s with %s" % (t
, transport
, bindoptions
))
131 plansmbtorturetestsuite('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
))
133 #Plugin S4 DC tests (confirms named pipe auth forwarding). This can be expanded once kerberos is supported in the plugin DC
135 for bindoptions
in ["seal,padcheck"] + validate_list
+ ["bigendian"]:
136 for t
in ncacn_np_tests
:
138 transport
= "ncacn_np"
139 plansmbtorturetestsuite(t
, env
, ["%s:$SERVER[%s]" % (transport
, bindoptions
), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.%s with %s" % (t
, bindoptions
))
141 for bindoptions
in [""] + validate_list
+ ["bigendian"]:
142 for t
in auto_rpc_tests
:
143 plansmbtorturetestsuite(t
, "dc", ["$SERVER[%s]" % bindoptions
, '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.%s with %s" % (t
, bindoptions
))
146 plansmbtorturetestsuite(t
, "dc:local", ["$SERVER[%s]" % bindoptions
, '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], modname
="samba4.%s" % t
)
148 for transport
in ["ncacn_np", "ncacn_ip_tcp"]:
150 if transport
== "ncacn_np":
151 tests
= slow_ncacn_np_tests
152 elif transport
== "ncacn_ip_tcp":
153 tests
= slow_ncacn_ip_tcp_tests
155 raise AssertionError("Invalid transport %r" % transport
)
157 plansmbtorturetestsuite(t
, env
, ["%s:$SERVER" % transport
, '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.%s on %s" % (t
, transport
))
159 # Tests for the DFS referral calls implementation
160 for t
in smb4torture_testsuites("dfs."):
161 plansmbtorturetestsuite(t
, "dc", '//$SERVER/ipc\$ -U$USERNAME%$PASSWORD')
162 plansmbtorturetestsuite(t
, "plugin_s4_dc", '//$SERVER/ipc\$ -U$USERNAME%$PASSWORD')
164 # Tests for the NET API (net.api.become.dc tested below against all the roles)
165 net_tests
= filter(lambda x
: "net.api.become.dc" not in x
, smb4torture_testsuites("net."))
167 plansmbtorturetestsuite(t
, "dc", '$SERVER[%s] -U$USERNAME%%$PASSWORD -W$DOMAIN' % validate
)
169 # Tests for session keys and encryption of RPC pipes
170 # FIXME: Integrate these into a single smbtorture test
172 transport
= "ncacn_np"
173 for env
in ["dc", "s3dc"]:
175 "-k no --option=usespnego=yes",
176 "-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no",
177 "-k no --option=usespnego=yes --option=ntlmssp_client:56bit=yes",
178 "-k no --option=usespnego=yes --option=ntlmssp_client:56bit=no",
179 "-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=yes",
180 "-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=no",
181 "-k no --option=usespnego=yes --option=clientntlmv2auth=yes",
182 "-k no --option=usespnego=yes --option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no",
183 "-k no --option=usespnego=yes --option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=yes",
184 "-k no --option=usespnego=no --option=clientntlmv2auth=yes",
185 "-k no --option=gensec:spnego=no --option=clientntlmv2auth=yes",
186 "-k no --option=usespnego=no"]:
187 name
= "rpc.lsa.secrets on %s with with %s" % (transport
, ntlmoptions
)
188 plansmbtorturetestsuite('rpc.lsa.secrets', env
, ["%s:$SERVER[]" % (transport
), ntlmoptions
, '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', '--option=gensec:target_hostname=$NETBIOSNAME'], "samba4.%s" % name
)
189 plantestsuite("samba.blackbox.pdbtest", "%s:local" % env
, [os
.path
.join(bbdir
, "test_pdbtest.sh"), '$SERVER', "$PREFIX", smbclient
, '$SMB_CONF_PATH', configuration
])
191 transports
= ["ncacn_np", "ncacn_ip_tcp"]
193 #Kerberos varies between functional levels, so it is important to check this on all of them
194 for env
in ["dc", "fl2000dc", "fl2003dc", "fl2008r2dc", "plugin_s4_dc"]:
195 transport
= "ncacn_np"
196 plansmbtorturetestsuite('rpc.pac', env
, ["%s:$SERVER[]" % (transport
, ), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.pac on %s" % (transport
,))
197 plansmbtorturetestsuite('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
,))
198 plansmbtorturetestsuite('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
,))
199 plansmbtorturetestsuite('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
)
200 plansmbtorturetestsuite('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
)
201 for transport
in transports
:
202 plansmbtorturetestsuite('rpc.echo', env
, ["%s:$SERVER[]" % (transport
,), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.echo on %s" % (transport
, ))
204 # Echo tests test bulk Kerberos encryption of DCE/RPC
205 for bindoptions
in ["connect", "spnego", "spnego,sign", "spnego,seal"] + validate_list
+ ["padcheck", "bigendian", "bigendian,seal"]:
206 echooptions
= "--option=socket:testnonblock=True --option=torture:quick=yes -k yes"
207 plansmbtorturetestsuite('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
))
208 plansmbtorturetestsuite("net.api.become.dc", env
, '$SERVER[%s] -U$USERNAME%%$PASSWORD -W$DOMAIN' % validate
)
210 for bindoptions
in ["sign", "seal"]:
211 plansmbtorturetestsuite('rpc.backupkey', "dc", ["ncacn_np:$SERVER[%s]" % ( bindoptions
), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.backupkey with %s" % (bindoptions
))
213 for transport
in transports
:
214 for bindoptions
in ["sign", "seal"]:
216 "--option=ntlmssp_client:ntlm2=yes --option=torture:quick=yes",
217 "--option=ntlmssp_client:ntlm2=no --option=torture:quick=yes",
218 "--option=ntlmssp_client:ntlm2=yes --option=ntlmssp_client:128bit=no --option=torture:quick=yes",
219 "--option=ntlmssp_client:ntlm2=no --option=ntlmssp_client:128bit=no --option=torture:quick=yes",
220 "--option=ntlmssp_client:ntlm2=yes --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes",
221 "--option=ntlmssp_client:ntlm2=no --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes",
222 "--option=clientntlmv2auth=yes --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes",
223 "--option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:keyexchange=yes --option=torture:quick=yes",
224 "--option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes"]:
225 if transport
== "ncalrpc":
229 plansmbtorturetestsuite('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
))
231 plansmbtorturetestsuite('rpc.echo', "dc", ['ncacn_np:$SERVER[smb2]', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.rpc.echo on ncacn_np over smb2")
233 plansmbtorturetestsuite('ntp.signd', "dc:local", ['ncacn_np:$SERVER', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.ntp.signd")
235 nbt_tests
= smb4torture_testsuites("nbt.")
237 plansmbtorturetestsuite(t
, "dc", "//$SERVER/_none_ -U\"$USERNAME%$PASSWORD\"")
239 # Tests against the NTVFS POSIX backend
240 ntvfsargs
= ["--option=torture:sharedelay=10000", "--option=torture:oplocktimeout=3", "--option=torture:writetimeupdatedelay=50000"]
242 smb2
= smb4torture_testsuites("smb2.")
243 #The QFILEINFO-IPC test needs to be on ipc$
244 raw
= filter(lambda x
: "raw.qfileinfo.ipc" not in x
, smb4torture_testsuites("raw."))
245 base
= smb4torture_testsuites("base.")
247 netapi
= smb4torture_testsuites("netapi.")
249 libsmbclient
= smb4torture_testsuites("libsmbclient.")
251 for t
in base
+ raw
+ smb2
+ netapi
+ libsmbclient
:
252 plansmbtorturetestsuite(t
, "dc", ['//$SERVER/tmp', '-U$USERNAME%$PASSWORD'] + ntvfsargs
)
254 plansmbtorturetestsuite("raw.qfileinfo.ipc", "dc", '//$SERVER/ipc\$ -U$USERNAME%$PASSWORD')
256 for t
in smb4torture_testsuites("rap."):
257 plansmbtorturetestsuite(t
, "dc", '//$SERVER/IPC\$ -U$USERNAME%$PASSWORD')
259 # Tests against the NTVFS CIFS backend
261 plansmbtorturetestsuite(t
, "dc", ['//$NETBIOSNAME/cifs', '-U$USERNAME%$PASSWORD', '--kerberos=yes'] + ntvfsargs
, modname
="samba4.ntvfs.cifs.krb5.%s" % t
)
263 # Test NTVFS CIFS backend with S4U2Self and S4U2Proxy
265 plansmbtorturetestsuite(t
, "dc", ['//$NETBIOSNAME/cifs', '-U$USERNAME%$PASSWORD', '--kerberos=no'] + ntvfsargs
, "samba4.ntvfs.cifs.ntlm.%s" % t
)
266 plansmbtorturetestsuite(t
, "rpc_proxy", ['//$NETBIOSNAME/cifs_to_dc', '-U$DC_USERNAME%$DC_PASSWORD', '--kerberos=yes'] + ntvfsargs
, "samba4.ntvfs.cifs.krb5.%s" % t
)
267 plansmbtorturetestsuite(t
, "rpc_proxy", ['//$NETBIOSNAME/cifs_to_dc', '-U$DC_USERNAME%$DC_PASSWORD', '--kerberos=no'] + ntvfsargs
, "samba4.ntvfs.cifs.ntlm.%s" % t
)
269 plansmbtorturetestsuite('echo.udp', 'dc:local', '//$SERVER/whatever')
272 for t
in smb4torture_testsuites("local."):
273 #The local.resolve test needs a name to look up using real system (not emulated) name routines
274 plansmbtorturetestsuite(t
, "none", "ncalrpc:localhost")
276 # Confirm these tests with the system iconv too
277 for t
in ["local.convert_string_handle", "local.convert_string", "local.ndr"]:
278 options
= "ncalrpc: --option='iconv:use_builtin_handlers=false'"
279 plansmbtorturetestsuite(t
, "none", options
,
280 modname
="samba4.%s.system.iconv" % t
)
282 tdbtorture4
= binpath("tdbtorture")
283 if os
.path
.exists(tdbtorture4
):
284 plantestsuite("tdb.stress", "none", valgrindify(tdbtorture4
))
286 skiptestsuite("tdb.stress", "Using system TDB, tdbtorture not available")
288 plansmbtorturetestsuite("drs.unit", "none", "ncalrpc:")
291 for f
in sorted(os
.listdir(os
.path
.join(samba4srcdir
, "../pidl/tests"))):
292 if f
.endswith(".pl"):
293 planperltestsuite("pidl.%s" % f
[:-3], os
.path
.normpath(os
.path
.join(samba4srcdir
, "../pidl/tests", f
)))
296 planpythontestsuite("fl2003dc", "samba.tests.dns")
297 for t
in smb4torture_testsuites("dns_internal."):
298 plansmbtorturetestsuite(t
, "dc:local", '//$SERVER/whavever')
301 for t
in smb4torture_testsuites("dlz_bind9."):
302 #The dlz_bind9 tests needs to look at the DNS database
303 plansmbtorturetestsuite(t
, "chgdcpass:local", "ncalrpc:localhost")
305 planpythontestsuite("s3dc", "samba.tests.libsmb_samba_internal");
308 # tests that interact directly with the command-line tools rather than using
309 # the API. These mainly test that the various command-line options of commands
312 for env
in ["s3member", "s4member", "dc", "chgdcpass"]:
313 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', smbclient
])
315 plantestsuite("samba4.blackbox.samba_tool(dc:local)", "dc:local", [os
.path
.join(samba4srcdir
, "utils/tests/test_samba_tool.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$DOMAIN', smbclient
])
316 plantestsuite("samba4.blackbox.pkinit(dc:local)", "dc:local", [os
.path
.join(bbdir
, "test_pkinit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', "aes256-cts-hmac-sha1-96", smbclient
, configuration
])
317 plantestsuite("samba4.blackbox.kinit(dc:local)", "dc:local", [os
.path
.join(bbdir
, "test_kinit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', "aes256-cts-hmac-sha1-96", smbclient
, configuration
])
318 plantestsuite("samba4.blackbox.kinit(fl2000dc:local)", "fl2000dc:local", [os
.path
.join(bbdir
, "test_kinit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', "arcfour-hmac-md5", smbclient
, configuration
])
319 plantestsuite("samba4.blackbox.kinit(fl2008r2dc:local)", "fl2008r2dc:local", [os
.path
.join(bbdir
, "test_kinit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', "aes256-cts-hmac-sha1-96", smbclient
, configuration
])
320 plantestsuite("samba4.blackbox.ktpass(dc)", "dc", [os
.path
.join(bbdir
, "test_ktpass.sh"), '$PREFIX'])
321 plantestsuite("samba4.blackbox.passwords(dc:local)", "dc:local", [os
.path
.join(bbdir
, "test_passwords.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', "$PREFIX", smbclient
])
322 plantestsuite("samba4.blackbox.export.keytab(dc:local)", "dc:local", [os
.path
.join(bbdir
, "test_export_keytab.sh"), '$SERVER', '$USERNAME', '$REALM', '$DOMAIN', "$PREFIX", smbclient
])
323 plantestsuite("samba4.blackbox.cifsdd(dc)", "dc", [os
.path
.join(samba4srcdir
, "client/tests/test_cifsdd.sh"), '$SERVER', '$USERNAME', '$PASSWORD', "$DOMAIN"])
324 plantestsuite("samba4.blackbox.nmblookup(dc)", "dc", [os
.path
.join(samba4srcdir
, "utils/tests/test_nmblookup.sh"), '$NETBIOSNAME', '$NETBIOSALIAS', '$SERVER', '$SERVER_IP', nmblookup
])
325 plantestsuite("samba4.blackbox.locktest(dc)", "dc", [os
.path
.join(samba4srcdir
, "torture/tests/test_locktest.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$DOMAIN', '$PREFIX'])
326 plantestsuite("samba4.blackbox.masktest", "dc", [os
.path
.join(samba4srcdir
, "torture/tests/test_masktest.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$DOMAIN', '$PREFIX'])
327 plantestsuite("samba4.blackbox.gentest(dc)", "dc", [os
.path
.join(samba4srcdir
, "torture/tests/test_gentest.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$DOMAIN', "$PREFIX"])
328 plantestsuite("samba4.blackbox.wbinfo(dc:local)", "dc:local", [os
.path
.join(samba4srcdir
, "../nsswitch/tests/test_wbinfo.sh"), '$DOMAIN', '$USERNAME', '$PASSWORD', "dc"])
329 plantestsuite("samba4.blackbox.wbinfo(s4member:local)", "s4member:local", [os
.path
.join(samba4srcdir
, "../nsswitch/tests/test_wbinfo.sh"), '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', "s4member"])
330 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', smbclient
])
331 plantestsuite_loadlist("samba4.rpc.echo against NetBIOS alias", "dc", [valgrindify(smb4torture
), "$LISTOPT", 'ncacn_np:$NETBIOSALIAS', '-U$DOMAIN/$USERNAME%$PASSWORD', 'rpc.echo'])
333 # Tests using the "Simple" NTVFS backend
334 for t
in ["base.rw1"]:
335 plansmbtorturetestsuite(t
, "dc", ["//$SERVER/simple", '-U$USERNAME%$PASSWORD'], modname
="samba4.ntvfs.simple.%s" % t
)
337 # Domain S4member Tests
338 plansmbtorturetestsuite('rpc.echo', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], "samba4.rpc.echo against s4member server with local creds")
339 plansmbtorturetestsuite('rpc.echo', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'], "samba4.rpc.echo against s4member server with domain creds")
340 plansmbtorturetestsuite('rpc.samr', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], "samba4.rpc.samr against s4member server with local creds")
341 plansmbtorturetestsuite('rpc.samr.users', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], "samba4.rpc.samr.users against s4member server with local creds",)
342 plansmbtorturetestsuite('rpc.samr.passwords', "s4member", ['ncacn_np:$NETBIOSNAME', '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], "samba4.rpc.samr.passwords against s4member server with local creds")
343 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', smbclient
])
346 plansmbtorturetestsuite("rpc.echo", "rpc_proxy", ['ncacn_ip_tcp:$NETBIOSNAME', '-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'], modname
="samba4.rpc.echo against rpc proxy with domain creds")
351 "-k no --option=usespnego=no",
352 "-k no --option=gensec:spengo=no",
354 "-k yes --option=gensec:fake_gssapi_krb5=yes --option=gensec:gssapi_krb5=no"]:
355 for signing
in ["--signing=on", "--signing=required"]:
356 signoptions
= "%s %s" % (mech
, signing
)
357 name
= "smb.signing on with %s" % signoptions
358 plansmbtorturetestsuite('base.xcopy', "dc", ['//$NETBIOSNAME/xcopy_share', signoptions
, '-U$USERNAME%$PASSWORD'], modname
="samba4.%s" % name
)
362 "-k no --option=usespnego=no",
363 "-k no --option=gensec:spengo=no",
365 signoptions
= "%s --signing=off" % mech
366 name
= "smb.signing disabled on with %s" % signoptions
367 plansmbtorturetestsuite('base.xcopy', "s4member", ['//$NETBIOSNAME/xcopy_share', signoptions
, '-U$DC_USERNAME%$DC_PASSWORD'], "samba4.%s domain-creds" % name
)
368 plansmbtorturetestsuite('base.xcopy', "s3member", ['//$NETBIOSNAME/xcopy_share', signoptions
, '-U$DC_USERNAME%$DC_PASSWORD'], "samba4.%s domain-creds" % name
)
369 plansmbtorturetestsuite('base.xcopy', "plugin_s4_dc", ['//$NETBIOSNAME/xcopy_share', signoptions
, '-U$USERNAME%$PASSWORD'], "samba4.%s" % name
)
370 plansmbtorturetestsuite('base.xcopy', "plugin_s4_dc",
371 ['//$NETBIOSNAME/xcopy_share', signoptions
, '-U$DC_USERNAME%$DC_PASSWORD'], "samba4.%s administrator" % name
)
373 plantestsuite("samba4.blackbox.bogusdomain", "s3member", ["testprogs/blackbox/bogus.sh", "$NETBIOSNAME", "xcopy_share", '$USERNAME', '$PASSWORD', '$DC_USERNAME', '$DC_PASSWORD', smbclient
])
376 "-k no --option=usespnego=no",
377 "-k no --option=gensec:spengo=no"]:
378 signoptions
= "%s --signing=off" % mech
379 plansmbtorturetestsuite('base.xcopy', "s4member", ['//$NETBIOSNAME/xcopy_share', signoptions
, '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], modname
="samba4.smb.signing on with %s local-creds" % signoptions
)
381 plansmbtorturetestsuite('base.xcopy', "dc", ['//$NETBIOSNAME/xcopy_share', '-k', 'no', '--signing=yes', '-U%'], modname
="samba4.smb.signing --signing=yes anon")
382 plansmbtorturetestsuite('base.xcopy', "dc", ['//$NETBIOSNAME/xcopy_share', '-k', 'no', '--signing=required', '-U%'], modname
="samba4.smb.signing --signing=required anon")
383 plansmbtorturetestsuite('base.xcopy', "s4member", ['//$NETBIOSNAME/xcopy_share', '-k', 'no', '--signing=no', '-U%'], modname
="samba4.smb.signing --signing=no anon")
386 wb_opts
= ["--option=\"torture:strict mode=no\"", "--option=\"torture:timelimit=1\"", "--option=\"torture:winbindd_separator=/\"", "--option=\"torture:winbindd_netbios_name=$SERVER\"", "--option=\"torture:winbindd_netbios_domain=$DOMAIN\""]
388 winbind_struct_tests
= smb4torture_testsuites("winbind.struct")
389 winbind_ndr_tests
= smb4torture_testsuites("winbind.ndr")
390 for env
in ["plugin_s4_dc", "dc", "s4member"]:
391 for t
in winbind_struct_tests
:
392 plansmbtorturetestsuite(t
, env
, wb_opts
+ ['//_none_/_none_'])
394 for t
in winbind_ndr_tests
:
395 plansmbtorturetestsuite(t
, env
, wb_opts
+ ['//_none_/_none_'])
397 nsstest4
= binpath("nsstest")
398 for env
in ["plugin_s4_dc", "dc", "s4member", "s3dc", "s3member", "member"]:
399 if os
.path
.exists(nsstest4
):
400 plantestsuite("samba4.nss.test using winbind(%s)" % env
, env
, [os
.path
.join(bbdir
, "nsstest.sh"), nsstest4
, os
.path
.join(samba4bindir
, "default/nsswitch/libnss-winbind.so")])
402 skiptestsuite("samba4.nss.test using winbind(%s)" % env
, "nsstest not available")
404 subunitrun
= valgrindify(python
) + " " + os
.path
.join(samba4srcdir
, "scripting/bin/subunitrun")
405 def planoldpythontestsuite(env
, module
, name
=None, extra_path
=[], environ
={}, extra_args
=[]):
406 environ
= dict(environ
)
407 py_path
= list(extra_path
)
409 environ
["PYTHONPATH"] = ":".join(["$PYTHONPATH"] + py_path
)
410 args
= ["%s=%s" % item
for item
in environ
.iteritems()]
411 args
+= [subunitrun
, "$LISTOPT", module
]
415 plantestsuite(name
, env
, args
)
417 planoldpythontestsuite("dc:local", "samba.tests.gensec", extra_args
=['-U"$USERNAME%$PASSWORD"'])
418 planoldpythontestsuite("none", "simple", extra_path
=["%s/lib/tdb/python/tests" % srcdir()], name
="tdb.python")
419 planpythontestsuite("dc:local", "samba.tests.dcerpc.sam")
420 planpythontestsuite("dc:local", "samba.tests.dsdb")
421 planpythontestsuite("dc:local", "samba.tests.dcerpc.bare")
422 planpythontestsuite("dc:local", "samba.tests.dcerpc.unix")
423 planpythontestsuite("dc:local", "samba.tests.dcerpc.srvsvc")
424 planpythontestsuite("dc:local", "samba.tests.samba_tool.timecmd")
425 planpythontestsuite("dc:local", "samba.tests.samba_tool.user")
426 planpythontestsuite("dc:local", "samba.tests.samba_tool.group")
427 planpythontestsuite("plugin_s4_dc:local", "samba.tests.samba_tool.ntacl")
429 planpythontestsuite("dc:local", "samba.tests.dcerpc.rpcecho")
430 planoldpythontestsuite("dc:local", "samba.tests.dcerpc.registry", extra_args
=['-U"$USERNAME%$PASSWORD"'])
431 planoldpythontestsuite("dc", "samba.tests.dcerpc.dnsserver", extra_args
=['-U"$USERNAME%$PASSWORD"'])
432 planoldpythontestsuite("plugin_s4_dc", "samba.tests.dcerpc.dnsserver", extra_args
=['-U"$USERNAME%$PASSWORD"'])
433 plantestsuite("samba4.ldap.python(dc)", "dc", [python
, os
.path
.join(samba4srcdir
, "dsdb/tests/python/ldap.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
434 plantestsuite("samba4.tokengroups.python(dc)", "dc:local", [python
, os
.path
.join(samba4srcdir
, "dsdb/tests/python/token_group.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
435 plantestsuite("samba4.sam.python(dc)", "dc", [python
, os
.path
.join(samba4srcdir
, "dsdb/tests/python/sam.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
436 planoldpythontestsuite("dc", "dsdb_schema_info",
437 extra_path
=[os
.path
.join(samba4srcdir
, 'dsdb/tests/python')],
438 name
="samba4.schemaInfo.python(dc)",
439 extra_args
=['-U"$DOMAIN/$DC_USERNAME%$DC_PASSWORD"'])
440 plantestsuite("samba4.urgent_replication.python(dc)", "dc:local", [python
, os
.path
.join(samba4srcdir
, "dsdb/tests/python/urgent_replication.py"), '$PREFIX_ABS/dc/private/sam.ldb'], allow_empty_output
=True)
441 plantestsuite("samba4.ldap.dirsync.python(dc)", "dc", [python
, os
.path
.join(samba4srcdir
, "dsdb/tests/python/dirsync.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
442 plantestsuite("samba4.ldap.sites.python(dc)", "dc", [python
, os
.path
.join(samba4srcdir
, "dsdb/tests/python/sites.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
443 for env
in ["dc", "fl2000dc", "fl2003dc", "fl2008r2dc"]:
444 plantestsuite("samba4.ldap_schema.python(%s)" % env
, env
, [python
, os
.path
.join(samba4srcdir
, "dsdb/tests/python/ldap_schema.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
445 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"])
446 plantestsuite("samba4.ldap.secdesc.python(%s)" % env
, env
, [python
, os
.path
.join(samba4srcdir
, "dsdb/tests/python/sec_descriptor.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
447 plantestsuite("samba4.ldap.acl.python(%s)" % env
, env
, [python
, os
.path
.join(samba4srcdir
, "dsdb/tests/python/acl.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
448 if env
!= "fl2000dc":
449 # This test makes excessive use of the "userPassword" attribute which
450 # isn't available on DCs with Windows 2000 domain function level -
451 # therefore skip it in that configuration
452 plantestsuite("samba4.ldap.passwords.python(%s)" % env
, env
, [python
, os
.path
.join(samba4srcdir
, "dsdb/tests/python/passwords.py"), "$SERVER", '-U"$USERNAME%$PASSWORD"', "-W$DOMAIN"])
454 planpythontestsuite("dc:local", "samba.tests.upgradeprovisionneeddc")
455 planpythontestsuite("plugin_s4_dc:local", "samba.tests.posixacl")
456 plantestsuite("samba4.deletetest.python(dc)", "dc", ['PYTHONPATH="$PYTHONPATH:%s/lib/subunit/python:%s/lib/testtools"' % (srcdir(), srcdir()),
457 python
, os
.path
.join(samba4srcdir
, "dsdb/tests/python/deletetest.py"),
458 '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
459 plantestsuite("samba4.blackbox.samba3dump", "none", [python
, os
.path
.join(samba4srcdir
, "scripting/bin/samba3dump"), os
.path
.join(samba4srcdir
, "../testdata/samba3")], allow_empty_output
=True)
460 plantestsuite("samba4.blackbox.upgrade", "none", ["PYTHON=%s" % python
, os
.path
.join(samba4srcdir
, "setup/tests/blackbox_s3upgrade.sh"), '$PREFIX/provision'])
461 plantestsuite("samba4.blackbox.provision.py", "none", ["PYTHON=%s" % python
, os
.path
.join(samba4srcdir
, "setup/tests/blackbox_provision.sh"), '$PREFIX/provision'])
462 plantestsuite("samba4.blackbox.upgradeprovision.py", "none", ["PYTHON=%s" % python
, os
.path
.join(samba4srcdir
, "setup/tests/blackbox_upgradeprovision.sh"), '$PREFIX/provision'])
463 plantestsuite("samba4.blackbox.setpassword.py", "none", ["PYTHON=%s" % python
, os
.path
.join(samba4srcdir
, "setup/tests/blackbox_setpassword.sh"), '$PREFIX/provision'])
464 plantestsuite("samba4.blackbox.newuser.py", "none", ["PYTHON=%s" % python
, os
.path
.join(samba4srcdir
, "setup/tests/blackbox_newuser.sh"), '$PREFIX/provision'])
465 plantestsuite("samba4.blackbox.group.py", "none", ["PYTHON=%s" % python
, os
.path
.join(samba4srcdir
, "setup/tests/blackbox_group.sh"), '$PREFIX/provision'])
466 plantestsuite("samba4.blackbox.spn.py(dc:local)", "dc:local", ["PYTHON=%s" % python
, os
.path
.join(samba4srcdir
, "setup/tests/blackbox_spn.sh"), '$PREFIX/dc'])
467 plantestsuite("samba4.ldap.bind(dc)", "dc", [python
, os
.path
.join(srcdir(), "auth/credentials/tests/bind.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"'])
470 planoldpythontestsuite("vampire_dc", "samba.tests.blackbox.samba_tool_drs",
471 environ
={'DC1': '$DC_SERVER', 'DC2': '$VAMPIRE_DC_SERVER'},
472 extra_args
=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
473 planoldpythontestsuite("vampire_dc:local", "replica_sync",
474 extra_path
=[os
.path
.join(samba4srcdir
, 'torture/drs/python')],
475 name
="samba4.drs.replica_sync.python(vampire_dc)",
476 environ
={'DC1': '$DC_SERVER', 'DC2': '$VAMPIRE_DC_SERVER'},
477 extra_args
=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
478 planoldpythontestsuite("vampire_dc", "delete_object",
479 extra_path
=[os
.path
.join(samba4srcdir
, 'torture/drs/python')],
480 name
="samba4.drs.delete_object.python(vampire_dc)",
481 environ
={'DC1': '$DC_SERVER', 'DC2': '$VAMPIRE_DC_SERVER'},
482 extra_args
=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
483 planoldpythontestsuite("vampire_dc", "fsmo",
484 name
="samba4.drs.fsmo.python(vampire_dc)",
485 extra_path
=[os
.path
.join(samba4srcdir
, 'torture/drs/python')],
486 environ
={'DC1': "$DC_SERVER", 'DC2': "$VAMPIRE_DC_SERVER"},
487 extra_args
=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
488 planoldpythontestsuite("vampire_dc", "repl_schema",
489 extra_path
=[os
.path
.join(samba4srcdir
, 'torture/drs/python')],
490 name
="samba4.drs.repl_schema.python(vampire_dc)",
491 environ
={'DC1': "$DC_SERVER", 'DC2': '$VAMPIRE_DC_SERVER'},
492 extra_args
=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
494 # This makes sure we test the rid allocation code
495 t
= "rpc.samr.large-dc"
496 plansmbtorturetestsuite(t
, "vampire_dc", ['$SERVER', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], modname
=("samba4.%s.one" % t
))
497 plansmbtorturetestsuite(t
, "vampire_dc", ['$SERVER', '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], modname
="samba4.%s.two" % t
)
501 plansmbtorturetestsuite('rpc.echo', env
, ['ncacn_np:$SERVER', "-k", "yes", '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], modname
="samba4.rpc.echo")
502 plansmbtorturetestsuite('rpc.echo', "%s:local" % env
, ['ncacn_np:$SERVER', "-k", "yes", '-P', '--workgroup=$DOMAIN'], modname
="samba4.rpc.echo")
503 plantestsuite("samba4.blackbox.provision-backend", "none", ["PYTHON=%s" % python
, os
.path
.join(samba4srcdir
, "setup/tests/blackbox_provision-backend.sh"), '$PREFIX/provision'])
505 # Test renaming the DC
506 plantestsuite("samba4.blackbox.renamedc.sh", "none", ["PYTHON=%s" % python
, os
.path
.join(bbdir
, "renamedc.sh"), '$PREFIX/provision'])
508 # Demote the vampire DC, it must be the last test on the VAMPIRE DC
509 for env
in ['vampire_dc', 'promoted_vampire_dc']:
510 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
, smbclient
])
511 # check the databases are all OK. PLEASE LEAVE THIS AS THE LAST TEST
512 for env
in ["dc", "fl2000dc", "fl2003dc", "fl2008r2dc", 'vampire_dc', 'promoted_vampire_dc']:
513 plantestsuite("samba4.blackbox.dbcheck(%s)" % env
, env
+ ":local" , ["PYTHON=%s" % python
, os
.path
.join(bbdir
, "dbcheck.sh"), '$PREFIX/provision', configuration
])