Fixed the patchfile tests and tidy up the patchfile backends.
[Samba.git] / testprogs / blackbox / test_gentest.sh
blob89cc8c2795b7971ceada30eb5f2bf52a31ea3040
1 #!/bin/sh
2 # Blackbox tests for gentest
3 # Copyright (C) 2008 Andrew Tridgell
4 # based on test_smbclient.sh
6 if [ $# -lt 4 ]; then
7 cat <<EOF
8 Usage: test_gentest.sh SERVER USERNAME PASSWORD DOMAIN
9 EOF
10 exit 1;
13 SERVER=$1
14 USERNAME=$2
15 PASSWORD=$3
16 DOMAIN=$4
17 shift 4
18 failed=0
20 samba4bindir=`dirname $0`/../../source/bin
21 gentest=$samba4bindir/gentest
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"
35 return $status
38 cat <<EOF > st/gentest.ignore
39 all_info.out.fname
40 internal_information.out.file_id
41 EOF
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`
45 /bin/rm -f st/gentest.ignore
47 exit $failed