TODO... selftest: add Samba34 target
[metze/samba/wip.git] / selftest / tests34.sh
1 #!/bin/sh
2 # This script generates a list of testsuites that should be run as part of
3 # the Samba 34 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/skip34 or only run a subset during "make quicktest".
8
9 # The idea is that this script outputs all of the tests of Samba 34, not
10 # just those that are known to pass, and list those that should be skipped
11 # or are known to fail in selftest/skip34 or selftest/knownfail34. This makes it
12 # very easy to see what functionality is still missing in Samba 34 and makes
13 # it possible to run the testsuite against other servers, such as
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 "samba34.$name"
34         else
35                 echo "samba34.$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 plansmbtorture4test() {
48         name=$1
49         env=$2
50         shift 2
51         other_args="$*"
52         modname=`normalize_testname $name`
53         cmdline="$VALGRIND $smb4torture $other_args $name"
54         plantest "$modname" "$env" $cmdline
55 }
56
57 samba4srcdir="`dirname $0`/.."
58 samba4bindir="$BUILDDIR/bin"
59 smb4torture="$samba4bindir/smbtorture4"
60 $smb4torture -V
61
62 TORTURE_OPTIONS=""
63 TORTURE_OPTIONS="$TORTURE_OPTIONS $CONFIGURATION"
64 TORTURE_OPTIONS="$TORTURE_OPTIONS --maximum-runtime=$SELFTEST_MAXTIME"
65 TORTURE_OPTIONS="$TORTURE_OPTIONS --target=samba3"
66 TORTURE_OPTIONS="$TORTURE_OPTIONS --basedir=$SELFTEST_PREFIX"
67 if [ -n "$SELFTEST_VERBOSE" ]; then
68         TORTURE_OPTIONS="$TORTURE_OPTIONS --option=torture:progress=no"
69 fi
70 TORTURE_OPTIONS="$TORTURE_OPTIONS --format=subunit"
71 if [ -n "$SELFTEST_QUICK" ]; then
72         TORTURE_OPTIONS="$TORTURE_OPTIONS --option=torture:quick=yes"
73 fi
74 smb4torture="$smb4torture $TORTURE_OPTIONS"
75
76 echo "OPTIONS $TORTURE_OPTIONS"
77
78 plantest `normalize_testname Hello World` none echo "Hello World"
79
80 plantest `normalize_testname Hello World` franky_dc echo "Hello World"
81
82 for t in LDAP-CLDAP LDAP-BASIC LDAP-SCHEMA
83 # LDAP-UPTODATEVECTOR
84 do
85         plansmbtorture4test "$t" franky_dc "-U\$USERNAME%\$PASSWORD" //\$SERVER_IP/_none_
86 done
87
88 # Tests against the NTVFS POSIX backend
89 NTVFSARGS=""
90 NTVFSARGS="${NTVFSARGS} --option=torture:sharedelay=100000"
91 NTVFSARGS="${NTVFSARGS} --option=torture:oplocktimeout=3"
92 NTVFSARGS="${NTVFSARGS} --option=torture:writetimeupdatedelay=500000"
93
94 #The QFILEINFO-IPC test needs to be on ipc$
95 raw=`$smb4torture --list | grep "^RAW-" | grep -v "RAW-QFILEINFO-IPC"| xargs`
96 base=`$smb4torture --list | grep "^BASE-" | xargs`
97
98 for t in $base $raw; do
99     plansmbtorture4test "$t" franky_dc $ADDARGS //\$SERVER_IP/tmp -U"\$USERNAME"%"\$PASSWORD" $NTVFSARGS
100 done
101
102 plansmbtorture4test "RAW-QFILEINFO-IPC" franky_dc $ADDARGS //\$SERVER_IP/ipc$ -U"\$USERNAME"%"\$PASSWORD"
103
104 rap=`$smb4torture --list | grep "^RAP-" | xargs`
105 for t in $rap; do
106     plansmbtorture4test "$t" franky_dc $ADDARGS //\$SERVER_IP/IPC\\\$ -U"\$USERNAME"%"\$PASSWORD"
107 done
108