3 if test $# -eq 0 ; then
8 if test $# -eq 1 ; then
12 echo "running defines.sh $SRCDIR $BACKEND"
13 . $SRCDIR/scripts/defines.sh
15 echo "Cleaning up in $DBDIR..."
19 echo "Running slapadd to build slapd database..."
20 $LDIF2LDBM -f $CONF -l $LDIF
22 if test $RC != 0 ; then
23 echo "slapadd failed!"
27 echo "Starting slapd on TCP/IP port $PORT..."
28 $SLAPD -f $CONF -p $PORT -d $LVL $TIMING > $MASTERLOG 2>&1 &
31 echo "Testing slapd modify operations..."
32 for i in 0 1 2 3 4 5; do
33 $LDAPSEARCH -s base -b "$MONITOR" -h localhost -p $PORT \
34 'objectclass=*' > /dev/null 2>&1
36 if test $RC = 1 ; then
37 echo "Waiting 5 seconds for slapd to start..."
42 if test $RC != 0 ; then
43 echo "ldapsearch failed!"
48 echo "Testing modify, add, and delete..."
49 $LDAPMODIFY -v -D "$MANAGERDN" -h localhost -p $PORT -w $PASSWD > \
50 $TESTOUT 2>&1 << EOMODS
53 # LEADING COMMENT AND WHITE SPACE
55 dn: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US
61 dn: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
65 replace: multilinedescription
66 multilinedescription: The replaced multiLineDescription $ Blah Woof.
72 dn: cn=ITD Staff,ou=Groups,o=University of Michigan,c=US
74 member: cn=James A Jones 2, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
75 member: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
78 member: cn=Dorothy Stevens, ou=Alumni Association, ou=People, o=University of Michigan, c=US
79 member: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US
81 dn: cn=All Staff,ou=Groups,o=University of Michigan,c=US
85 dn: cn=Gern Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
89 objectclass: organizationalPerson
90 objectclass: newPilotPerson
91 objectclass: umichPerson
93 title: Chief Investigator, ITD
94 postaladdress: ITD $ 535 W. William St $ Ann Arbor, MI 48103
95 seealso: cn=All Staff, ou=Groups, o=University of Michigan, c=US
97 krbname: gjensen@umich.edu
101 homepostaladdress: 844 Brown St. Apt. 4 $ Ann Arbor, MI 48104
102 multilinedescription: Very odd
103 facsimiletelephonenumber: +1 313 555 7557
104 telephonenumber: +1 313 555 8343
105 mail: gjensen@mailgw.umich.edu
106 homephone: +1 313 555 8844
108 dn: cn=James A Jones 2, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
110 # TRAILING COMMENT AND WHITE SPACE
115 if test $RC != 0 ; then
116 echo "ldapmodify failed!"
121 echo "Using ldapsearch to retrieve all the entries..."
122 $LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $PORT \
123 'objectClass=*' > $SEARCHOUT 2>&1
126 if test $RC != 0 ; then
127 echo "ldapsearch failed!"
131 LDIF=$MODIFYOUTMASTER
133 echo "Filtering ldapsearch results..."
134 . $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT
135 echo "Filtering original ldif used to create database..."
136 . $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT
137 echo "Comparing filter output..."
138 cmp $SEARCHFLT $LDIFFLT
140 if test $? != 0 ; then
141 echo "comparison failed - modify operations did not complete correctly"
145 echo ">>>>> Test succeeded"