Merge branch 'v4-0-test' of git://git.samba.org/samba into 4-0-local
[samba.git] / testprogs / blackbox / test_locktest.sh
1 #!/bin/sh
2 # Blackbox tests for locktest
3 # Copyright (C) 2008 Andrew Tridgell
4 # based on test_smbclient.sh
5
6 if [ $# -lt 5 ]; then
7 cat <<EOF
8 Usage: test_locktest.sh SERVER USERNAME PASSWORD DOMAIN PREFIX
9 EOF
10 exit 1;
11 fi
12
13 SERVER=$1
14 USERNAME=$2
15 PASSWORD=$3
16 DOMAIN=$4
17 PREFIX=$5
18 shift 5
19 failed=0
20
21 samba4bindir=`dirname $0`/../../source/bin
22 locktest=$samba4bindir/locktest
23
24 testit() {
25         name="$1"
26         shift
27         cmdline="$*"
28         echo "test: $name"
29         $cmdline
30         status=$?
31         if [ x$status = x0 ]; then
32                 echo "success: $name"
33         else
34                 echo "failure: $name"
35         fi
36         return $status
37 }
38
39 testit "locktest" $VALGRIND $locktest //$SERVER/test1 //$SERVER/test2 --num-ops=100  -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@ || failed=`expr $failed + 1`
40
41 exit $failed