5 if test $# -ge 1 ; then
9 if test $# -ge 1 ; then
13 if test $# -ge 1 ; then
17 if test $# -ge 1 ; then
21 echo "running defines.sh"
22 . $SRCDIR/scripts/defines.sh
24 echo "running defines.sh $SRCDIR $BACKEND"
25 . $SRCDIR/scripts/defines.sh
27 echo "Cleaning up in $DBDIR..."
31 echo "Running slapadd to build slapd database..."
32 . $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
33 $SLAPADD -f $DBCONF -l $LDIFORDERED
35 if test $RC != 0 ; then
36 echo "slapadd failed ($RC)!"
40 echo "Starting slapd on TCP/IP port $PORT..."
41 $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
43 if test $WAIT != 0 ; then
48 echo "Testing slapd modify operations..."
49 for i in 0 1 2 3 4 5; do
50 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
51 'objectclass=*' > /dev/null 2>&1
53 if test $RC = 1 ; then
54 echo "Waiting 5 seconds for slapd to start..."
59 if test $RC != 0 ; then
60 echo "ldapsearch failed ($RC)!"
65 echo "Testing modify, add, and delete..."
66 $LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD > \
67 $TESTOUT 2>&1 << EOMODS
70 # LEADING COMMENT AND WHITE SPACE
72 dn: cn=James A Jones 1,ou=Alumni Association,ou=People,o=University of Michigan,c=US
78 dn: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,o=University of Michigan,c=US
83 description: The replaced multiLineDescription $ Blah Woof.
89 dn: cn=ITD Staff,ou=Groups,o=University of Michigan,c=US
91 member: cn=James A Jones 2,ou=Information Technology Division,ou=People,o=University of Michigan,c=US
92 member: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,o=University of Michigan,c=US
95 member: cn=Dorothy Stevens,ou=Alumni Association,ou=People,o=University of Michigan,c=US
96 member: cn=James A Jones 1,ou=Alumni Association,ou=People,o=University of Michigan,c=US
98 dn: cn=All Staff,ou=Groups,o=University of Michigan,c=US
103 member: cn=Dorothy Stevens,ou=Alumni Association,ou=People,o=University of Michigan,c=US
105 dn: cn=Gern Jensen,ou=Information Technology Division,ou=People,o=University of Michigan,c=US
109 objectclass: OpenLDAPperson
113 title: Chief Investigator, ITD
114 postaladdress: ITD $ 535 W. William St $ Ann Arbor, MI 48103
115 seealso: cn=All Staff,ou=Groups,o=University of Michigan,c=US
117 homepostaladdress: 844 Brown St. Apt. 4 $ Ann Arbor, MI 48104
118 description: Very odd
119 facsimiletelephonenumber: +1 313 555 7557
120 telephonenumber: +1 313 555 8343
121 mail: gjensen@mailgw.umich.edu
122 homephone: +1 313 555 8844
124 dn: cn=James A Jones 2,ou=Information Technology Division,ou=People,o=University of Michigan,c=US
126 # TRAILING COMMENT AND WHITE SPACE
131 if test $RC != 0 ; then
132 echo "ldapmodify failed ($RC)!"
137 echo "Using ldapsearch to retrieve all the entries..."
138 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
139 'objectClass=*' > $SEARCHOUT 2>&1
142 if test $RC != 0 ; then
143 echo "ldapsearch failed ($RC)!"
147 LDIF=$MODIFYOUTMASTER
149 echo "Filtering ldapsearch results..."
150 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
151 echo "Filtering original ldif used to create database..."
152 . $LDIFFILTER < $LDIF > $LDIFFLT
153 echo "Comparing filter output..."
154 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
156 if test $? != 0 ; then
157 echo "comparison failed - modify operations did not complete correctly"
161 echo ">>>>> Test succeeded"