]> git.sur5r.net Git - openldap/blob - tests/scripts/test008-concurrency
Add cn=monitor, cn=config, cn=schema to namingContexts.
[openldap] / tests / scripts / test008-concurrency
1 #! /bin/sh
2
3 if test $# -eq 0 ; then
4         SRCDIR="."
5 else
6         SRCDIR=$1; shift
7 fi
8 if test $# -eq 1 ; then
9         BACKEND=$1; shift
10 fi
11
12 echo "running defines.sh $SRCDIR $BACKEND"
13
14 . $SRCDIR/scripts/defines.sh
15
16 echo "Datadir is $DATADIR"
17
18 echo "Cleaning up in $DBDIR..."
19
20 rm -f $DBDIR/[!C*
21
22 echo "Running ldif2ldbm to build slapd database..."
23 $LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools
24 RC=$?
25 if test $RC != 0 ; then
26         echo "ldif2ldbm failed!"
27         exit $RC
28 fi
29
30 echo "Waiting 5 seconds for ldif2ldbm to build slapd database..."
31 sleep 5
32
33 echo "Starting slapd on TCP/IP port $PORT..."
34 $SLAPD -f $CONF -p $PORT -d $LVL $TIMING > $MASTERLOG 2>&1 &
35 PID=$!
36
37 echo "Waiting 5 seconds for slapd to start..."
38 sleep 5
39
40 echo "Using tester for concurrent server access..."
41 $SLAPDTESTER -b "$BASEDN" -P "$PROGDIR" -d "$DATADIR" -h localhost -p $PORT -D "$MANAGERDN" -w $PASSWD -l 50
42 RC=$?
43
44 if test $RC != 0 ; then
45         echo "slapd-tester failed!"
46         exit $RC
47 fi 
48
49 echo "Using ldapsearch to retrieve all the entries..."
50 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
51                         'objectClass=*' > $SEARCHOUT 2>&1
52 RC=$?
53
54 kill -HUP $PID
55
56 if test $RC != 0 ; then
57         echo "ldapsearch failed!"
58         exit $RC
59 fi
60
61 echo "Filtering ldapsearch results..."
62 . $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT
63 echo "Filtering original ldif used to create database..."
64 . $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT
65 echo "Comparing filter output..."
66 cmp $SEARCHFLT $LDIFFLT
67
68 if test $? != 0 ; then
69         echo "comparison failed - database was not created correctly"
70         exit 1
71 fi
72
73 echo ">>>>> Test succeeded"
74
75
76 exit 0