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