5 if test $# -ge 1 ; then
9 . $SRCDIR/scripts/args.sh $*
11 echo "running defines.sh"
12 . $SRCDIR/scripts/defines.sh
14 echo "running defines.sh $SRCDIR $BACKEND"
15 . $SRCDIR/scripts/defines.sh
17 echo "Cleaning up in $DBDIR..."
21 echo "Running slapadd to build slapd database..."
22 . $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
23 $SLAPADD -f $DBCONF -l $LDIFORDERED
25 if test $RC != 0 ; then
26 echo "slapadd failed ($RC)!"
30 echo "Starting slapd on TCP/IP port $PORT..."
31 $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
33 if test $WAIT != 0 ; then
38 echo "Testing slapd modify operations..."
39 for i in 0 1 2 3 4 5; do
40 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
41 'objectclass=*' > /dev/null 2>&1
43 if test $RC = 0 ; then
46 echo "Waiting 5 seconds for slapd to start..."
50 if test $RC != 0 ; then
51 echo "ldapsearch failed ($RC)!"
56 echo "Testing modify, add, and delete..."
57 $LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD > \
58 $TESTOUT 2>&1 << EOMODS
61 # LEADING COMMENT AND WHITE SPACE
63 dn: cn=James A Jones 1,ou=Alumni Association,ou=People,o=University of Michigan,c=US
81 dn: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,o=University of Michigan,c=US
86 description: The replaced multiLineDescription $ Blah Woof.
92 dn: cn=ITD Staff,ou=Groups,o=University of Michigan,c=US
95 uniquemember: cn=James A Jones 2,ou=Information Technology Division,
96 ou=People,o=University of Michigan,c=US
97 uniquemember: cn=Bjorn Jensen,ou=Information Technology Division,
98 ou=People,o=University of Michigan,c=US
101 uniquemember: cn=Dorothy Stevens,ou=Alumni Association,
102 ou=People,o=University of Michigan,c=US
103 uniquemember: cn=James A Jones 1,ou=Alumni Association,
104 ou=People,o=University of Michigan,c=US
106 dn: cn=All Staff,ou=Groups,o=University of Michigan,c=US
111 member: cn=Dorothy Stevens,ou=Alumni Association,ou=People,o=University of Michigan,c=US
115 dn: cn=Gern Jensen,ou=Information Technology Division,ou=People,o=University of Michigan,c=US
117 objectclass: OpenLDAPperson
121 title: Chief Investigator, ITD
122 postaladdress: ITD $ 535 W. William St $ Ann Arbor, MI 48103
123 seealso: cn=All Staff,ou=Groups,o=University of Michigan,c=US
125 homepostaladdress: 844 Brown St. Apt. 4 $ Ann Arbor, MI 48104
126 description: Very odd
127 facsimiletelephonenumber: +1 313 555 7557
128 telephonenumber: +1 313 555 8343
129 mail: gjensen@mailgw.example.com
130 homephone: +1 313 555 8844
132 dn: cn=James A Jones 2,ou=Information Technology Division,ou=People,o=University of Michigan,c=US
134 # TRAILING COMMENT AND WHITE SPACE
136 dn: ou=People,o=University of Michigan,c=US
147 if test $RC != 0 ; then
148 echo "ldapmodify failed ($RC)!"
153 echo "Using ldapsearch to retrieve all the entries..."
154 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
155 'objectClass=*' > $SEARCHOUT 2>&1
158 if test $RC != 0 ; then
159 echo "ldapsearch failed ($RC)!"
163 LDIF=$MODIFYOUTMASTER
165 echo "Filtering ldapsearch results..."
166 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
167 echo "Filtering original ldif used to create database..."
168 . $LDIFFILTER < $LDIF > $LDIFFLT
169 echo "Comparing filter output..."
170 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
172 if test $? != 0 ; then
173 echo "comparison failed - modify operations did not complete correctly"
177 echo ">>>>> Test succeeded"