9 # - perform some modifies and deleted
10 # - retrieve database over ldap and compare against expected results
22 . $SRCDIR/scripts/defines.sh $SRCDIR $BDB2
24 if test ! -x $SLURPD ; then
25 echo ">>>>> $SLURPD is not executable or do not exist."
26 echo ">>>>> Test skipped."
30 echo "Cleaning up in $DBDIR..."
32 echo "Cleaning up in $REPLDIR..."
35 echo "Starting master slapd on TCP/IP port $PORT..."
36 $SLAPD -f $MASTERCONF -p $PORT -d $LVL $TIMING > $MASTERLOG 2>&1 &
39 echo "Starting slave slapd on TCP/IP port $SLAVEPORT..."
40 $SLAPD -f $SLAVECONF -p $SLAVEPORT -d $LVL $TIMING > $SLAVELOG 2>&1 &
43 echo "Using ldapsearch to check that master slapd is running..."
44 for i in 0 1 2 3 4 5; do
45 $LDAPSEARCH -L -b "$BASEDN" -h localhost -p $PORT \
46 'cn=Monitor' > /dev/null 2>&1
49 echo "Waiting 5 seconds for slapd to start..."
54 echo "Using ldapsearch to check that slave slapd is running..."
55 for i in 0 1 2 3 4 5; do
56 $LDAPSEARCH -L -b "$BASEDN" -h localhost -p $SLAVEPORT \
57 'cn=Monitor' > /dev/null 2>&1
60 echo "Waiting 5 seconds for slapd to start..."
65 echo "Starting slurpd..."
66 $SLURPD -f $MASTERCONF -d 4 -t $REPLDIR > $SLURPLOG 2>&1 &
69 echo "Using ldapmodify to populate the database..."
70 $LDAPMODIFY -a -D "$MANAGERDN" -h localhost -p $PORT -w $PASSWD < \
71 $LDIFORDERED > /dev/null 2>&1
74 echo "ldapmodify failed!"
75 kill -HUP $PID $SLAVEPID $SLURPPID
79 echo "Using ldapmodify to modify the database..."
81 # Do some modifications
84 $LDAPMODIFY -v -D "$MANAGERDN" -h localhost -p $PORT -w $PASSWD > \
85 /dev/null 2>&1 << EOMODS
86 dn: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US
91 dn: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
93 replace: multilinedescription
94 multilinedescription: The replaced multiLineDescription $ Blah Woof.
100 dn: cn=ITD Staff,ou=Groups,o=University of Michigan,c=US
102 member: cn=James A Jones 2, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
103 member: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
106 member: cn=Dorothy Stevens, ou=Alumni Association, ou=People, o=University of Michigan, c=US
107 member: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US
109 dn: cn=All Staff,ou=Groups,o=University of Michigan,c=US
113 dn: cn=Gern Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
117 objectclass: organizationalPerson
118 objectclass: newPilotPerson
119 objectclass: umichPerson
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 krbname: gjensen@umich.edu
129 homepostaladdress: 844 Brown St. Apt. 4 $ Ann Arbor, MI 48104
130 multilinedescription: Very odd
131 facsimiletelephonenumber: +1 313 555 7557
132 telephonenumber: +1 313 555 8343
133 mail: gjensen@mailgw.umich.edu
134 homephone: +1 313 555 8844
136 dn: cn=James A Jones 2, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
141 echo "Waiting 15 seconds for slurpd to send changes..."
144 echo "Using ldapsearch to read all the entries from the master..."
145 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
146 'objectclass=*' > $MASTEROUT 2>&1
148 if [ $RC != 0 ]; then
149 echo "ldapsearch failed!"
150 kill -HUP $PID $SLAVEPID $SLURPPID
154 echo "Using ldapsearch to read all the entries from the slave..."
155 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $SLAVEPORT \
156 'objectclass=*' > $SLAVEOUT 2>&1
158 if [ $RC != 0 ]; then
159 echo "ldapsearch failed!"
160 kill -HUP $PID $SLAVEPID $SLURPPID
164 kill -HUP $PID $SLAVEPID $SLURPPID
166 echo "Comparing retrieved entries from master and slave..."
167 cmp $MASTEROUT $SLAVEOUT
169 echo "test failed - master and slave databases differ"
173 echo ">>>>> Test succeeded"