xref: /netbsd-src/external/bsd/openldap/dist/tests/scripts/lloadd/test003-cnconfig (revision e670fd5c413e99c2f6a37901bb21c537fcd322d2)
1*e670fd5cSchristos#! /bin/sh
2*e670fd5cSchristos# $OpenLDAP$
3*e670fd5cSchristos## This work is part of OpenLDAP Software <http://www.openldap.org/>.
4*e670fd5cSchristos##
5*e670fd5cSchristos## Copyright 1998-2021 The OpenLDAP Foundation.
6*e670fd5cSchristos## All rights reserved.
7*e670fd5cSchristos##
8*e670fd5cSchristos## Redistribution and use in source and binary forms, with or without
9*e670fd5cSchristos## modification, are permitted only as authorized by the OpenLDAP
10*e670fd5cSchristos## Public License.
11*e670fd5cSchristos##
12*e670fd5cSchristos## A copy of this license is available in the file LICENSE in the
13*e670fd5cSchristos## top-level directory of the distribution or, alternatively, at
14*e670fd5cSchristos## <http://www.OpenLDAP.org/license.html>.
15*e670fd5cSchristos
16*e670fd5cSchristosecho "running defines.sh"
17*e670fd5cSchristos. $SRCDIR/scripts/defines.sh
18*e670fd5cSchristos
19*e670fd5cSchristosmkdir -p $TESTDIR $DBDIR1 $DBDIR2
20*e670fd5cSchristos
21*e670fd5cSchristos$SLAPPASSWD -g -n >$CONFIGPWF
22*e670fd5cSchristosecho "rootpw `$SLAPPASSWD -T $CONFIGPWF`" >$TESTDIR/configpw.conf
23*e670fd5cSchristos
24*e670fd5cSchristosif test $AC_lloadd = lloaddyes ; then
25*e670fd5cSchristos    echo "Load balancer module not available, skipping..."
26*e670fd5cSchristos    exit 0
27*e670fd5cSchristosfi
28*e670fd5cSchristos
29*e670fd5cSchristosecho "Starting the first slapd on TCP/IP port $PORT2..."
30*e670fd5cSchristos. $CONFFILTER $BACKEND < $CONF > $CONF2
31*e670fd5cSchristos$SLAPADD -f $CONF2 -l $LDIFORDERED
32*e670fd5cSchristosRC=$?
33*e670fd5cSchristosif test $RC != 0 ; then
34*e670fd5cSchristos    echo "slapadd failed ($RC)!"
35*e670fd5cSchristos    exit $RC
36*e670fd5cSchristosfi
37*e670fd5cSchristos
38*e670fd5cSchristosecho "Running slapindex to index slapd database..."
39*e670fd5cSchristos$SLAPINDEX -f $CONF2
40*e670fd5cSchristosRC=$?
41*e670fd5cSchristosif test $RC != 0 ; then
42*e670fd5cSchristos    echo "warning: slapindex failed ($RC)"
43*e670fd5cSchristos    echo "  assuming no indexing support"
44*e670fd5cSchristosfi
45*e670fd5cSchristos
46*e670fd5cSchristos$SLAPD -f $CONF2 -h $URI2 -d $LVL > $LOG2 2>&1 &
47*e670fd5cSchristosPID=$!
48*e670fd5cSchristosif test $WAIT != 0 ; then
49*e670fd5cSchristos    echo PID $PID
50*e670fd5cSchristos    read foo
51*e670fd5cSchristosfi
52*e670fd5cSchristosPID2="$PID"
53*e670fd5cSchristosKILLPIDS="$PID"
54*e670fd5cSchristos
55*e670fd5cSchristosecho "Testing slapd searching..."
56*e670fd5cSchristosfor i in 0 1 2 3 4 5; do
57*e670fd5cSchristos    $LDAPSEARCH -s base -b "$MONITOR" -H $URI2 \
58*e670fd5cSchristos        '(objectclass=*)' > /dev/null 2>&1
59*e670fd5cSchristos    RC=$?
60*e670fd5cSchristos    if test $RC = 0 ; then
61*e670fd5cSchristos        break
62*e670fd5cSchristos    fi
63*e670fd5cSchristos    echo "Waiting $SLEEP1 seconds for slapd to start..."
64*e670fd5cSchristos    sleep $SLEEP1
65*e670fd5cSchristosdone
66*e670fd5cSchristosif test $RC != 0 ; then
67*e670fd5cSchristos    echo "ldapsearch failed ($RC)!"
68*e670fd5cSchristos    test $KILLSERVERS != no && kill -HUP $KILLPIDS
69*e670fd5cSchristos    exit $RC
70*e670fd5cSchristosfi
71*e670fd5cSchristos
72*e670fd5cSchristosecho "Running slapadd to build slapd database..."
73*e670fd5cSchristos. $CONFFILTER $BACKEND < $CONFTWO > $CONF3
74*e670fd5cSchristos$SLAPADD -f $CONF3 -l $LDIFORDERED
75*e670fd5cSchristosRC=$?
76*e670fd5cSchristosif test $RC != 0 ; then
77*e670fd5cSchristos    echo "slapadd failed ($RC)!"
78*e670fd5cSchristos    exit $RC
79*e670fd5cSchristosfi
80*e670fd5cSchristos
81*e670fd5cSchristosecho "Running slapindex to index slapd database..."
82*e670fd5cSchristos$SLAPINDEX -f $CONF3
83*e670fd5cSchristosRC=$?
84*e670fd5cSchristosif test $RC != 0 ; then
85*e670fd5cSchristos    echo "warning: slapindex failed ($RC)"
86*e670fd5cSchristos    echo "  assuming no indexing support"
87*e670fd5cSchristosfi
88*e670fd5cSchristos
89*e670fd5cSchristosecho "Starting second slapd on TCP/IP port $PORT3..."
90*e670fd5cSchristos$SLAPD -f $CONF3 -h $URI3 -d $LVL > $LOG3 2>&1 &
91*e670fd5cSchristosPID=$!
92*e670fd5cSchristosif test $WAIT != 0 ; then
93*e670fd5cSchristos    echo PID $PID
94*e670fd5cSchristos    read foo
95*e670fd5cSchristosfi
96*e670fd5cSchristosPID3="$PID"
97*e670fd5cSchristosKILLPIDS="$KILLPIDS $PID"
98*e670fd5cSchristos
99*e670fd5cSchristossleep $SLEEP0
100*e670fd5cSchristos
101*e670fd5cSchristosecho "Testing slapd searching..."
102*e670fd5cSchristosfor i in 0 1 2 3 4 5; do
103*e670fd5cSchristos    $LDAPSEARCH -s base -b "$MONITOR" -H $URI3 \
104*e670fd5cSchristos        '(objectclass=*)' > /dev/null 2>&1
105*e670fd5cSchristos    RC=$?
106*e670fd5cSchristos    if test $RC = 0 ; then
107*e670fd5cSchristos        break
108*e670fd5cSchristos    fi
109*e670fd5cSchristos    echo "Waiting $SLEEP1 seconds for slapd to start..."
110*e670fd5cSchristos    sleep $SLEEP1
111*e670fd5cSchristosdone
112*e670fd5cSchristosif test $RC != 0 ; then
113*e670fd5cSchristos    echo "ldapsearch failed ($RC)!"
114*e670fd5cSchristos    test $KILLSERVERS != no && kill -HUP $KILLPIDS
115*e670fd5cSchristos    exit $RC
116*e670fd5cSchristosfi
117*e670fd5cSchristos
118*e670fd5cSchristosecho "Starting lloadd on TCP/IP port $PORT1..."
119*e670fd5cSchristos. $CONFFILTER $BACKEND < $LLOADDUNREACHABLECONF > $CONF1.lloadd
120*e670fd5cSchristos. $CONFFILTER $BACKEND < $SLAPDLLOADCONF > $CONF1.slapd
121*e670fd5cSchristos$SLAPD -f $CONF1.slapd -h $URI6 -d $LVL > $LOG1 2>&1 &
122*e670fd5cSchristosPID=$!
123*e670fd5cSchristosif test $WAIT != 0 ; then
124*e670fd5cSchristos    echo PID $PID
125*e670fd5cSchristos    read foo
126*e670fd5cSchristosfi
127*e670fd5cSchristosKILLPIDS="$KILLPIDS $PID"
128*e670fd5cSchristos
129*e670fd5cSchristosecho "Testing lloadd searching..."
130*e670fd5cSchristosfor i in 0 1 2 3 4 5; do
131*e670fd5cSchristos    $LDAPSEARCH -s base -b "$MONITOR" -H $URI1 \
132*e670fd5cSchristos        '(objectclass=*)' > /dev/null 2>&1
133*e670fd5cSchristos    RC=$?
134*e670fd5cSchristos    if test $RC = 0 ; then
135*e670fd5cSchristos        break
136*e670fd5cSchristos    fi
137*e670fd5cSchristos    echo "Waiting $SLEEP1 seconds for lloadd to start..."
138*e670fd5cSchristos    sleep $SLEEP1
139*e670fd5cSchristosdone
140*e670fd5cSchristos
141*e670fd5cSchristosif test $RC != 0 ; then
142*e670fd5cSchristos    echo "ldapsearch failed ($RC)!"
143*e670fd5cSchristos    test $KILLSERVERS != no && kill -HUP $KILLPIDS
144*e670fd5cSchristos    exit $RC
145*e670fd5cSchristosfi
146*e670fd5cSchristos
147*e670fd5cSchristos
148*e670fd5cSchristosecho "Testing cn=config searching..."
149*e670fd5cSchristos$LDAPSEARCH -H $URI6 -D cn=config -y $CONFIGPWF \
150*e670fd5cSchristos        -s sub -b "olcBackend={0}lload,cn=config" '(objectclass=*)'  > /dev/null 2>&1
151*e670fd5cSchristosRC=$?
152*e670fd5cSchristosif test $RC != 0 ; then
153*e670fd5cSchristos    echo "ldapsearch failed ($RC)!"
154*e670fd5cSchristos    test $KILLSERVERS != no && kill -HUP $KILLPIDS
155*e670fd5cSchristos    exit $RC
156*e670fd5cSchristosfi
157*e670fd5cSchristos
158*e670fd5cSchristosecho "Deleting backends"
159*e670fd5cSchristos
160*e670fd5cSchristosfor i in 1 2 3 4 ; do
161*e670fd5cSchristos    echo "cn={0}server "$i",olcBackend={0}lload,cn=config"
162*e670fd5cSchristos    $LDAPDELETE -H $URI6 -D cn=config -y $CONFIGPWF \
163*e670fd5cSchristos    "cn={0}server "$i",olcBackend={0}lload,cn=config" > /dev/null 2>&1
164*e670fd5cSchristos    RC=$?
165*e670fd5cSchristos    if test $RC != 0 ; then
166*e670fd5cSchristos           echo "deleting server failed ($RC)!"
167*e670fd5cSchristos           test $KILLSERVERS != no && kill -HUP $KILLPIDS
168*e670fd5cSchristos           exit $RC
169*e670fd5cSchristos    fi
170*e670fd5cSchristosdone
171*e670fd5cSchristos
172*e670fd5cSchristosecho "Testing cn=config searching..."
173*e670fd5cSchristos$LDAPSEARCH -H $URI6 -D cn=config -y $CONFIGPWF \
174*e670fd5cSchristos        -s sub -b "olcBackend={0}lload,cn=config" '(objectclass=*)' > /dev/null 2>&1
175*e670fd5cSchristos
176*e670fd5cSchristos
177*e670fd5cSchristosecho "# Testing exact searching..."
178*e670fd5cSchristos
179*e670fd5cSchristos$LDAPSEARCH -S "" -b "$BASEDN" -H $URI1 \
180*e670fd5cSchristos    '(sn=jENSEN)' >> $SEARCHOUT 2>&1
181*e670fd5cSchristosRC=$?
182*e670fd5cSchristosif test $RC != 52 ; then
183*e670fd5cSchristos    echo "ldapsearch failed ($RC)!"
184*e670fd5cSchristos    test $KILLSERVERS != no && kill -HUP $KILLPIDS
185*e670fd5cSchristos    exit $RC
186*e670fd5cSchristosfi
187*e670fd5cSchristos
188*e670fd5cSchristosecho "Testing adding Server "
189*e670fd5cSchristos$LDAPADD -D cn=config -H $URI6 -y $CONFIGPWF <<EOF > $TESTOUT 2>&1
190*e670fd5cSchristosdn: cn=server 7,olcBackend={0}lload,cn=config
191*e670fd5cSchristosobjectClass: olcBkLloadBackendConfig
192*e670fd5cSchristoscn: server 7
193*e670fd5cSchristosolcBkLloadBackendUri: $URI3
194*e670fd5cSchristosolcBkLloadBindconns: 2
195*e670fd5cSchristosolcBkLloadMaxPendingConns: 3
196*e670fd5cSchristosolcBkLloadMaxPendingOps: 5
197*e670fd5cSchristosolcBkLloadNumconns: 3
198*e670fd5cSchristosolcBkLloadRetry: 5000
199*e670fd5cSchristosEOF
200*e670fd5cSchristosRC=$?
201*e670fd5cSchristosif test $RC != 0 ; then
202*e670fd5cSchristos    echo "ldapadd failed for cn=server 7 ($RC)!"
203*e670fd5cSchristos    test $KILLSERVERS != no && kill -HUP $KILLPIDS
204*e670fd5cSchristos    exit $RC
205*e670fd5cSchristosfi
206*e670fd5cSchristos
207*e670fd5cSchristosecho "Verifying balancer operation..."
208*e670fd5cSchristosfor i in 0 1 2 3 4 5; do
209*e670fd5cSchristos    $LDAPSEARCH -S "" -b "$BASEDN" -H $URI1 \
210*e670fd5cSchristos    '(sn=jENSEN)' >> $SEARCHOUT 2>&1
211*e670fd5cSchristos    RC=$?
212*e670fd5cSchristos    if test $RC = 0 ; then
213*e670fd5cSchristos        break
214*e670fd5cSchristos    fi
215*e670fd5cSchristos    echo "Waiting $SLEEP1 seconds for backend to start..."
216*e670fd5cSchristos    sleep $SLEEP1
217*e670fd5cSchristosdone
218*e670fd5cSchristos
219*e670fd5cSchristosecho "Testing bindconf modify"
220*e670fd5cSchristos$LDAPMODIFY -D cn=config -H $URI6 -y $CONFIGPWF <<EOF >> $TESTOUT 2>&1
221*e670fd5cSchristosdn: olcBackend={0}lload,cn=config
222*e670fd5cSchristoschangetype: modify
223*e670fd5cSchristosreplace: olcBkLloadBindconf
224*e670fd5cSchristosolcBkLloadBindconf: bindmethod=simple timeout=0 network-timeout=0 binddn="cn=wrongmanager,dc=example,dc=com" credentials="secret"
225*e670fd5cSchristosEOF
226*e670fd5cSchristos
227*e670fd5cSchristosRC=$?
228*e670fd5cSchristosif test $RC != 0 ; then
229*e670fd5cSchristos    echo "modify failed for bindconf ($RC)!"
230*e670fd5cSchristos    test $KILLSERVERS != no && kill -HUP $KILLPIDS
231*e670fd5cSchristos    exit $RC
232*e670fd5cSchristosfi
233*e670fd5cSchristos
234*e670fd5cSchristosecho "# Sending a search request..."
235*e670fd5cSchristos
236*e670fd5cSchristos$LDAPSEARCH -S "" -b "$BASEDN" -H $URI1 \
237*e670fd5cSchristos    '(sn=jENSEN)' >> $SEARCHOUT 2>&1
238*e670fd5cSchristosRC=$?
239*e670fd5cSchristosif test $RC != 52 ; then
240*e670fd5cSchristos    echo "ldapsearch failed ($RC)!"
241*e670fd5cSchristos    test $KILLSERVERS != no && kill -HUP $KILLPIDS
242*e670fd5cSchristos    exit $RC
243*e670fd5cSchristosfi
244*e670fd5cSchristos
245*e670fd5cSchristosecho "Restoring bindconf value"
246*e670fd5cSchristos$LDAPMODIFY -D cn=config -H $URI6 -y $CONFIGPWF <<EOF >> $TESTOUT 2>&1
247*e670fd5cSchristosdn: olcBackend={0}lload,cn=config
248*e670fd5cSchristoschangetype: modify
249*e670fd5cSchristosreplace: olcBkLloadBindconf
250*e670fd5cSchristosolcBkLloadBindconf: bindmethod=simple timeout=0 network-timeout=0 binddn="cn=Manager,dc=example,dc=com" credentials="secret"
251*e670fd5cSchristosEOF
252*e670fd5cSchristos
253*e670fd5cSchristosRC=$?
254*e670fd5cSchristosif test $RC != 0 ; then
255*e670fd5cSchristos    echo "modify failed for bindconf ($RC)!"
256*e670fd5cSchristos    test $KILLSERVERS != no && kill -HUP $KILLPIDS
257*e670fd5cSchristos    exit $RC
258*e670fd5cSchristosfi
259*e670fd5cSchristos
260*e670fd5cSchristos
261*e670fd5cSchristosecho "Verifying balancer operation..."
262*e670fd5cSchristosfor i in 0 1 2 3 4 5; do
263*e670fd5cSchristos    $LDAPSEARCH -S "" -b "$BASEDN" -H $URI1 \
264*e670fd5cSchristos    '(sn=jENSEN)' >> $SEARCHOUT 2>&1
265*e670fd5cSchristos    RC=$?
266*e670fd5cSchristos    if test $RC = 0 ; then
267*e670fd5cSchristos        break
268*e670fd5cSchristos    fi
269*e670fd5cSchristos    echo "Waiting $SLEEP1 seconds for backend to start..."
270*e670fd5cSchristos    sleep $SLEEP1
271*e670fd5cSchristosdone
272*e670fd5cSchristos
273*e670fd5cSchristosecho "Testing global attributes"
274*e670fd5cSchristosecho "Testing olcBkLloadMaxPDUPerCycle modify"
275*e670fd5cSchristos$LDAPMODIFY -D cn=config -H $URI6 -y $CONFIGPWF <<EOF >> $TESTOUT 2>&1
276*e670fd5cSchristosdn: olcBackend={0}lload,cn=config
277*e670fd5cSchristoschangetype: modify
278*e670fd5cSchristosreplace: olcBkLloadMaxPDUPerCycle
279*e670fd5cSchristosolcBkLloadMaxPDUPerCycle: 2000
280*e670fd5cSchristosEOF
281*e670fd5cSchristos
282*e670fd5cSchristosRC=$?
283*e670fd5cSchristosif test $RC != 0 ; then
284*e670fd5cSchristos    echo "modify failed for olcBkLloadMaxPDUPerCycle($RC)!"
285*e670fd5cSchristos    test $KILLSERVERS != no && kill -HUP $KILLPIDS
286*e670fd5cSchristos    exit $RC
287*e670fd5cSchristosfi
288*e670fd5cSchristos
289*e670fd5cSchristosecho "Sending a search request..."
290*e670fd5cSchristos$LDAPSEARCH -S "" -b "$BASEDN" -H $URI1 \
291*e670fd5cSchristos    '(sn=jENSEN)' >> $SEARCHOUT 2>&1
292*e670fd5cSchristosRC=$?
293*e670fd5cSchristosif test $RC != 0 ; then
294*e670fd5cSchristos    echo "ldapsearch failed ($RC)!"
295*e670fd5cSchristos    test $KILLSERVERS != no && kill -HUP $KILLPIDS
296*e670fd5cSchristos    exit $RC
297*e670fd5cSchristosfi
298*e670fd5cSchristos
299*e670fd5cSchristosecho "Testing olcBkLloadSockbufMaxClient modify"
300*e670fd5cSchristos$LDAPMODIFY -D cn=config -H $URI6 -y $CONFIGPWF <<EOF >> $TESTOUT 2>&1
301*e670fd5cSchristosdn: olcBackend={0}lload,cn=config
302*e670fd5cSchristoschangetype: modify
303*e670fd5cSchristosreplace: olcBkLloadSockbufMaxClient
304*e670fd5cSchristosolcBkLloadSockbufMaxClient: 20000
305*e670fd5cSchristosEOF
306*e670fd5cSchristos
307*e670fd5cSchristosRC=$?
308*e670fd5cSchristosif test $RC != 0 ; then
309*e670fd5cSchristos    echo "modify failed for olcBkLloadSockbufMaxClient($RC)!"
310*e670fd5cSchristos    test $KILLSERVERS != no && kill -HUP $KILLPIDS
311*e670fd5cSchristos    exit $RC
312*e670fd5cSchristosfi
313*e670fd5cSchristos
314*e670fd5cSchristosecho "Sending a search request..."
315*e670fd5cSchristos$LDAPSEARCH -S "" -b "$BASEDN" -H $URI1 \
316*e670fd5cSchristos    '(sn=jENSEN)' >> $SEARCHOUT 2>&1
317*e670fd5cSchristosRC=$?
318*e670fd5cSchristosif test $RC != 0 ; then
319*e670fd5cSchristos    echo "ldapsearch failed ($RC)!"
320*e670fd5cSchristos    test $KILLSERVERS != no && kill -HUP $KILLPIDS
321*e670fd5cSchristos    exit $RC
322*e670fd5cSchristosfi
323*e670fd5cSchristos
324*e670fd5cSchristosecho "Testing olcBkLloadSockbufMaxUpstream modify"
325*e670fd5cSchristos$LDAPMODIFY -D cn=config -H $URI6 -y $CONFIGPWF <<EOF >> $TESTOUT 2>&1
326*e670fd5cSchristosdn: olcBackend={0}lload,cn=config
327*e670fd5cSchristoschangetype: modify
328*e670fd5cSchristosreplace: olcBkLloadSockbufMaxUpstream
329*e670fd5cSchristosolcBkLloadSockbufMaxUpstream: 200000
330*e670fd5cSchristosEOF
331*e670fd5cSchristos
332*e670fd5cSchristosRC=$?
333*e670fd5cSchristosif test $RC != 0 ; then
334*e670fd5cSchristos    echo "modify failed for olcBkLloadSockbufMaxUpstream($RC)!"
335*e670fd5cSchristos    test $KILLSERVERS != no && kill -HUP $KILLPIDS
336*e670fd5cSchristos    exit $RC
337*e670fd5cSchristosfi
338*e670fd5cSchristos
339*e670fd5cSchristosecho "Sending a search request..."
340*e670fd5cSchristos$LDAPSEARCH -S "" -b "$BASEDN" -H $URI1 \
341*e670fd5cSchristos    '(sn=jENSEN)' >> $SEARCHOUT 2>&1
342*e670fd5cSchristosRC=$?
343*e670fd5cSchristosif test $RC != 0 ; then
344*e670fd5cSchristos    echo "ldapsearch failed ($RC)!"
345*e670fd5cSchristos    test $KILLSERVERS != no && kill -HUP $KILLPIDS
346*e670fd5cSchristos    exit $RC
347*e670fd5cSchristosfi
348*e670fd5cSchristos
349*e670fd5cSchristosecho "Testing olcBkLloadIOTimeout modify"
350*e670fd5cSchristos$LDAPMODIFY -D cn=config -H $URI6 -y $CONFIGPWF <<EOF >> $TESTOUT 2>&1
351*e670fd5cSchristosdn: olcBackend={0}lload,cn=config
352*e670fd5cSchristoschangetype: modify
353*e670fd5cSchristosreplace: olcBkLloadIOTimeout
354*e670fd5cSchristosolcBkLloadIOTimeout: 20000
355*e670fd5cSchristosEOF
356*e670fd5cSchristos
357*e670fd5cSchristosRC=$?
358*e670fd5cSchristosif test $RC != 0 ; then
359*e670fd5cSchristos    echo "modify failed for olcBkLloadWriteTimeout($RC)!"
360*e670fd5cSchristos    test $KILLSERVERS != no && kill -HUP $KILLPIDS
361*e670fd5cSchristos    exit $RC
362*e670fd5cSchristosfi
363*e670fd5cSchristos
364*e670fd5cSchristosecho "Sending a search request..."
365*e670fd5cSchristos$LDAPSEARCH -S "" -b "$BASEDN" -H $URI1 \
366*e670fd5cSchristos    '(sn=jENSEN)' >> $SEARCHOUT 2>&1
367*e670fd5cSchristosRC=$?
368*e670fd5cSchristosif test $RC != 0 ; then
369*e670fd5cSchristos    echo "ldapsearch failed ($RC)!"
370*e670fd5cSchristos    test $KILLSERVERS != no && kill -HUP $KILLPIDS
371*e670fd5cSchristos    exit $RC
372*e670fd5cSchristosfi
373*e670fd5cSchristos
374*e670fd5cSchristosecho "Testing backend attributes"
375*e670fd5cSchristosecho "Testing olcBkLloadBindconns modify"
376*e670fd5cSchristos$LDAPMODIFY -D cn=config -H $URI6 -y $CONFIGPWF <<EOF >> $TESTOUT 2>&1
377*e670fd5cSchristosdn: cn={0}server 7,olcBackend={0}lload,cn=config
378*e670fd5cSchristoschangetype: modify
379*e670fd5cSchristosreplace: olcBkLloadBindconns
380*e670fd5cSchristosolcBkLloadBindconns: 20
381*e670fd5cSchristosEOF
382*e670fd5cSchristos
383*e670fd5cSchristosRC=$?
384*e670fd5cSchristosif test $RC != 0 ; then
385*e670fd5cSchristos    echo "modify failed for olcBkLloadBindconns($RC)!"
386*e670fd5cSchristos    test $KILLSERVERS != no && kill -HUP $KILLPIDS
387*e670fd5cSchristos    exit $RC
388*e670fd5cSchristosfi
389*e670fd5cSchristos
390*e670fd5cSchristosecho "Testing exact searching..."
391*e670fd5cSchristos$LDAPSEARCH -S "" -b "$BASEDN" -H $URI1 \
392*e670fd5cSchristos    '(sn=jENSEN)' >> $SEARCHOUT 2>&1
393*e670fd5cSchristosRC=$?
394*e670fd5cSchristosif test $RC != 0 ; then
395*e670fd5cSchristos    echo "ldapsearch failed ($RC)!"
396*e670fd5cSchristos    test $KILLSERVERS != no && kill -HUP $KILLPIDS
397*e670fd5cSchristos    exit $RC
398*e670fd5cSchristosfi
399*e670fd5cSchristos
400*e670fd5cSchristos
401*e670fd5cSchristosecho "Testing olcBkLloadMaxPendingConns modify"
402*e670fd5cSchristos$LDAPMODIFY -D cn=config -H $URI6 -y $CONFIGPWF <<EOF >> $TESTOUT 2>&1
403*e670fd5cSchristosdn: cn={0}server 7,olcBackend={0}lload,cn=config
404*e670fd5cSchristoschangetype: modify
405*e670fd5cSchristosreplace: olcBkLloadMaxPendingConns
406*e670fd5cSchristosolcBkLloadMaxPendingConns: 30
407*e670fd5cSchristosEOF
408*e670fd5cSchristos
409*e670fd5cSchristosRC=$?
410*e670fd5cSchristosif test $RC != 0 ; then
411*e670fd5cSchristos    echo "modify failed for olcBkLloadMaxPendingConns($RC)!"
412*e670fd5cSchristos    test $KILLSERVERS != no && kill -HUP $KILLPIDS
413*e670fd5cSchristos    exit $RC
414*e670fd5cSchristosfi
415*e670fd5cSchristos
416*e670fd5cSchristosecho "Testing exact searching..."
417*e670fd5cSchristos$LDAPSEARCH -S "" -b "$BASEDN" -H $URI1 \
418*e670fd5cSchristos    '(sn=jENSEN)' >> $SEARCHOUT 2>&1
419*e670fd5cSchristosRC=$?
420*e670fd5cSchristosif test $RC != 0 ; then
421*e670fd5cSchristos    echo "ldapsearch failed ($RC)!"
422*e670fd5cSchristos    test $KILLSERVERS != no && kill -HUP $KILLPIDS
423*e670fd5cSchristos    exit $RC
424*e670fd5cSchristosfi
425*e670fd5cSchristos
426*e670fd5cSchristostest $KILLSERVERS != no && kill -HUP $KILLPIDS
427*e670fd5cSchristos
428*e670fd5cSchristos
429*e670fd5cSchristosecho ">>>>> Test succeeded"
430*e670fd5cSchristos
431*e670fd5cSchristostest $KILLSERVERS != no && wait
432*e670fd5cSchristos
433*e670fd5cSchristosexit 0
434