ctdb-daemon: Consolidate basic CTDB context initialisation
[samba.git] / testprogs / blackbox / test_ldb_simple.sh
1 #!/bin/sh
2
3 if [ $# -lt 2 ]; then
4 cat <<EOF
5 Usage: test_ldb_simple.sh PROTOCOL SERVER [OPTIONS]
6 EOF
7 exit 1;
8 fi
9
10
11 p=$1
12 SERVER=$2
13 PREFIX=$3
14 shift 2
15 options="$*"
16
17 . `dirname $0`/subunit.sh
18
19 check() {
20         name="$1"
21         shift
22         cmdline="$*"
23         echo "test: $name"
24         $cmdline
25         status=$?
26         if [ x$status = x0 ]; then
27                 echo "success: $name"
28         else
29                 echo "failure: $name"
30                 failed=`expr $failed + 1`
31         fi
32         return $status
33 }
34
35 export PATH="$BINDIR:$PATH"
36
37 ldbsearch="$VALGRIND ldbsearch"
38
39 check "currentTime" $ldbsearch $CONFIGURATION $options --basedn='' -H $p://$SERVER -s base currentTime || failed=`expr $failed + 1`
40
41 exit $failed