4 echo "running defines.sh"
5 . $SRCDIR/scripts/defines.sh
7 mkdir -p $TESTDIR $DBDIR1
9 echo "Running slapadd to build slapd database..."
10 . $CONFFILTER $BACKEND $MONITORDB < $CONF > $CONF1
11 $SLAPADD -f $CONF1 -l $LDIFORDERED
13 if test $RC != 0 ; then
14 echo "slapadd failed ($RC)!"
18 echo "Starting slapd on TCP/IP port $PORT1..."
19 $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
21 if test $WAIT != 0 ; then
27 echo "Testing slapd modify operations..."
28 for i in 0 1 2 3 4 5; do
29 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
30 'objectclass=*' > /dev/null 2>&1
32 if test $RC = 0 ; then
35 echo "Waiting 5 seconds for slapd to start..."
39 if test $RC != 0 ; then
40 echo "ldapsearch failed ($RC)!"
41 test $KILLSERVERS != no && kill -HUP $KILLPIDS
45 echo "Testing modify, add, and delete..."
46 $LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
47 $TESTOUT 2>&1 << EOMODS
50 # LEADING COMMENT AND WHITE SPACE
52 dn: cn=James A Jones 1,ou=Alumni Association,ou=People,o=University of Michigan,c=US
70 dn: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,o=University of Michigan,c=US
75 description: The replaced multiLineDescription $ Blah Woof.
81 dn: cn=ITD Staff,ou=Groups,o=University of Michigan,c=US
84 uniquemember: cn=James A Jones 2,ou=Information Technology Division,
85 ou=People,o=University of Michigan,c=US
86 uniquemember: cn=Bjorn Jensen,ou=Information Technology Division,
87 ou=People,o=University of Michigan,c=US
90 uniquemember: cn=Dorothy Stevens,ou=Alumni Association,
91 ou=People,o=University of Michigan,c=US
92 uniquemember: cn=James A Jones 1,ou=Alumni Association,
93 ou=People,o=University of Michigan,c=US
95 dn: cn=All Staff,ou=Groups,o=University of Michigan,c=US
100 member: cn=Dorothy Stevens,ou=Alumni Association,ou=People,o=University of Michigan,c=US
104 dn: cn=Gern Jensen,ou=Information Technology Division,ou=People,o=University of Michigan,c=US
106 objectclass: OpenLDAPperson
110 title: Chief Investigator, ITD
111 postaladdress: ITD $ 535 W. William St $ Ann Arbor, MI 48103
112 seealso: cn=All Staff,ou=Groups,o=University of Michigan,c=US
114 homepostaladdress: 844 Brown St. Apt. 4 $ Ann Arbor, MI 48104
115 description: Very odd
116 facsimiletelephonenumber: +1 313 555 7557
117 telephonenumber: +1 313 555 8343
118 mail: gjensen@mailgw.example.com
119 homephone: +1 313 555 8844
121 dn: cn=James A Jones 2,ou=Information Technology Division,ou=People,o=University of Michigan,c=US
123 # TRAILING COMMENT AND WHITE SPACE
125 dn: ou=People,o=University of Michigan,c=US
136 if test $RC != 0 ; then
137 echo "ldapmodify failed ($RC)!"
138 test $KILLSERVERS != no && kill -HUP $KILLPIDS
142 echo "Using ldapsearch to retrieve all the entries..."
143 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
144 'objectClass=*' > $SEARCHOUT 2>&1
146 test $KILLSERVERS != no && kill -HUP $KILLPIDS
147 if test $RC != 0 ; then
148 echo "ldapsearch failed ($RC)!"
152 LDIF=$MODIFYOUTMASTER
154 echo "Filtering ldapsearch results..."
155 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
156 echo "Filtering original ldif used to create database..."
157 . $LDIFFILTER < $LDIF > $LDIFFLT
158 echo "Comparing filter output..."
159 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
161 if test $? != 0 ; then
162 echo "comparison failed - modify operations did not complete correctly"
166 echo ">>>>> Test succeeded"