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 ldif2ldbm to build slapd database..."
20 $LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools
22 if test $RC != 0 ; then
23 echo "ldif2ldbm 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 -L -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
52 # LEADING COMMENT AND WHITE SPACE
54 dn: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US
60 dn: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
62 replace: multilinedescription
63 multilinedescription: The replaced multiLineDescription $ Blah Woof.
69 dn: cn=ITD Staff,ou=Groups,o=University of Michigan,c=US
71 member: cn=James A Jones 2, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
72 member: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
75 member: cn=Dorothy Stevens, ou=Alumni Association, ou=People, o=University of Michigan, c=US
76 member: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US
78 dn: cn=All Staff,ou=Groups,o=University of Michigan,c=US
82 dn: cn=Gern Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
86 objectclass: organizationalPerson
87 objectclass: newPilotPerson
88 objectclass: umichPerson
90 title: Chief Investigator, ITD
91 postaladdress: ITD $ 535 W. William St $ Ann Arbor, MI 48103
92 seealso: cn=All Staff, ou=Groups, o=University of Michigan, c=US
94 krbname: gjensen@umich.edu
98 homepostaladdress: 844 Brown St. Apt. 4 $ Ann Arbor, MI 48104
99 multilinedescription: Very odd
100 facsimiletelephonenumber: +1 313 555 7557
101 telephonenumber: +1 313 555 8343
102 mail: gjensen@mailgw.umich.edu
103 homephone: +1 313 555 8844
105 dn: cn=James A Jones 2, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
107 # TRAILING COMMENT AND WHITE SPACE
112 if test $RC != 0 ; then
113 echo "ldapmodify failed!"
118 echo "Using ldapsearch to retrieve all the entries..."
119 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
120 'objectClass=*' > $SEARCHOUT 2>&1
123 if test $RC != 0 ; then
124 echo "ldapsearch failed!"
128 LDIF=$MODIFYOUTMASTER
130 echo "Filtering ldapsearch results..."
131 . $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT
132 echo "Filtering original ldif used to create database..."
133 . $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT
134 echo "Comparing filter output..."
135 cmp $SEARCHFLT $LDIFFLT
137 if test $? != 0 ; then
138 echo "comparison failed - modify operations did not complete correctly"
142 echo ">>>>> Test succeeded"