r3592: auto-cleanup the test.$$ log files in these test scripts on control-C
[samba.git] / source4 / script / tests / test_posix.sh
1 #!/bin/sh
2
3 # this runs the file serving tests that are expected to pass with the
4 # current posix ntvfs backend
5
6 if [ $# -lt 3 ]; then
7 cat <<EOF
8 Usage: test_posix.sh UNC USERNAME PASSWORD <first>
9 EOF
10 exit 1;
11 fi
12
13 unc="$1"
14 username="$2"
15 password="$3"
16 start="$4"
17 shift 3
18
19 testit() {
20    trap "rm -f test.$$" EXIT
21
22    cmdline="$*"
23    if ! $cmdline > test.$$ 2>&1; then
24        cat test.$$;
25        rm -f test.$$;
26        echo "TEST FAILED - $cmdline";
27        exit 1;
28    fi
29    rm -f test.$$;
30 }
31
32
33 tests="BASE-FDPASS BASE-LOCK1 BASE-LOCK2 BASE-LOCK3 BASE-LOCK4"
34 tests="$tests BASE-LOCK5 BASE-LOCK6 BASE-LOCK7 BASE-UNLINK BASE-ATTR"
35 tests="$tests BASE-NEGNOWAIT BASE-DIR1 BASE-DIR2 BASE-VUID"
36 tests="$tests BASE-DENY2 BASE-TCON BASE-TCONDEV BASE-RW1"
37 tests="$tests BASE-DENY3 BASE-XCOPY BASE-OPEN"
38 tests="$tests BASE-DELETE BASE-PROPERTIES BASE-MANGLE"
39 tests="$tests BASE-CHKPATH BASE-SECLEAK BASE-TRANS2"
40 tests="$tests BASE-NTDENY1 BASE-NTDENY2  BASE-RENAME BASE-OPENATTR"
41 tests="$tests RAW-QFSINFO RAW-QFILEINFO RAW-SFILEINFO-BUG"
42 tests="$tests RAW-LOCK RAW-MKDIR RAW-SEEK RAW-CONTEXT RAW-MUX RAW-OPEN"
43 tests="$tests RAW-UNLINK RAW-READ RAW-CLOSE RAW-IOCTL RAW-SEARCH RAW-CHKPATH"
44 tests="$tests LOCAL-ICONV LOCAL-TALLOC LOCAL-MESSAGING LOCAL-BINDING LOCAL-IDTREE"
45
46 soon="BASE-DENY1 BASE-CHARSET"
47 soon="$soon RAW-SFILEINFO RAW-OPLOCK RAW-NOTIFY"
48 soon="$soon RAW-WRITE RAW-RENAME"
49
50 for t in $tests; do
51     if [ ! -z "$start" -a "$start" != $t ]; then
52         continue;
53     fi
54     start=""
55     echo Testing $t
56     testit bin/smbtorture $unc -U"$username"%"$password" $t
57 done