s4 net: Add spn module to list/add/remove spn on objects
[samba.git] / source4 / selftest / tests.sh
1 #!/bin/sh
2 # This script generates a list of testsuites that should be run as part of 
3 # the Samba 4 test suite.
4
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".
8
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.
15
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.
20
21 if [ ! -n "$PERL" ]
22 then
23         PERL=perl
24 fi
25
26 if [ ! -n "$PYTHON" ]
27 then
28         PYTHON=python
29 fi
30
31 plantestsuite() {
32         name=$1
33         env=$2
34         shift 2
35         cmdline="$*"
36         echo "-- TEST --"
37         if [ "$env" = "none" ]; then
38                 echo "samba4.$name"
39         else
40                 echo "samba4.$name ($env)"
41         fi
42         echo $env
43         echo $cmdline
44 }
45
46 plantestsuite_loadlist() {
47         name=$1
48         env=$2
49         shift 2
50         cmdline="$*"
51         echo "-- TEST-LOADLIST --"
52         if [ "$env" = "none" ]; then
53                 echo "samba4.$name"
54         else
55                 echo "samba4.$name ($env)"
56         fi
57         echo $env
58         echo $cmdline
59 }
60
61 skiptestsuite() {
62         name=$1
63         reason=$2
64         shift 2
65         # FIXME: Report this using subunit, but re-adjust the testsuite count somehow
66         echo "skipping $name ($reason)"
67 }
68
69 normalize_testname() {
70         name=$1
71         shift 1
72         echo $name | tr "A-Z- " "a-z._"
73 }
74
75 planperltestsuite() {
76         name=$1
77         env=$2
78         shift 2
79         cmdline="$*"
80         if $PERL -e 'eval require Test::More;' > /dev/null 2>&1; then
81                 plantestsuite "$name" "$env" $PERL $cmdline "|" $TAP2SUBUNIT 
82         else
83                 skiptestsuite "$name" "Test::More not available"
84         fi
85 }
86
87 plansmbtorturetestsuite() {
88         name=$1
89         env=$2
90         shift 2
91         other_args="$*"
92         modname=`normalize_testname $name`
93         cmdline="$VALGRIND $smb4torture $other_args $name"
94         plantestsuite "$modname" "$env" $cmdline
95 }
96
97 samba4srcdir="`dirname $0`/.."
98 samba4bindir="$BUILDDIR/bin"
99 smb4torture="$samba4bindir/smbtorture${EXEEXT}"
100 if which tap2subunit 2>/dev/null; then
101         TAP2SUBUNIT=tap2subunit
102 else
103         TAP2SUBUNIT="PYTHONPATH=$samba4srcdir/../lib/subunit/python:$samba4srcdir/../lib/testtools $PYTHON $samba4srcdir/../lib/subunit/filters/tap2subunit"
104 fi
105 $smb4torture -V
106
107 bbdir=../testprogs/blackbox
108
109 prefix_abs="$SELFTEST_PREFIX/s4client"
110 CONFIGURATION="--configfile=\$SMB_CONF_PATH"
111
112 test -d "$prefix_abs" || mkdir "$prefix_abs"
113
114 TORTURE_OPTIONS=""
115 TORTURE_OPTIONS="$TORTURE_OPTIONS $CONFIGURATION"
116 TORTURE_OPTIONS="$TORTURE_OPTIONS --maximum-runtime=$SELFTEST_MAXTIME"
117 TORTURE_OPTIONS="$TORTURE_OPTIONS --target=$SELFTEST_TARGET"
118 TORTURE_OPTIONS="$TORTURE_OPTIONS --basedir=$prefix_abs"
119 if [ -z "$SELFTEST_VERBOSE" ]; then
120         TORTURE_OPTIONS="$TORTURE_OPTIONS --option=torture:progress=no"
121 fi
122 TORTURE_OPTIONS="$TORTURE_OPTIONS --format=subunit"
123 if [ -n "$SELFTEST_QUICK" ]; then
124         TORTURE_OPTIONS="$TORTURE_OPTIONS --option=torture:quick=yes"
125 fi
126 smb4torture="$smb4torture $TORTURE_OPTIONS"
127
128 echo "OPTIONS $TORTURE_OPTIONS"
129
130 # Simple tests for LDAP and CLDAP
131
132 for options in "" "--option=socket:testnonblock=true" "-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"; do
133     plantestsuite "ldb.ldap with options $options" dc $bbdir/test_ldb.sh ldap \$SERVER $options
134 done
135 # see if we support ldaps
136 [ -n "$CONFIG_H" ] || {
137     CONFIG_H="include/config.h"
138 }
139 if grep ENABLE_GNUTLS.1 $CONFIG_H > /dev/null; then
140     for options in "" "-U\$USERNAME%\$PASSWORD"; do
141         plantestsuite "ldb.ldaps with options $options" dc $bbdir/test_ldb.sh ldaps \$SERVER_IP $options
142     done
143 fi
144 for options in "" "-U\$USERNAME%\$PASSWORD"; do
145     plantestsuite "ldb.ldapi with options $options" dc $bbdir/test_ldb.sh ldapi \$PREFIX_ABS/dc/private/ldapi $options
146 done
147 for t in `$smb4torture --list | grep "^LDAP-"`
148 do
149         plansmbtorturetestsuite "$t" dc "-U\$USERNAME%\$PASSWORD" //\$SERVER_IP/_none_
150 done
151
152 # only do the ldb tests when not in quick mode - they are quite slow, and ldb
153 # is now pretty well tested by the rest of the quick tests anyway
154 LDBDIR=$samba4srcdir/lib/ldb
155 export LDBDIR
156 # Don't run LDB tests when using system ldb, as we won't have ldbtest installed
157 if [ -f $samba4bindir/ldbtest ]; then
158         plantestsuite "ldbbase" none TEST_DATA_PREFIX=\$PREFIX $LDBDIR/tests/test-tdb.sh
159 else
160         skiptestsuite "ldbbase" "Using system LDB, ldbtest not available"
161 fi
162
163 # Tests for RPC
164
165 # add tests to this list as they start passing, so we test
166 # that they stay passing
167 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"
168 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"
169 ncacn_ip_tcp_tests="RPC-SCHANNEL RPC-JOIN RPC-LSA RPC-DSSETUP RPC-ALTERCONTEXT RPC-MULTIBIND RPC-NETLOGON RPC-HANDLES RPC-DSSYNC RPC-ASYNCBIND RPC-LSALOOKUP RPC-LSA-GETUSER RPC-SCHANNEL2 RPC-AUTHCONTEXT RPC-OBJECTUUID"
170 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"
171 slow_ncalrpc_tests="RPC-SAMR RPC-SAMR-PASSWORDS"
172 slow_ncacn_ip_tcp_tests="RPC-SAMR RPC-SAMR-PASSWORDS RPC-CRACKNAMES"
173
174 all_tests="$ncalrpc_tests $ncacn_np_tests $ncacn_ip_tcp_tests $slow_ncalrpc_tests $slow_ncacn_np_tests $slow_ncacn_ip_tcp_tests RPC-LSA-SECRETS RPC-SAMBA3-SHARESEC RPC-COUNTCALLS"
175
176 # Make sure all tests get run
177 rpc_tests=`$smb4torture --list | grep '^RPC-'`
178 drs_rpc_tests=`$smb4torture --list | grep '^DRS-RPC'`
179 rpc_tests_list="${rpc_tests} ${drs_rpc_tests}"
180 for t in $rpc_tests_list
181 do
182         echo $all_tests | grep "$t"  > /dev/null
183         if [ $? -ne 0 ]
184         then
185                 auto_rpc_tests="$auto_rpc_tests $t"
186         fi
187 done
188
189 for bindoptions in seal,padcheck $VALIDATE bigendian; do
190  for transport in ncalrpc ncacn_np ncacn_ip_tcp; do
191      env="dc"
192      case $transport in
193          ncalrpc) tests=$ncalrpc_tests;env="dc:local" ;;
194          ncacn_np) tests=$ncacn_np_tests ;;
195          ncacn_ip_tcp) tests=$ncacn_ip_tcp_tests ;;
196      esac
197    for t in $tests; do
198     plantestsuite "`normalize_testname $t` on $transport with $bindoptions" $env $VALGRIND $smb4torture $transport:"\$SERVER[$bindoptions]" -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN $t "$*"
199    done
200    plantestsuite "rpc.samba3.sharesec on $transport with $bindoptions" $env $VALGRIND $smb4torture $transport:"\$SERVER[$bindoptions]" -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN --option=torture:share=tmp RPC-SAMBA3-SHARESEC "$*"
201  done
202 done
203
204 for bindoptions in "" $VALIDATE bigendian; do
205  for t in $auto_rpc_tests; do
206   plantestsuite "`normalize_testname $t` with $bindoptions" dc $VALGRIND $smb4torture "\$SERVER[$bindoptions]" -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN $t "$*"
207  done
208 done
209
210 t="RPC-COUNTCALLS"
211 plantestsuite "`normalize_testname $t`" dc:local $VALGRIND $smb4torture "\$SERVER[$bindoptions]" -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN $t "$*"
212
213 for bindoptions in connect $VALIDATE ; do
214  for transport in ncalrpc ncacn_np ncacn_ip_tcp; do
215      env="dc"
216      case $transport in
217          ncalrpc) tests=$slow_ncalrpc_tests; env="dc:local" ;;
218          ncacn_np) tests=$slow_ncacn_np_tests ;;
219          ncacn_ip_tcp) tests=$slow_ncacn_ip_tcp_tests ;;
220      esac
221    for t in $tests; do
222     plantestsuite "`normalize_testname $t` on $transport with $bindoptions" $env $VALGRIND $smb4torture $transport:"\$SERVER[$bindoptions]" -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN $t "$*"
223    done
224  done
225 done
226 # Tests for the DFS referral calls implementation
227
228 dfsc=`$smb4torture --list | grep "^DFS-" | xargs`
229
230 for t in $dfsc; do
231     plansmbtorturetestsuite "$t" dc $ADDARGS //\$SERVER/ipc$ -U"\$USERNAME"%"\$PASSWORD"
232 done
233
234 # Tests for the NET API (NET-API-BECOME-DC tested below against all the roles)
235
236 net=`$smb4torture --list | grep "^NET-" | grep -v NET-API-BECOME-DC`
237
238 for t in $net; do
239     plansmbtorturetestsuite "$t" dc "\$SERVER[$VALIDATE]" -U"\$USERNAME"%"\$PASSWORD" -W "\$DOMAIN" "$*"
240 done
241
242 # Tests for session keys and encryption of RPC pipes
243 # FIXME: Integrate these into a single smbtorture test
244
245 bindoptions=""
246 transport="ncacn_np"
247 for ntlmoptions in \
248     "-k no --option=usespnego=yes" \
249     "-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no" \
250     "-k no --option=usespnego=yes --option=ntlmssp_client:56bit=yes" \
251     "-k no --option=usespnego=yes --option=ntlmssp_client:56bit=no" \
252     "-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=yes" \
253     "-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=no" \
254     "-k no --option=usespnego=yes --option=clientntlmv2auth=yes" \
255     "-k no --option=usespnego=yes --option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no" \
256     "-k no --option=usespnego=yes --option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=yes" \
257     "-k no --option=usespnego=no --option=clientntlmv2auth=yes" \
258     "-k no --option=gensec:spnego=no --option=clientntlmv2auth=yes" \
259     "-k no --option=usespnego=no"; do
260     name="rpc.lsa.secrets on $transport with $bindoptions with $ntlmoptions"
261     plantestsuite "$name" dc $smb4torture $transport:"\$SERVER[$bindoptions]"  $ntlmoptions -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN --option=gensec:target_hostname=\$NETBIOSNAME RPC-LSA-SECRETS "$*"
262 done
263
264 transports="ncacn_np ncacn_ip_tcp"
265
266 #Kerberos varies between functional levels, so it is important to check this on all of them
267 for env in dc fl2000dc fl2003dc fl2008r2dc; do
268     for transport in $transports; do
269         plantestsuite "rpc.lsa.secrets on $transport with $bindoptions with Kerberos" $env $smb4torture $transport:"\$SERVER[$bindoptions]" -k yes -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN "--option=gensec:target_hostname=\$NETBIOSNAME" RPC-LSA-SECRETS "$*"
270         plantestsuite "rpc.lsa.secrets on $transport with $bindoptions with Kerberos - use target principal" $env $smb4torture $transport:"\$SERVER[$bindoptions]" -k yes -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN "--option=clientusespnegoprincipal=yes" "--option=gensec:target_hostname=\$NETBIOSNAME" RPC-LSA-SECRETS "$*"
271         plantestsuite "rpc.lsa.secrets on $transport with Kerberos - use Samba3 style login" $env $smb4torture $transport:"\$SERVER" -k yes -U"\$USERNAME"%"\$PASSWORD" -W "\$DOMAIN" "--option=gensec:fake_gssapi_krb5=yes" "--option=gensec:gssapi_krb5=no" "--option=gensec:target_hostname=\$NETBIOSNAME" "RPC-LSA-SECRETS-none*" "$*"
272         plantestsuite "rpc.lsa.secrets on $transport with Kerberos - use Samba3 style login, use target principal" $env $smb4torture $transport:"\$SERVER" -k yes -U"\$USERNAME"%"\$PASSWORD" -W "\$DOMAIN" "--option=clientusespnegoprincipal=yes" "--option=gensec:fake_gssapi_krb5=yes" "--option=gensec:gssapi_krb5=no" "--option=gensec:target_hostname=\$NETBIOSNAME" "RPC-LSA-SECRETS-none*" "$*"
273         plansmbtorturetestsuite NET-API-BECOME-DC $env "\$SERVER[$VALIDATE]" -U"\$USERNAME"%"\$PASSWORD" -W "\$DOMAIN" "$*"
274         plantestsuite "rpc.echo on $transport with $bindoptions and $echooptions" $env $smb4torture $transport:"\$SERVER[$bindoptions]" $ntlmoptions -U"\$USERNAME"%"\$PASSWORD" -W "\$DOMAIN" RPC-ECHO "$*"
275         
276     # Echo tests test bulk Kerberos encryption of DCE/RPC
277         for bindoptions in connect spnego spnego,sign spnego,seal $VALIDATE padcheck bigendian bigendian,seal; do
278             echooptions="--option=socket:testnonblock=True --option=torture:quick=yes -k yes"
279             plantestsuite "rpc.echo on $transport with $bindoptions and $echooptions" $env $smb4torture $transport:"\$SERVER[$bindoptions]" $echooptions -U"\$USERNAME"%"\$PASSWORD" -W "\$DOMAIN" RPC-ECHO "$*"
280         done
281     done
282 done
283
284 for transport in $transports; do
285  for bindoptions in sign seal; do
286   for ntlmoptions in \
287         "--option=ntlmssp_client:ntlm2=yes --option=torture:quick=yes" \
288         "--option=ntlmssp_client:ntlm2=no  --option=torture:quick=yes" \
289         "--option=ntlmssp_client:ntlm2=yes --option=ntlmssp_client:128bit=no --option=torture:quick=yes" \
290         "--option=ntlmssp_client:ntlm2=no  --option=ntlmssp_client:128bit=no --option=torture:quick=yes" \
291         "--option=ntlmssp_client:ntlm2=yes --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes" \
292         "--option=ntlmssp_client:ntlm2=no  --option=ntlmssp_client:keyexchange=no  --option=torture:quick=yes" \
293         "--option=clientntlmv2auth=yes  --option=ntlmssp_client:keyexchange=no  --option=torture:quick=yes" \
294         "--option=clientntlmv2auth=yes  --option=ntlmssp_client:128bit=no --option=ntlmssp_client:keyexchange=yes  --option=torture:quick=yes" \
295         "--option=clientntlmv2auth=yes  --option=ntlmssp_client:128bit=no --option=ntlmssp_client:keyexchange=no  --option=torture:quick=yes" \
296     ; do
297    env="dc"
298    if test x"$transport" = x"ncalrpc"; then
299       env="dc:local"
300    fi
301    plantestsuite "rpc.echo on $transport with $bindoptions and $ntlmoptions" $env $smb4torture $transport:"\$SERVER[$bindoptions]" $ntlmoptions -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN RPC-ECHO "$*"
302   done
303  done
304 done
305
306 plantestsuite "rpc.echo on ncacn_np over smb2" dc $smb4torture ncacn_np:"\$SERVER[smb2]" -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN RPC-ECHO "$*"
307
308 plantestsuite "ntp.signd" dc:local $smb4torture ncacn_np:"\$SERVER" -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN NTP-SIGND "$*"
309
310 # Tests against the NTVFS POSIX backend
311 NTVFSARGS=""
312 NTVFSARGS="${NTVFSARGS} --option=torture:sharedelay=10000"
313 NTVFSARGS="${NTVFSARGS} --option=torture:oplocktimeout=3"
314 NTVFSARGS="${NTVFSARGS} --option=torture:writetimeupdatedelay=50000"
315
316 smb2=`$smb4torture --list | grep "^SMB2-" | xargs`
317 #The QFILEINFO-IPC test needs to be on ipc$
318 raw=`$smb4torture --list | grep "^RAW-" | grep -v "RAW-QFILEINFO-IPC"| xargs`
319 base=`$smb4torture --list | grep "^BASE-" | xargs`
320
321 for t in $base $raw $smb2; do
322     plansmbtorturetestsuite "$t" dc $ADDARGS //\$SERVER/tmp -U"\$USERNAME"%"\$PASSWORD" $NTVFSARGS
323 done
324
325 plansmbtorturetestsuite "RAW-QFILEINFO-IPC" dc $ADDARGS //\$SERVER/ipc$ -U"\$USERNAME"%"\$PASSWORD"
326
327 rap=`$smb4torture --list | grep "^RAP-" | xargs`
328 for t in $rap; do
329     plansmbtorturetestsuite "$t" dc $ADDARGS //\$SERVER/IPC\\\$ -U"\$USERNAME"%"\$PASSWORD"
330 done
331
332 # Tests against the NTVFS CIFS backend
333 for t in $base $raw; do
334     plantestsuite "ntvfs.cifs.`normalize_testname $t`" dc $VALGRIND $smb4torture //\$NETBIOSNAME/cifs -U"\$USERNAME"%"\$PASSWORD" $NTVFSARGS $t
335 done
336
337 # Local tests
338
339 for t in `$smb4torture --list | grep "^LOCAL-" | xargs`; do
340         plansmbtorturetestsuite "$t" none ncalrpc: "$*"
341 done
342
343 tdbtorture4="$samba4bindir/tdbtorture${EXEEXT}"
344 if test -f $tdbtorture4
345 then
346         plantestsuite "tdb.stress" none $VALGRIND $tdbtorture4
347 else
348         skiptestsuite "tdb.stress" "Using system TDB, tdbtorture not available"
349 fi
350
351 plansmbtorturetestsuite "DRS-UNIT" none ncalrpc: "$*"
352
353 # Pidl tests
354
355 for f in $samba4srcdir/../pidl/tests/*.pl; do
356          planperltestsuite "pidl.`basename $f .pl`" none $f
357 done
358 planperltestsuite "selftest.samba4.pl" none $samba4srcdir/../selftest/test_samba4.pl
359
360 # Blackbox Tests:
361 # tests that interact directly with the command-line tools rather than using 
362 # the API. These mainly test that the various command-line options of commands 
363 # work correctly.
364
365 plantestsuite "blackbox.ndrdump" none $samba4srcdir/librpc/tests/test_ndrdump.sh
366 plantestsuite "blackbox.net" dc $samba4srcdir/utils/tests/test_net.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN"
367 plantestsuite "blackbox.pkinit" dc $bbdir/test_pkinit.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$REALM" "\$DOMAIN" "$PREFIX" aes256-cts-hmac-sha1-96 $CONFIGURATION 
368 plantestsuite "blackbox.kinit" dc $bbdir/test_kinit.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$REALM" "\$DOMAIN" "$PREFIX" aes256-cts-hmac-sha1-96 $CONFIGURATION 
369 plantestsuite "blackbox.kinit" fl2000dc $bbdir/test_kinit.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$REALM" "\$DOMAIN" "$PREFIX" arcfour-hmac-md5 $CONFIGURATION 
370 plantestsuite "blackbox.kinit" fl2008r2dc $bbdir/test_kinit.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$REALM" "\$DOMAIN" "$PREFIX" aes256-cts-hmac-sha1-96 $CONFIGURATION 
371 plantestsuite "blackbox.passwords" dc:local $bbdir/test_passwords.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$REALM" "\$DOMAIN" "$PREFIX"
372 plantestsuite "blackbox.export.keytab" dc:local $bbdir/test_export_keytab.sh "\$SERVER" "\$USERNAME" "\$REALM" "\$DOMAIN" "$PREFIX"
373 plantestsuite "blackbox.cifsdd" dc $samba4srcdir/client/tests/test_cifsdd.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" 
374 plantestsuite "blackbox.nmblookup" dc $samba4srcdir/utils/tests/test_nmblookup.sh "\$NETBIOSNAME" "\$NETBIOSALIAS" "\$SERVER" "\$SERVER_IP" 
375 plantestsuite "blackbox.nmblookup" member $samba4srcdir/utils/tests/test_nmblookup.sh "\$NETBIOSNAME" "\$NETBIOSALIAS" "\$SERVER" "\$SERVER_IP"
376 plantestsuite "blackbox.locktest" dc $samba4srcdir/torture/tests/test_locktest.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" "$PREFIX"
377 plantestsuite "blackbox.masktest" dc $samba4srcdir/torture/tests/test_masktest.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" "$PREFIX"
378 plantestsuite "blackbox.gentest" dc $samba4srcdir/torture/tests/test_gentest.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" "$PREFIX"
379 plantestsuite "blackbox.wbinfo" dc:local $samba4srcdir/../nsswitch/tests/test_wbinfo.sh "\$DOMAIN" "\$USERNAME" "\$PASSWORD" "dc"
380 plantestsuite "blackbox.wbinfo" member:local $samba4srcdir/../nsswitch/tests/test_wbinfo.sh "\$DOMAIN" "\$DC_USERNAME" "\$DC_PASSWORD" "member"
381
382 # Tests using the "Simple" NTVFS backend
383
384 for t in "BASE-RW1"; do
385     plantestsuite "ntvfs.simple.`normalize_testname $t`" dc $VALGRIND $smb4torture $ADDARGS //\$SERVER/simple -U"\$USERNAME"%"\$PASSWORD" $t
386 done
387
388 # Domain Member Tests
389
390 plantestsuite "rpc.echo against member server with local creds" member $VALGRIND $smb4torture ncacn_np:"\$NETBIOSNAME" -U"\$NETBIOSNAME/\$USERNAME"%"\$PASSWORD" RPC-ECHO "$*"
391 plantestsuite "rpc.echo against member server with domain creds" member $VALGRIND $smb4torture ncacn_np:"\$NETBIOSNAME" -U"\$DOMAIN/\$DC_USERNAME"%"\$DC_PASSWORD" RPC-ECHO "$*"
392 plantestsuite "rpc.samr against member server with local creds" member $VALGRIND $smb4torture ncacn_np:"\$NETBIOSNAME" -U"\$NETBIOSNAME/\$USERNAME"%"\$PASSWORD" "RPC-SAMR" "$*"
393 plantestsuite "rpc.samr.users against member server with local creds" member $VALGRIND $smb4torture ncacn_np:"\$NETBIOSNAME" -U"\$NETBIOSNAME/\$USERNAME"%"\$PASSWORD" "RPC-SAMR-USERS" "$*"
394 plantestsuite "rpc.samr.passwords against member server with local creds" member $VALGRIND $smb4torture ncacn_np:"\$NETBIOSNAME" -U"\$NETBIOSNAME/\$USERNAME"%"\$PASSWORD" "RPC-SAMR-PASSWORDS" "$*"
395 plantestsuite "blackbox.smbclient against member server with local creds" member $samba4srcdir/client/tests/test_smbclient.sh "\$NETBIOSNAME" "\$USERNAME" "\$PASSWORD" "\$NETBIOSNAME" "$PREFIX" 
396
397 # RPC Proxy
398 plantestsuite "rpc.echo against rpc proxy with domain creds" rpc_proxy $VALGRIND $smb4torture ncacn_ip_tcp:"\$NETBIOSNAME" -U"\$DOMAIN/\$DC_USERNAME"%"\$DC_PASSWORD" RPC-ECHO "$*"
399
400 # Tests SMB signing
401
402 for mech in \
403         "-k no" \
404         "-k no --option=usespnego=no" \
405         "-k no --option=gensec:spengo=no" \
406         "-k yes" \
407         "-k yes --option=gensec:fake_gssapi_krb5=yes --option=gensec:gssapi_krb5=no"; do
408    for signing in \
409         "--signing=on" \
410         "--signing=required"; do
411
412         signoptions="$mech $signing"
413         name="smb.signing on with $signoptions"
414         plantestsuite "$name" dc $VALGRIND $smb4torture //"\$NETBIOSNAME"/tmp $signoptions -U"\$USERNAME"%"\$PASSWORD" BASE-XCOPY "$*"
415    done
416 done
417
418 for mech in \
419         "-k no" \
420         "-k no --option=usespnego=no" \
421         "-k no --option=gensec:spengo=no" \
422         "-k yes" \
423         "-k yes --option=gensec:fake_gssapi_krb5=yes --option=gensec:gssapi_krb5=no"; do
424         signoptions="$mech --signing=off"
425         name="smb.signing on with $signoptions"
426         plantestsuite "$name domain-creds" member $VALGRIND $smb4torture //"\$NETBIOSNAME"/tmp $signoptions -U"\$DC_USERNAME"%"\$DC_PASSWORD" BASE-XCOPY "$*"
427 done
428 for mech in \
429         "-k no" \
430         "-k no --option=usespnego=no" \
431         "-k no --option=gensec:spengo=no"; do
432         signoptions="$mech --signing=off"
433         name="smb.signing on with $signoptions"
434         plantestsuite "$name local-creds" member $VALGRIND $smb4torture //"\$NETBIOSNAME"/tmp $signoptions -U"\$NETBIOSNAME/\$USERNAME"%"\$PASSWORD" BASE-XCOPY "$*"
435 done
436 plantestsuite "smb.signing --signing=yes anon" dc $VALGRIND $smb4torture //"\$NETBIOSNAME"/tmp -k no --signing=yes -U% BASE-XCOPY "$*"
437 plantestsuite "smb.signing --signing=required anon" dc $VALGRIND $smb4torture //"\$NETBIOSNAME"/tmp -k no --signing=required -U% BASE-XCOPY "$*"
438 plantestsuite "smb.signing --signing=no anon" member $VALGRIND $smb4torture //"\$NETBIOSNAME"/tmp -k no --signing=no -U% BASE-XCOPY "$*"
439
440 NBT_TESTS=`$smb4torture --list | grep "^NBT-" | xargs`
441
442 for t in $NBT_TESTS; do
443         plansmbtorturetestsuite "$t" dc //\$SERVER/_none_ -U\$USERNAME%\$PASSWORD 
444 done
445
446 WB_OPTS="--option=\"torture:strict mode=no\""
447 WB_OPTS="${WB_OPTS} --option=\"torture:timelimit=1\""
448 WB_OPTS="${WB_OPTS} --option=\"torture:winbindd_separator=/\""
449 WB_OPTS="${WB_OPTS} --option=\"torture:winbindd_netbios_name=\$SERVER\""
450 WB_OPTS="${WB_OPTS} --option=\"torture:winbindd_netbios_domain=\$DOMAIN\""
451
452 WINBIND_STRUCT_TESTS=`$smb4torture --list | grep "^WINBIND-STRUCT" | xargs`
453 WINBIND_NDR_TESTS=`$smb4torture --list | grep "^WINBIND-NDR" | xargs`
454 for env in dc member; do
455         for t in $WINBIND_STRUCT_TESTS; do
456                 plansmbtorturetestsuite $t $env $WB_OPTS //_none_/_none_
457         done
458
459         for t in $WINBIND_NDR_TESTS; do
460                 plansmbtorturetestsuite $t $env $WB_OPTS //_none_/_none_
461         done
462 done
463
464 nsstest4="$samba4bindir/nsstest${EXEEXT}"
465 if test -f $nsstest4
466 then
467         plantestsuite "nss.test using winbind" member $VALGRIND $nsstest4 $samba4bindir/shared/libnss_winbind.so
468 fi
469
470 SUBUNITRUN="$VALGRIND $PYTHON $samba4srcdir/scripting/bin/subunitrun"
471 plantestsuite "ldb.python" none PYTHONPATH="$PYTHONPATH:$samba4srcdir/lib/ldb/tests/python/" $PYTHON $samba4srcdir/lib/ldb/tests/python/api.py
472 plantestsuite "credentials.python" none PYTHONPATH="$PYTHONPATH:$samba4srcdir/auth/credentials/tests" $SUBUNITRUN bindings
473 plantestsuite "gensec.python" none PYTHONPATH="$PYTHONPATH:$samba4srcdir/auth/gensec/tests" $SUBUNITRUN bindings
474 plantestsuite "registry.python" none PYTHONPATH="$PYTHONPATH:$samba4srcdir/lib/registry/tests/" $SUBUNITRUN bindings
475 plantestsuite "tdb.python" none PYTHONPATH="$PYTHONPATH:../lib/tdb/python/tests" $SUBUNITRUN simple
476 plantestsuite "auth.python" none PYTHONPATH="$PYTHONPATH:$samba4srcdir/auth/tests/" $SUBUNITRUN bindings
477 plantestsuite "security.python" none PYTHONPATH="$PYTHONPATH:$samba4srcdir/libcli/security/tests" $SUBUNITRUN bindings
478 plantestsuite "misc.python" none $SUBUNITRUN samba.tests.dcerpc.misc
479 plantestsuite "param.python" none PYTHONPATH="$PYTHONPATH:$samba4srcdir/param/tests" $SUBUNITRUN bindings
480 plantestsuite "upgrade.python" none $SUBUNITRUN samba.tests.upgrade
481 plantestsuite "samba.python" none $SUBUNITRUN samba.tests
482 plantestsuite "provision.python" none $SUBUNITRUN samba.tests.provision
483 plantestsuite "samba3.python" none $SUBUNITRUN samba.tests.samba3
484 plantestsuite "samr.python" dc:local $SUBUNITRUN samba.tests.dcerpc.sam
485 plantestsuite "dsdb.python" dc:local $SUBUNITRUN samba.tests.dsdb
486 plantestsuite "netcmd.python" none $SUBUNITRUN samba.tests.netcmd
487 plantestsuite "dcerpc.bare.python" dc:local $SUBUNITRUN samba.tests.dcerpc.bare
488 plantestsuite "unixinfo.python" dc:local $SUBUNITRUN samba.tests.dcerpc.unix
489 plantestsuite "samdb.python" none $SUBUNITRUN samba.tests.samdb
490 plantestsuite "shares.python" none $SUBUNITRUN samba.tests.shares
491 plantestsuite "messaging.python" none PYTHONPATH="$PYTHONPATH:$samba4srcdir/lib/messaging/tests" $SUBUNITRUN bindings
492 plantestsuite "samba3sam.python" none PYTHONPATH="$PYTHONPATH:$samba4srcdir/dsdb/samdb/ldb_modules/tests" $SUBUNITRUN samba3sam
493 plantestsuite "subunit.python" none $SUBUNITRUN subunit
494 plantestsuite "rpcecho.python" dc:local $SUBUNITRUN samba.tests.dcerpc.rpcecho
495 plantestsuite "winreg.python" dc:local $SUBUNITRUN -U\$USERNAME%\$PASSWORD samba.tests.dcerpc.registry
496 plantestsuite "ldap.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python:../lib/testtools" $PYTHON $samba4srcdir/dsdb/tests/python/ldap.py \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN
497 plantestsuite "schemaInfo.python" dc PYTHONPATH="$PYTHONPATH:$samba4srcdir/dsdb/tests/python/" $SUBUNITRUN dsdb_schema_info -U"\$DOMAIN/\$DC_USERNAME"%"\$DC_PASSWORD"
498 plantestsuite "urgent_replication.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python:../lib/testtools" $PYTHON $samba4srcdir/dsdb/tests/python/urgent_replication.py \$PREFIX_ABS/dc/private/sam.ldb
499 for env in "dc" "fl2000dc" "fl2003dc" "fl2008r2dc"; do
500     plantestsuite "ldap_schema.python" $env PYTHONPATH="$PYTHONPATH:../lib/subunit/python:../lib/testtools" $PYTHON $samba4srcdir/dsdb/tests/python/ldap_schema.py \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN
501     plantestsuite "ldap.possibleInferiors.python" $env $PYTHON $samba4srcdir/dsdb/samdb/ldb_modules/tests/possibleinferiors.py ldap://\$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN
502     plantestsuite "ldap.secdesc.python" $env PYTHONPATH="$PYTHONPATH:../lib/subunit/python:../lib/testtools" $PYTHON $samba4srcdir/dsdb/tests/python/sec_descriptor.py \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN
503     plantestsuite "ldap.acl.python" $env PYTHONPATH="$PYTHONPATH:../lib/subunit/python:../lib/testtools" $PYTHON $samba4srcdir/dsdb/tests/python/acl.py \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN
504     plantestsuite "ldap.passwords.python" $env PYTHONPATH="$PYTHONPATH:../lib/subunit/python:../lib/testtools" $PYTHON $samba4srcdir/dsdb/tests/python/passwords.py \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN
505 done
506 plantestsuite "upgradeprovisiondc.python" dc:local $SUBUNITRUN samba.tests.upgradeprovisionneeddc
507 plantestsuite "upgradeprovisionnodc.python" none $SUBUNITRUN samba.tests.upgradeprovision
508 plantestsuite "xattr.python" none $SUBUNITRUN samba.tests.xattr
509 plantestsuite "ntacls.python" none $SUBUNITRUN samba.tests.ntacls
510 plantestsuite "deletetest.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python:../lib/testtools" $PYTHON $samba4srcdir/dsdb/tests/python/deletetest.py \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN
511 plantestsuite "policy.python" none PYTHONPATH="$PYTHONPATH:lib/policy/tests/python" $SUBUNITRUN bindings
512 plantestsuite "blackbox.samba3dump" none $PYTHON $samba4srcdir/scripting/bin/samba3dump $samba4srcdir/../testdata/samba3
513 rm -rf $PREFIX/upgrade
514 plantestsuite "blackbox.upgrade" none $PYTHON $samba4srcdir/setup/upgrade_from_s3 --targetdir=$PREFIX/upgrade $samba4srcdir/../testdata/samba3 ../testdata/samba3/smb.conf
515 rm -rf $PREFIX/provision
516 mkdir $PREFIX/provision
517 plantestsuite "blackbox.provision.py" none PYTHON="$PYTHON" $samba4srcdir/setup/tests/blackbox_provision.sh "$PREFIX/provision"
518 plantestsuite "blackbox.provision-backend.py" none PYTHON="$PYTHON" $samba4srcdir/setup/tests/blackbox_provision-backend.sh "$PREFIX/provision"
519 plantestsuite "blackbox.upgradeprovision.py" none PYTHON="$PYTHON" $samba4srcdir/setup/tests/blackbox_upgradeprovision.sh "$PREFIX/provision"
520 plantestsuite "blackbox.setpassword.py" none PYTHON="$PYTHON" $samba4srcdir/setup/tests/blackbox_setpassword.sh "$PREFIX/provision"
521 plantestsuite "blackbox.newuser.py" none PYTHON="$PYTHON" $samba4srcdir/setup/tests/blackbox_newuser.sh "$PREFIX/provision"
522 plantestsuite "blackbox.group.py" none PYTHON="$PYTHON" $samba4srcdir/setup/tests/blackbox_group.sh "$PREFIX/provision"
523 plantestsuite "blackbox.spn.py" dc:local PYTHON="$PYTHON" $samba4srcdir/setup/tests/blackbox_spn.sh "$PREFIX/dc"
524
525 # DRS python tests
526 plantestsuite "drs_delete_object.python" vampire_dc PYTHONPATH="$PYTHONPATH:$samba4srcdir/torture/drs/python" DC1=\$DC_SERVER DC2=\$VAMPIRE_DC_SERVER $SUBUNITRUN delete_object -U"\$DOMAIN/\$DC_USERNAME"%"\$DC_PASSWORD"
527
528 # This makes sure we test the rid allocation code
529 t="RPC-SAMR-LARGE-DC"
530 plantestsuite "`normalize_testname $t.one`" vampire_dc $VALGRIND $smb4torture "\$SERVER[$bindoptions]" -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN $t "$*"
531 plantestsuite "`normalize_testname $t.two`" vampire_dc $VALGRIND $smb4torture "\$SERVER[$bindoptions]" -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN $t "$*"