4 echo "running defines.sh"
5 . $SRCDIR/scripts/defines.sh
7 mkdir -p $TESTDIR $DBDIR1
9 echo "Starting slapd on TCP/IP port $PORT1..."
10 . $CONFFILTER $BACKEND $MONITORDB < $CONF > $CONF1
11 $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
13 if test $WAIT != 0 ; then
19 echo "Using ldapsearch to check that slapd is running..."
20 for i in 0 1 2 3 4 5; do
21 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
22 'objectclass=*' > /dev/null 2>&1
24 if test $RC = 0 ; then
27 echo "Waiting 5 seconds for slapd to start..."
31 echo "Using ldapadd to populate the database..."
32 $LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD < \
33 $LDIFLANG > $TESTOUT 2>&1
35 if test $RC != 0 ; then
36 echo "ldapadd failed ($RC)!"
37 test $KILLSERVERS != no && kill -HUP $KILLPIDS
41 echo "Using ldapsearch to read all the entries..."
42 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -s base \
43 '(&)' > $SEARCHOUT 2>&1
46 if test $RC != 0 ; then
47 echo "ldapsearch failed ($RC)!"
48 test $KILLSERVERS != no && kill -HUP $KILLPIDS
52 echo "Using ldapsearch to read name ..."
53 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -s base \
54 '(&)' 'name' >> $SEARCHOUT 2>&1
57 if test $RC != 0 ; then
58 echo "ldapsearch failed ($RC)!"
59 test $KILLSERVERS != no && kill -HUP $KILLPIDS
63 echo "Using ldapsearch to read name language tag ..."
64 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -s base \
65 '(&)' 'name;lang-en-US' >> $SEARCHOUT 2>&1
68 if test $RC != 0 ; then
69 echo "ldapsearch failed ($RC)!"
70 test $KILLSERVERS != no && kill -HUP $KILLPIDS
74 echo "Using ldapsearch to read name language range ..."
75 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -s base \
76 '(&)' 'name;lang-en-' >> $SEARCHOUT 2>&1
79 if test $RC != 0 ; then
80 echo "ldapsearch failed ($RC)!"
81 test $KILLSERVERS != no && kill -HUP $KILLPIDS
85 test $KILLSERVERS != no && kill -HUP $KILLPIDS
87 echo "Filtering ldapsearch results..."
88 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
89 echo "Filtering language ldif ..."
90 . $LDIFFILTER < $LDIFLANGOUT > $LDIFFLT
91 echo "Comparing filter output..."
92 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
94 if test $? != 0 ; then
95 echo "comparison failed - language test failed!"
99 echo ">>>>> Test succeeded"