3 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 ## Copyright 1998-2012 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 mkdir -p $TESTDIR $DBDIR1
21 echo "Running slapadd to build slapd database..."
22 . $CONFFILTER $BACKEND $MONITORDB < $CONF > $ADDCONF
23 $SLAPADD -f $ADDCONF -l $LDIFORDERED
25 if test $RC != 0 ; then
26 echo "slapadd failed ($RC)!"
30 echo "Testing modify, add, and delete using slapmodify..."
31 $SLAPMODIFY -f $ADDCONF -l $LDIFMODIFY > $TESTOUT 2>&1
33 if test $RC != 0 ; then
34 echo "slapmodify failed ($RC)!"
38 echo "Starting slapd on TCP/IP port $PORT1..."
39 . $CONFFILTER $BACKEND $MONITORDB < $CONF > $CONF1
40 $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
42 if test $WAIT != 0 ; then
50 echo "Using ldapsearch to retrieve all the entries..."
51 for i in 0 1 2 3 4 5; do
52 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 > $SEARCHOUT 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
69 echo "Filtering ldapsearch results..."
70 $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
71 echo "Filtering original ldif used to create database..."
72 $LDIFFILTER < $LDIF > $LDIFFLT
73 echo "Comparing filter output..."
74 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
76 if test $? != 0 ; then
77 echo "modify operations did not complete correctly"
78 echo $SEARCHFLT $LDIFFLT
79 $DIFF $SEARCHFLT $LDIFFLT
80 test $KILLSERVERS != no && kill -HUP $KILLPIDS
84 test $KILLSERVERS != no && kill -HUP $KILLPIDS
86 echo ">>>>> Test succeeded"
88 test $KILLSERVERS != no && wait