s3:selftest: import more tests from 'make test'
[samba.git] / source3 / selftest / tests.sh
1 #!/bin/sh
2 # This script generates a list of testsuites that should be run as part of 
3 # the Samba 3 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 3, 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/samba4-knownfail. This makes it 
12 # very easy to see what functionality is still missing in Samba 3 and makes 
13 # it possible to run the testsuite against other servers, such as Samba 4 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 plantest() {
27         name=$1
28         env=$2
29         shift 2
30         cmdline="$*"
31         echo "-- TEST --"
32         if [ "$env" = "none" ]; then
33                 echo "samba3.$name"
34         else
35                 echo "samba3.$name ($env)"
36         fi
37         echo $env
38         echo $cmdline
39 }
40
41 normalize_testname() {
42         name=$1
43         shift 1
44         echo $name | tr "A-Z-" "a-z."
45 }
46
47 BINDIR=`dirname $0`/../bin
48 SCRIPTDIR=`dirname $0`/../script/tests
49 export SCRIPTDIR
50
51 plantest "talloctort3" none $VALGRIND $BINDIR/talloctort
52 plantest "replacetort3" none $VALGRIND $BINDIR/replacetort
53 plantest "tdbtorture3" none $VALGRIND $BINDIR/tdbtorture
54 plantest "smbconftort3" none $VALGRIND $BINDIR/smbconftort $CONFIGURATION
55
56 tests="FDPASS LOCK1 LOCK2 LOCK3 LOCK4 LOCK5 LOCK6 LOCK7"
57 tests="$tests UNLINK BROWSE ATTR TRANS2 TORTURE "
58 tests="$tests OPLOCK1 OPLOCK2 OPLOCK3"
59 tests="$tests DIR DIR1 TCON TCONDEV RW1 RW2 RW3"
60 tests="$tests OPEN XCOPY RENAME DELETE PROPERTIES W2K"
61 tests="$tests TCON2 IOCTL CHKPATH FDSESS LOCAL-SUBSTITUTE"
62
63 for t in $tests; do
64     name=`normalize_testname smbtorture3.plain.$t`
65     plantest "$name" dc $VALGRIND $BINDIR/smbtorture //\$SERVER/tmp -U\$USERNAME%\$PASSWORD $t
66 done
67
68 for t in $tests; do
69     name=`normalize_testname smbtorture3.crypt.$t`
70     plantest "$name" dc $VALGRIND $BINDIR/smbtorture //\$SERVER/tmp -U\$USERNAME%\$PASSWORD $t
71 done
72
73 # plain
74 plantest "blackbox.smbclient3.plain" dc BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$USERNAME \$PASSWORD
75 plantest "blackbox.smbclient3.plain member creds" member BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$SERVER\\\\\$USERNAME \$PASSWORD
76 plantest "blackbox.smbclient3.plain domain creds" member BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$DOMAIN\\\\\$DC_USERNAME \$DC_PASSWORD
77
78 # encrypted
79 plantest "blackbox.smbclient3.crypt" dc BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$USERNAME \$PASSWORD "-e"
80
81 # these don't work yet
82 #plantest "blackbox.smbclient3.crypt member creds" member BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$SERVER\\\\\$USERNAME \$PASSWORD "-e"
83 #plantest "blackbox.smbclient3.crypt domain creds" member BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$DOMAIN\\\\\$DC_USERNAME \$DC_PASSWORD "-e"
84
85 plantest "blackbox.wbinfo3" dc BINDIR="$BINDIR" script/tests/test_wbinfo_s3.sh \$DOMAIN \$SERVER \$USERNAME \$PASSWORD
86 plantest "blackbox.net3" dc BINDIR="$BINDIR" SCRIPTDIR="$SCRIPTDIR" script/tests/test_net_s3.sh
87