4 echo "running defines.sh"
5 . $SRCDIR/scripts/defines.sh
9 echo "Running slapadd to build slapd database..."
10 . $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
11 $SLAPADD -f $DBCONF -l $LDIFORDERED
13 if test $RC != 0 ; then
14 echo "slapadd failed ($RC)!"
18 echo "Starting slapd on TCP/IP port $PORT..."
19 $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
21 if test $WAIT != 0 ; then
26 echo "Testing slapd modify operations..."
27 for i in 0 1 2 3 4 5; do
28 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
29 'objectclass=*' > /dev/null 2>&1
31 if test $RC = 0 ; then
34 echo "Waiting 5 seconds for slapd to start..."
38 if test $RC != 0 ; then
39 echo "ldapsearch failed ($RC)!"
44 echo "Testing modify, add, and delete..."
45 $LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD > \
46 $TESTOUT 2>&1 << EOMODS
49 # LEADING COMMENT AND WHITE SPACE
51 dn: cn=James A Jones 1,ou=Alumni Association,ou=People,o=University of Michigan,c=US
69 dn: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,o=University of Michigan,c=US
74 description: The replaced multiLineDescription $ Blah Woof.
80 dn: cn=ITD Staff,ou=Groups,o=University of Michigan,c=US
83 uniquemember: cn=James A Jones 2,ou=Information Technology Division,
84 ou=People,o=University of Michigan,c=US
85 uniquemember: cn=Bjorn Jensen,ou=Information Technology Division,
86 ou=People,o=University of Michigan,c=US
89 uniquemember: cn=Dorothy Stevens,ou=Alumni Association,
90 ou=People,o=University of Michigan,c=US
91 uniquemember: cn=James A Jones 1,ou=Alumni Association,
92 ou=People,o=University of Michigan,c=US
94 dn: cn=All Staff,ou=Groups,o=University of Michigan,c=US
99 member: cn=Dorothy Stevens,ou=Alumni Association,ou=People,o=University of Michigan,c=US
103 dn: cn=Gern Jensen,ou=Information Technology Division,ou=People,o=University of Michigan,c=US
105 objectclass: OpenLDAPperson
109 title: Chief Investigator, ITD
110 postaladdress: ITD $ 535 W. William St $ Ann Arbor, MI 48103
111 seealso: cn=All Staff,ou=Groups,o=University of Michigan,c=US
113 homepostaladdress: 844 Brown St. Apt. 4 $ Ann Arbor, MI 48104
114 description: Very odd
115 facsimiletelephonenumber: +1 313 555 7557
116 telephonenumber: +1 313 555 8343
117 mail: gjensen@mailgw.example.com
118 homephone: +1 313 555 8844
120 dn: cn=James A Jones 2,ou=Information Technology Division,ou=People,o=University of Michigan,c=US
122 # TRAILING COMMENT AND WHITE SPACE
124 dn: ou=People,o=University of Michigan,c=US
135 if test $RC != 0 ; then
136 echo "ldapmodify failed ($RC)!"
141 echo "Using ldapsearch to retrieve all the entries..."
142 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
143 'objectClass=*' > $SEARCHOUT 2>&1
146 if test $RC != 0 ; then
147 echo "ldapsearch failed ($RC)!"
151 LDIF=$MODIFYOUTMASTER
153 echo "Filtering ldapsearch results..."
154 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
155 echo "Filtering original ldif used to create database..."
156 . $LDIFFILTER < $LDIF > $LDIFFLT
157 echo "Comparing filter output..."
158 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
160 if test $? != 0 ; then
161 echo "comparison failed - modify operations did not complete correctly"
165 echo ">>>>> Test succeeded"