1#!/bin/sh
2
3# this runs the file serving tests that are expected to pass with the
4# current posix ntvfs backend
5
6if [ $# -lt 3 ]; then
7cat <<EOF
8Usage: test_posix.sh UNC USERNAME PASSWORD <first> <smbtorture args>
9EOF
10exit 1;
11fi
12
13unc="$1"
14username="$2"
15password="$3"
16start="$4"
17shift 4
18ADDARGS="$*"
19
20incdir=`dirname $0`
21. $incdir/test_functions.sh
22
23#
24# please don't remove tests here, when you want them to be skipped!
25# just add them to the skipped line below
26# this should be the complete list smbtorture offers as BASE-* tests
27#
28base="BASE-ATTR BASE-CHARSET BASE-CHKPATH BASE-DEFER_OPEN BASE-DELAYWRITE BASE-DELETE"
29base="$base BASE-DENY1 BASE-DENY2 BASE-DENY3 BASE-DENYDOS BASE-DIR1 BASE-DIR2"
30base="$base BASE-DISCONNECT BASE-FDPASS BASE-LOCK "
31base="$base BASE-MANGLE BASE-NEGNOWAIT BASE-NTDENY1"
32base="$base BASE-NTDENY2 BASE-OPEN BASE-OPENATTR BASE-PROPERTIES BASE-RENAME BASE-RW1"
33base="$base BASE-SECLEAK BASE-TCON BASE-TCONDEV BASE-TRANS2 BASE-UNLINK BASE-VUID"
34base="$base BASE-XCOPY"
35
36#
37# please don't remove tests here, when you want them to be skipped!
38# just add them to the skipped line below
39# this should be the complete list smbtorture offers as RAW-* tests
40#
41raw="RAW-CHKPATH RAW-CLOSE RAW-COMPOSITE RAW-CONTEXT RAW-EAS"
42raw="$raw RAW-IOCTL RAW-LOCK RAW-MKDIR RAW-MUX RAW-NOTIFY RAW-OPEN RAW-OPLOCK"
43raw="$raw RAW-QFILEINFO RAW-QFSINFO RAW-READ RAW-RENAME RAW-SEARCH RAW-SEEK"
44raw="$raw RAW-SFILEINFO RAW-SFILEINFO-BUG RAW-STREAMS RAW-UNLINK RAW-WRITE"
45
46smb2="SMB2-CONNECT SMB2-GETINFO SMB2-SETINFO SMB2-FIND"
47
48tests="$base $raw $smb2"
49
50#
51# please add tests you want to be skipped here!
52#
53skipped="BASE-CHARSET BASE-DEFER_OPEN BASE-DELAYWRITE RAW-COMPOSITE RAW-OPLOCK RAW-ACLS"
54
55echo "WARNING: Skipping tests $skipped"
56
57failed=0
58for t in $tests; do
59    if [ ! -z "$start" -a "$start" != $t ]; then
60	continue;
61    fi
62    skip=0
63    for s in $skipped; do
64    	if [ x"$s" = x"$t" ]; then
65    	    skip=1;
66	    break;
67	fi
68    done
69    if [ $skip = 1 ]; then
70    	continue;
71    fi
72    start=""
73    name="$t"
74    testit "$name" $VALGRIND bin/smbtorture $TORTURE_OPTIONS $ADDARGS $unc -U"$username"%"$password" $t || failed=`expr $failed + 1`
75done
76
77testok $0 $failed
78