3 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 ## Copyright 1998-2011 The OpenLDAP Foundation.
6 ## All rights reserved.
8 ## Redistribution and use in source and binary forms, with or without
9 ## modification, are permitted only as authorized by the OpenLDAP
12 ## A copy of this license is available in the file LICENSE in the
13 ## top-level directory of the distribution or, alternatively, at
14 ## <http://www.OpenLDAP.org/license.html>.
16 echo "running defines.sh"
17 . $SRCDIR/scripts/defines.sh
19 if test "$BACKEND" != "bdb" && test "$BACKEND" != "hdb" ; then
20 echo "Warning: this test is known to affect bdb and hdb, although it may impact other backends as well."
23 mkdir -p $DBDIR1A $DBDIR2A
26 ITSDIR=$DATADIR/regressions/its$ITS
27 USER="uid=user1,ou=People,dc=example,dc=com"
30 echo "Running slapadd to build slapd database..."
31 . $CONFFILTER $BACKEND $MONITORDB < $ITSDIR/slapd.conf > $CONF1
32 $SLAPADD -f $CONF1 -l $ITSDIR/adds.ldif
34 if test $RC != 0 ; then
35 echo "slapadd failed ($RC)!"
39 echo "Starting slapd on TCP/IP port $PORT1..."
40 $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
42 if test $WAIT != 0 ; then
50 for i in 0 1 2 3 4 5; do
51 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
52 '(objectClass=*)' > /dev/null 2>&1
54 if test $RC = 0 ; then
57 echo "Waiting 5 seconds for slapd to start..."
61 if test $RC != 0 ; then
62 echo "ldapsearch failed ($RC)!"
63 test $KILLSERVERS != no && kill -HUP $KILLPIDS
68 echo " This test applies a round of updates __after__ grabbing a lock"
69 echo " that, before the fix, was not correctly released; in case "
70 echo " of failure, the second round of updates will deadlock."
71 echo " This issue was fixed in OpenLDAP 2.3.14."
75 FILE="${ITSDIR}/mods.ldif"
76 echo "${S}) Applying `basename ${FILE}`..."
77 $LDAPMODIFY -v -D "$USER" -w $PASS -h $LOCALHOST -p $PORT1 \
78 -f "${FILE}" > $TESTOUT 2>&1
80 if test $RC != 0 ; then
81 echo "ldapmodify failed ($RC)!"
82 test $KILLSERVERS != no && kill -HUP $KILLPIDS
88 test $KILLSERVERS != no && kill -HUP $KILLPIDS
90 echo ">>>>> Test succeeded"
92 test $KILLSERVERS != no && wait