5 if test $# -ge 1 ; then
9 if test $# -ge 1 ; then
13 if test $# -ge 1 ; then
17 echo "running defines.sh"
18 . $SRCDIR/scripts/defines.sh
20 echo "Cleaning up in $DBDIR..."
24 echo "Starting slapd on TCP/IP port $PORT..."
25 . $CONFFILTER $BACKEND < $CONF > $DBCONF
26 $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
28 if test $WAIT != 0 ; then
33 echo "Using ldapsearch to check that slapd is running..."
34 for i in 0 1 2 3 4 5; do
35 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
36 'objectclass=*' > /dev/null 2>&1
38 if test $RC = 1 ; then
39 echo "Waiting 5 seconds for slapd to start..."
44 echo "Using ldapadd to populate the database..."
45 $LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD < \
46 $LDIFLANG > $TESTOUT 2>&1
48 if test $RC != 0 ; then
49 echo "ldapadd failed ($RC)!"
54 echo "Using ldapsearch to read all the entries..."
55 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
56 '(&)' > $SEARCHOUT 2>&1
58 if test $RC != 0 ; then
59 echo "ldapsearch failed ($RC)!"
64 echo "Using ldapsearch to read name ..."
65 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
66 '(&)' 'name' >> $SEARCHOUT 2>&1
68 if test $RC != 0 ; then
69 echo "ldapsearch failed ($RC)!"
74 echo "Using ldapsearch to read name language tag ..."
75 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
76 '(&)' 'name;lang-en-US' >> $SEARCHOUT 2>&1
78 if test $RC != 0 ; then
79 echo "ldapsearch failed ($RC)!"
84 echo "Using ldapsearch to read name language range ..."
85 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
86 '(&)' 'name;lang-en-' >> $SEARCHOUT 2>&1
88 if test $RC != 0 ; then
89 echo "ldapsearch failed ($RC)!"
96 echo "Filtering ldapsearch results..."
97 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
98 echo "Filtering language ldif ..."
99 . $LDIFFILTER < $LDIFLANGOUT > $LDIFFLT
100 echo "Comparing filter output..."
101 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
103 if test $? != 0 ; then
104 echo "comparison failed - language test failed!"
108 echo ">>>>> Test succeeded"