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