3 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 ## Copyright 1998-2013 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
21 mkdir -p $TESTDIR $DBDIR1A $DBDIR1B $DBDIR1C
23 ITSDIR=$DATADIR/regressions/its$ITS
24 ITSCONF=$ITSDIR/slapd-glue.conf
26 echo "Running multi-threaded slapadd in quick mode to build glued slapd databases..."
27 . $CONFFILTER $BACKEND $MONITORDB < $ITSCONF > $CONF1
28 $SLAPADD -q -d $LVL -f $CONF1 -l $LDIFORDERED > $SLAPADDLOG1 2>&1
30 if test $RC != 0 ; then
31 echo "slapadd failed ($RC)!"
35 echo "Starting slapd on TCP/IP port $PORT1..."
36 $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
38 if test $WAIT != 0 ; then
46 echo "Using ldapsearch to retrieve all the entries..."
47 for i in 0 1 2 3 4 5; do
48 $LDAPSEARCH -b "$BASEDN" -h $LOCALHOST -p $PORT1 > $SEARCHOUT 2>&1
50 if test $RC = 0 ; then
53 echo "Waiting 5 seconds for slapd to start..."
57 if test $RC != 0 ; then
58 echo "ldapsearch failed ($RC)!"
59 test $KILLSERVERS != no && kill -HUP $KILLPIDS
63 echo "Filtering ldapsearch results..."
64 $LDIFFILTER -s ldif=e < $SEARCHOUT > $SEARCHFLT
65 echo "Filtering original ldif used to create database..."
66 $LDIFFILTER -s ldif=e < $LDIFGLUED > $LDIFFLT
67 echo "Comparing filter output..."
68 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
70 if test $? != 0 ; then
71 echo "comparison failed - database was not created correctly"
72 echo $SEARCHFLT $LDIFFLT
73 $DIFF $SEARCHFLT $LDIFFLT
74 test $KILLSERVERS != no && kill -HUP $KILLPIDS
78 test $KILLSERVERS != no && kill -HUP $KILLPIDS
80 echo ">>>>> Test succeeded"
82 test $KILLSERVERS != no && wait