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 "running defines.sh $SRCDIR $BACKEND"
21 . $SRCDIR/scripts/defines.sh
23 echo "Cleaning up in $DBDIR..."
27 echo "Running slapadd to build slapd database..."
28 . $CONFFILTER $BACKEND < $CONF > $DBCONF
29 $SLAPADD -f $DBCONF -l $LDIFORDERED
31 if test $RC != 0 ; then
32 echo "slapadd failed ($RC)!"
36 echo "Starting slapd on TCP/IP port $PORT..."
37 $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
39 if test $WAIT != 0 ; then
44 echo "Testing slapd modify operations..."
45 for i in 0 1 2 3 4 5; do
46 $LDAPSEARCH -s base -b "$MONITOR" -h localhost -p $PORT \
47 'objectclass=*' > /dev/null 2>&1
49 if test $RC = 1 ; then
50 echo "Waiting 5 seconds for slapd to start..."
55 if test $RC != 0 ; then
56 echo "ldapsearch failed ($RC)!"
61 echo "Testing modify, add, and delete..."
62 $LDAPMODIFY -v -D "$MANAGERDN" -h localhost -p $PORT -w $PASSWD > \
63 $TESTOUT 2>&1 << EOMODS
66 # LEADING COMMENT AND WHITE SPACE
68 dn: cn=James A Jones 1,ou=Alumni Association,ou=People,o=University of Michigan,c=US
74 dn: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,o=University of Michigan,c=US
79 description: The replaced multiLineDescription $ Blah Woof.
85 dn: cn=ITD Staff,ou=Groups,o=University of Michigan,c=US
87 member: cn=James A Jones 2,ou=Information Technology Division,ou=People,o=University of Michigan,c=US
88 member: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,o=University of Michigan,c=US
91 member: cn=Dorothy Stevens,ou=Alumni Association,ou=People,o=University of Michigan,c=US
92 member: cn=James A Jones 1,ou=Alumni Association,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
101 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.umich.edu
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
127 if test $RC != 0 ; then
128 echo "ldapmodify failed ($RC)!"
133 echo "Using ldapsearch to retrieve all the entries..."
134 $LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $PORT \
135 'objectClass=*' > $SEARCHOUT 2>&1
138 if test $RC != 0 ; then
139 echo "ldapsearch failed ($RC)!"
143 LDIF=$MODIFYOUTMASTER
145 echo "Filtering ldapsearch results..."
146 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
147 echo "Filtering original ldif used to create database..."
148 . $LDIFFILTER < $LDIF > $LDIFFLT
149 echo "Comparing filter output..."
150 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
152 if test $? != 0 ; then
153 echo "comparison failed - modify operations did not complete correctly"
157 echo ">>>>> Test succeeded"