s4 unittests: add blackblox test for ktpass
[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:local $samba4srcdir/utils/tests/test_net.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN"
367 plantestsuite "blackbox.pkinit" dc:local $bbdir/test_pkinit.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$REALM" "\$DOMAIN" "$PREFIX" aes256-cts-hmac-sha1-96 $CONFIGURATION 
368 plantestsuite "blackbox.kinit" dc:local $bbdir/test_kinit.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$REALM" "\$DOMAIN" "$PREFIX" aes256-cts-hmac-sha1-96 $CONFIGURATION
369 plantestsuite "blackbox.kinit" fl2000dc:local $bbdir/test_kinit.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$REALM" "\$DOMAIN" "$PREFIX" arcfour-hmac-md5 $CONFIGURATION
370 plantestsuite "blackbox.kinit" fl2008r2dc:local $bbdir/test_kinit.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$REALM" "\$DOMAIN" "$PREFIX" aes256-cts-hmac-sha1-96 $CONFIGURATION
371 plantestsuite "blackbox.ktpass" dc $bbdir/test_ktpass.sh $PREFIX
372 plantestsuite "blackbox.passwords" dc:local $bbdir/test_passwords.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$REALM" "\$DOMAIN" "$PREFIX"
373 plantestsuite "blackbox.export.keytab" dc:local $bbdir/test_export_keytab.sh "\$SERVER" "\$USERNAME" "\$REALM" "\$DOMAIN" "$PREFIX"
374 plantestsuite "blackbox.cifsdd" dc $samba4srcdir/client/tests/test_cifsdd.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" 
375 plantestsuite "blackbox.nmblookup" dc $samba4srcdir/utils/tests/test_nmblookup.sh "\$NETBIOSNAME" "\$NETBIOSALIAS" "\$SERVER" "\$SERVER_IP" 
376 plantestsuite "blackbox.nmblookup" member $samba4srcdir/utils/tests/test_nmblookup.sh "\$NETBIOSNAME" "\$NETBIOSALIAS" "\$SERVER" "\$SERVER_IP"
377 plantestsuite "blackbox.locktest" dc $samba4srcdir/torture/tests/test_locktest.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" "$PREFIX"
378 plantestsuite "blackbox.masktest" dc $samba4srcdir/torture/tests/test_masktest.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" "$PREFIX"
379 plantestsuite "blackbox.gentest" dc $samba4srcdir/torture/tests/test_gentest.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" "$PREFIX"
380 plantestsuite "blackbox.wbinfo" dc:local $samba4srcdir/../nsswitch/tests/test_wbinfo.sh "\$DOMAIN" "\$USERNAME" "\$PASSWORD" "dc"
381 plantestsuite "blackbox.wbinfo" member:local $samba4srcdir/../nsswitch/tests/test_wbinfo.sh "\$DOMAIN" "\$DC_USERNAME" "\$DC_PASSWORD" "member"
382 plantestsuite "blackbox.chgdcpass" dc $bbdir/test_chgdcpass.sh "\$SERVER" "LOCALDC\\\$" "\$REALM" "\$DOMAIN" "$PREFIX" aes256-cts-hmac-sha1-96 $SELFTEST_PREFIX/dc
383
384 # Tests using the "Simple" NTVFS backend
385
386 for t in "BASE-RW1"; do
387     plantestsuite "ntvfs.simple.`normalize_testname $t`" dc $VALGRIND $smb4torture $ADDARGS //\$SERVER/simple -U"\$USERNAME"%"\$PASSWORD" $t
388 done
389
390 # Domain Member Tests
391
392 plantestsuite "rpc.echo against member server with local creds" member $VALGRIND $smb4torture ncacn_np:"\$NETBIOSNAME" -U"\$NETBIOSNAME/\$USERNAME"%"\$PASSWORD" RPC-ECHO "$*"
393 plantestsuite "rpc.echo against member server with domain creds" member $VALGRIND $smb4torture ncacn_np:"\$NETBIOSNAME" -U"\$DOMAIN/\$DC_USERNAME"%"\$DC_PASSWORD" RPC-ECHO "$*"
394 plantestsuite "rpc.samr against member server with local creds" member $VALGRIND $smb4torture ncacn_np:"\$NETBIOSNAME" -U"\$NETBIOSNAME/\$USERNAME"%"\$PASSWORD" "RPC-SAMR" "$*"
395 plantestsuite "rpc.samr.users against member server with local creds" member $VALGRIND $smb4torture ncacn_np:"\$NETBIOSNAME" -U"\$NETBIOSNAME/\$USERNAME"%"\$PASSWORD" "RPC-SAMR-USERS" "$*"
396 plantestsuite "rpc.samr.passwords against member server with local creds" member $VALGRIND $smb4torture ncacn_np:"\$NETBIOSNAME" -U"\$NETBIOSNAME/\$USERNAME"%"\$PASSWORD" "RPC-SAMR-PASSWORDS" "$*"
397 plantestsuite "blackbox.smbclient against member server with local creds" member $samba4srcdir/client/tests/test_smbclient.sh "\$NETBIOSNAME" "\$USERNAME" "\$PASSWORD" "\$NETBIOSNAME" "$PREFIX" 
398
399 # RPC Proxy
400 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 "$*"
401
402 # Tests SMB signing
403
404 for mech in \
405         "-k no" \
406         "-k no --option=usespnego=no" \
407         "-k no --option=gensec:spengo=no" \
408         "-k yes" \
409         "-k yes --option=gensec:fake_gssapi_krb5=yes --option=gensec:gssapi_krb5=no"; do
410    for signing in \
411         "--signing=on" \
412         "--signing=required"; do
413
414         signoptions="$mech $signing"
415         name="smb.signing on with $signoptions"
416         plantestsuite "$name" dc $VALGRIND $smb4torture //"\$NETBIOSNAME"/tmp $signoptions -U"\$USERNAME"%"\$PASSWORD" BASE-XCOPY "$*"
417    done
418 done
419
420 for mech in \
421         "-k no" \
422         "-k no --option=usespnego=no" \
423         "-k no --option=gensec:spengo=no" \
424         "-k yes" \
425         "-k yes --option=gensec:fake_gssapi_krb5=yes --option=gensec:gssapi_krb5=no"; do
426         signoptions="$mech --signing=off"
427         name="smb.signing on with $signoptions"
428         plantestsuite "$name domain-creds" member $VALGRIND $smb4torture //"\$NETBIOSNAME"/tmp $signoptions -U"\$DC_USERNAME"%"\$DC_PASSWORD" BASE-XCOPY "$*"
429 done
430 for mech in \
431         "-k no" \
432         "-k no --option=usespnego=no" \
433         "-k no --option=gensec:spengo=no"; do
434         signoptions="$mech --signing=off"
435         name="smb.signing on with $signoptions"
436         plantestsuite "$name local-creds" member $VALGRIND $smb4torture //"\$NETBIOSNAME"/tmp $signoptions -U"\$NETBIOSNAME/\$USERNAME"%"\$PASSWORD" BASE-XCOPY "$*"
437 done
438 plantestsuite "smb.signing --signing=yes anon" dc $VALGRIND $smb4torture //"\$NETBIOSNAME"/tmp -k no --signing=yes -U% BASE-XCOPY "$*"
439 plantestsuite "smb.signing --signing=required anon" dc $VALGRIND $smb4torture //"\$NETBIOSNAME"/tmp -k no --signing=required -U% BASE-XCOPY "$*"
440 plantestsuite "smb.signing --signing=no anon" member $VALGRIND $smb4torture //"\$NETBIOSNAME"/tmp -k no --signing=no -U% BASE-XCOPY "$*"
441
442 NBT_TESTS=`$smb4torture --list | grep "^NBT-" | xargs`
443
444 for t in $NBT_TESTS; do
445         plansmbtorturetestsuite "$t" dc //\$SERVER/_none_ -U\$USERNAME%\$PASSWORD 
446 done
447
448 WB_OPTS="--option=\"torture:strict mode=no\""
449 WB_OPTS="${WB_OPTS} --option=\"torture:timelimit=1\""
450 WB_OPTS="${WB_OPTS} --option=\"torture:winbindd_separator=/\""
451 WB_OPTS="${WB_OPTS} --option=\"torture:winbindd_netbios_name=\$SERVER\""
452 WB_OPTS="${WB_OPTS} --option=\"torture:winbindd_netbios_domain=\$DOMAIN\""
453
454 WINBIND_STRUCT_TESTS=`$smb4torture --list | grep "^WINBIND-STRUCT" | xargs`
455 WINBIND_NDR_TESTS=`$smb4torture --list | grep "^WINBIND-NDR" | xargs`
456 for env in dc member; do
457         for t in $WINBIND_STRUCT_TESTS; do
458                 plansmbtorturetestsuite $t $env $WB_OPTS //_none_/_none_
459         done
460
461         for t in $WINBIND_NDR_TESTS; do
462                 plansmbtorturetestsuite $t $env $WB_OPTS //_none_/_none_
463         done
464 done
465
466 nsstest4="$samba4bindir/nsstest${EXEEXT}"
467 if test -f $nsstest4
468 then
469         plantestsuite "nss.test using winbind" member $VALGRIND $nsstest4 $samba4bindir/shared/libnss_winbind.so
470 fi
471
472 SUBUNITRUN="$VALGRIND $PYTHON $samba4srcdir/scripting/bin/subunitrun"
473 plantestsuite "ldb.python" none PYTHONPATH="$PYTHONPATH:$samba4srcdir/lib/ldb/tests/python/" $PYTHON $samba4srcdir/lib/ldb/tests/python/api.py
474 plantestsuite "credentials.python" none PYTHONPATH="$PYTHONPATH:$samba4srcdir/auth/credentials/tests" $SUBUNITRUN bindings
475 plantestsuite "gensec.python" none PYTHONPATH="$PYTHONPATH:$samba4srcdir/auth/gensec/tests" $SUBUNITRUN bindings
476 plantestsuite "registry.python" none PYTHONPATH="$PYTHONPATH:$samba4srcdir/lib/registry/tests/" $SUBUNITRUN bindings
477 plantestsuite "tdb.python" none PYTHONPATH="$PYTHONPATH:../lib/tdb/python/tests" $SUBUNITRUN simple
478 plantestsuite "auth.python" none PYTHONPATH="$PYTHONPATH:$samba4srcdir/auth/tests/" $SUBUNITRUN bindings
479 plantestsuite "security.python" none PYTHONPATH="$PYTHONPATH:$samba4srcdir/libcli/security/tests" $SUBUNITRUN bindings
480 plantestsuite "misc.python" none $SUBUNITRUN samba.tests.dcerpc.misc
481 plantestsuite "param.python" none PYTHONPATH="$PYTHONPATH:$samba4srcdir/param/tests" $SUBUNITRUN bindings
482 plantestsuite "upgrade.python" none $SUBUNITRUN samba.tests.upgrade
483 plantestsuite "samba.python" none $SUBUNITRUN samba.tests
484 plantestsuite "provision.python" none $SUBUNITRUN samba.tests.provision
485 plantestsuite "samba3.python" none $SUBUNITRUN samba.tests.samba3
486 plantestsuite "samr.python" dc:local $SUBUNITRUN samba.tests.dcerpc.sam
487 plantestsuite "dsdb.python" dc:local $SUBUNITRUN samba.tests.dsdb
488 plantestsuite "netcmd.python" none $SUBUNITRUN samba.tests.netcmd
489 plantestsuite "dcerpc.bare.python" dc:local $SUBUNITRUN samba.tests.dcerpc.bare
490 plantestsuite "unixinfo.python" dc:local $SUBUNITRUN samba.tests.dcerpc.unix
491 plantestsuite "samdb.python" none $SUBUNITRUN samba.tests.samdb
492 plantestsuite "shares.python" none $SUBUNITRUN samba.tests.shares
493 plantestsuite "messaging.python" none PYTHONPATH="$PYTHONPATH:$samba4srcdir/lib/messaging/tests" $SUBUNITRUN bindings
494 plantestsuite "samba3sam.python" none PYTHONPATH="$PYTHONPATH:$samba4srcdir/dsdb/samdb/ldb_modules/tests" $SUBUNITRUN samba3sam
495 plantestsuite "subunit.python" none $SUBUNITRUN subunit
496 plantestsuite "rpcecho.python" dc:local $SUBUNITRUN samba.tests.dcerpc.rpcecho
497 plantestsuite "winreg.python" dc:local $SUBUNITRUN -U\$USERNAME%\$PASSWORD samba.tests.dcerpc.registry
498 plantestsuite "ldap.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python:../lib/testtools" $PYTHON $samba4srcdir/dsdb/tests/python/ldap.py \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN
499 plantestsuite "schemaInfo.python" dc PYTHONPATH="$PYTHONPATH:$samba4srcdir/dsdb/tests/python/" $SUBUNITRUN dsdb_schema_info -U"\$DOMAIN/\$DC_USERNAME"%"\$DC_PASSWORD"
500 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
501 for env in "dc" "fl2000dc" "fl2003dc" "fl2008r2dc"; do
502     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
503     plantestsuite "ldap.possibleInferiors.python" $env $PYTHON $samba4srcdir/dsdb/samdb/ldb_modules/tests/possibleinferiors.py ldap://\$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN
504     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
505     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
506     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
507 done
508 plantestsuite "upgradeprovisiondc.python" dc:local $SUBUNITRUN samba.tests.upgradeprovisionneeddc
509 plantestsuite "upgradeprovisionnodc.python" none $SUBUNITRUN samba.tests.upgradeprovision
510 plantestsuite "xattr.python" none $SUBUNITRUN samba.tests.xattr
511 plantestsuite "ntacls.python" none $SUBUNITRUN samba.tests.ntacls
512 plantestsuite "deletetest.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python:../lib/testtools" $PYTHON $samba4srcdir/dsdb/tests/python/deletetest.py \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN
513 plantestsuite "policy.python" none PYTHONPATH="$PYTHONPATH:lib/policy/tests/python" $SUBUNITRUN bindings
514 plantestsuite "blackbox.samba3dump" none $PYTHON $samba4srcdir/scripting/bin/samba3dump $samba4srcdir/../testdata/samba3
515 rm -rf $PREFIX/upgrade
516 plantestsuite "blackbox.upgrade" none $PYTHON $samba4srcdir/setup/upgrade_from_s3 --targetdir=$PREFIX/upgrade $samba4srcdir/../testdata/samba3 ../testdata/samba3/smb.conf
517 rm -rf $PREFIX/provision
518 mkdir $PREFIX/provision
519 plantestsuite "blackbox.provision.py" none PYTHON="$PYTHON" $samba4srcdir/setup/tests/blackbox_provision.sh "$PREFIX/provision"
520 plantestsuite "blackbox.provision-backend.py" none PYTHON="$PYTHON" $samba4srcdir/setup/tests/blackbox_provision-backend.sh "$PREFIX/provision"
521 plantestsuite "blackbox.upgradeprovision.py" none PYTHON="$PYTHON" $samba4srcdir/setup/tests/blackbox_upgradeprovision.sh "$PREFIX/provision"
522 plantestsuite "blackbox.setpassword.py" none PYTHON="$PYTHON" $samba4srcdir/setup/tests/blackbox_setpassword.sh "$PREFIX/provision"
523 plantestsuite "blackbox.newuser.py" none PYTHON="$PYTHON" $samba4srcdir/setup/tests/blackbox_newuser.sh "$PREFIX/provision"
524 plantestsuite "blackbox.group.py" none PYTHON="$PYTHON" $samba4srcdir/setup/tests/blackbox_group.sh "$PREFIX/provision"
525 plantestsuite "blackbox.spn.py" dc:local PYTHON="$PYTHON" $samba4srcdir/setup/tests/blackbox_spn.sh "$PREFIX/dc"
526
527 # DRS python tests
528 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"
529
530 # This makes sure we test the rid allocation code
531 t="RPC-SAMR-LARGE-DC"
532 plantestsuite "`normalize_testname $t.one`" vampire_dc $VALGRIND $smb4torture "\$SERVER[$bindoptions]" -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN $t "$*"
533 plantestsuite "`normalize_testname $t.two`" vampire_dc $VALGRIND $smb4torture "\$SERVER[$bindoptions]" -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN $t "$*"