83593dde4d60e55252066607524dbd56d385b59f
[ira/wip.git] / source3 / script / tests / test_posix_s3.sh
1 #!/bin/sh
2
3 # this runs the file serving tests that are expected to pass with samba3
4
5 if [ $# -lt 3 ]; then
6 cat <<EOF
7 Usage: test_posix_s3.sh UNC USERNAME PASSWORD <first> <smbtorture args>
8 EOF
9 exit 1;
10 fi
11
12 unc="$1"
13 username="$2"
14 password="$3"
15 start="$4"
16 shift 4
17 ADDARGS="$*"
18
19 test x"$TEST_FUNCTIONS_SH" != x"INCLUDED" && {
20 incdir=`dirname $0`
21 . $incdir/test_functions.sh
22 }
23
24 base="BASE-ATTR BASE-CHARSET BASE-CHKPATH BASE-DEFER_OPEN BASE-DELAYWRITE BASE-DELETE"
25 base="$base BASE-DENY1 BASE-DENY2 BASE-DENY3 BASE-DENYDOS BASE-DIR1 BASE-DIR2"
26 base="$base BASE-DISCONNECT BASE-FDPASS BASE-LOCK"
27 base="$base BASE-MANGLE BASE-NEGNOWAIT BASE-NTDENY1"
28 base="$base BASE-NTDENY2 BASE-OPEN BASE-OPENATTR BASE-PROPERTIES BASE-RENAME BASE-RW1"
29 base="$base BASE-SECLEAK BASE-TCON BASE-TCONDEV BASE-TRANS2 BASE-UNLINK BASE-VUID"
30 base="$base BASE-XCOPY BASE-SAMBA3ERROR"
31
32 raw="RAW-ACLS RAW-CHKPATH RAW-CLOSE RAW-COMPOSITE RAW-CONTEXT RAW-EAS"
33 raw="$raw RAW-IOCTL RAW-LOCK RAW-MKDIR RAW-MUX RAW-NOTIFY RAW-OPEN RAW-OPLOCK"
34 raw="$raw RAW-QFILEINFO RAW-QFSINFO RAW-READ RAW-RENAME RAW-SEARCH RAW-SEEK"
35 raw="$raw RAW-SFILEINFO RAW-SFILEINFO-BUG RAW-STREAMS RAW-UNLINK RAW-WRITE"
36 raw="$raw RAW-SAMBA3HIDE RAW-SAMBA3BADPATH RAW-SFILEINFO-RENAME"
37 raw="$raw RAW-SAMBA3CASEINSENSITIVE RAW-SAMBA3POSIXTIMEDLOCK"
38 raw="$raw RAW-SAMBA3ROOTDIRFID"
39
40 rpc="RPC-AUTHCONTEXT RPC-BINDSAMBA3 RPC-SAMBA3-SRVSVC RPC-SAMBA3-SHARESEC"
41 rpc="$rpc RPC-SAMBA3-SPOOLSS RPC-SAMBA3-WKSSVC"
42 rpc="$rpc RPC-NETLOGSAMBA3 RPC-SAMBA3SESSIONKEY RPC-SAMBA3-GETUSERNAME"
43 rpc="$rpc RPC-SVCCTL RPC-SPOOLSS RPC-SPOOLSS-WIN RPC-NTSVCS"
44 rpc="$rpc RPC-LSA-GETUSER RPC-LSA-LOOKUPSIDS RPC-LSA-LOOKUPNAMES"
45 rpc="$rpc RPC-SAMR-USERS RPC-SAMR-USERS-PRIVILEGES RPC-SAMR-PASSWORDS RPC-SAMR-PASSWORDS-PWDLASTSET RPC-SAMR-LARGE-DC RPC-JOIN"
46 rpc="$rpc RPC-SCHANNEL RPC-SCHANNEL2 RPC-BENCH-SCHANNEL1"
47
48 local="LOCAL-NSS-WRAPPER"
49
50 # NOTE: to enable the UNIX-WHOAMI test, we need to change the default share
51 # config to allow guest access. I'm not sure whether this would break other
52 # tests, so leaving it alone for now -- jpeach
53 unix="UNIX-INFO2"
54
55 tests="$base $raw $rpc $unix $local"
56
57 if test "x$POSIX_SUBTESTS" != "x" ; then
58         tests="$POSIX_SUBTESTS"
59 fi
60
61 skipped="BASE-CHARSET BASE-TCONDEV"
62 skipped="$skipped RAW-ACLS RAW-COMPOSITE RAW-CONTEXT"
63 skipped="$skipped RAW-IOCTL"
64 skipped="$skipped RAW-QFILEINFO RAW-QFSINFO"
65 skipped="$skipped RAW-SFILEINFO"
66
67 echo "WARNING: Skipping tests $skipped"
68
69 ADDARGS="$ADDARGS --option=torture:sharedelay=100000"
70 ADDARGS="$ADDARGS --option=torture:writetimeupdatedelay=500000"
71
72 failed=0
73 for t in $tests; do
74     if [ ! -z "$start" -a "$start" != $t ]; then
75         continue;
76     fi
77     skip=0
78     for s in $skipped; do
79         if [ x"$s" = x"$t" ]; then
80             skip=1;
81             break;
82         fi
83     done
84     if [ $skip = 1 ]; then
85         continue;
86     fi
87     start=""
88     name="$t"
89     testit "$name" $VALGRIND $SMBTORTURE4 $TORTURE4_OPTIONS $ADDARGS $unc -U"$username"%"$password" $t || failed=`expr $failed + 1`
90 done
91
92 testok $0 $failed