4 echo "temporarily disabled"
7 echo "running defines.sh"
8 . $SRCDIR/scripts/defines.sh
10 mkdir $TESTDIR $DBDIR1 $DBDIR2 $DBDIR3 $DBDIR4 $DBDIR5 $DBDIR6
16 # - populate over ldap
17 # - perform some modifies and deleted
18 # - retrieve database over ldap and compare against expected results
21 echo "Starting master slapd on TCP/IP port $PORT1..."
22 . $CONFFILTER $BACKEND $MONITORDB < $SRMASTERCONF > $CONF1
23 $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
25 if test $WAIT != 0 ; then
31 echo "Using ldapsearch to check that master slapd (pid=$PID) is running..."
32 for i in 0 1 2 3 4 5; do
33 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
34 'objectclass=*' > /dev/null 2>&1
36 if test $RC = 0 ; then
39 echo "Waiting 5 seconds for slapd to start..."
43 if test $RC != 0 ; then
44 echo "ldapsearch failed ($RC)!"
45 test $KILLSERVERS != no && kill -HUP $KILLPIDS
49 echo "Using ldapadd to create the context prefix entry in the master..."
50 $LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD < \
51 $LDIFORDEREDCP > /dev/null 2>&1
53 if test $RC != 0 ; then
54 echo "ldapadd failed ($RC)!"
55 test $KILLSERVERS != no && kill -HUP $KILLPIDS
59 echo "Starting R1 slave slapd on TCP/IP port $PORT2..."
60 . $CONFFILTER $BACKEND $MONITORDB < $R1SRSLAVECONF > $CONF2
61 $SLAPD -f $CONF2 -h $URI2 -d $LVL $TIMING > $LOG2 2>&1 &
63 if test $WAIT != 0 ; then
64 echo SLAVE R1 PID $SLAVEPID
67 KILLPIDS="$KILLPIDS $SLAVEPID"
69 echo "Using ldapsearch to check that R1 slave slapd(pid=$SLAVEPID) is running..."
70 for i in 0 1 2 3 4 5; do
71 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT2 \
72 'objectclass=*' > /dev/null 2>&1
74 if test $RC = 0 ; then
77 echo "Waiting 5 seconds for R1 slapd to start..."
81 if test $RC != 0 ; then
82 echo "ldapsearch failed ($RC)!"
83 test $KILLSERVERS != no && kill -HUP $KILLPIDS
87 echo "Starting R2 slave slapd on TCP/IP port $PORT3..."
88 . $CONFFILTER $BACKEND $MONITORDB < $R2SRSLAVECONF > $CONF3
89 $SLAPD -f $CONF3 -h $URI3 -d $LVL $TIMING > $LOG3 2>&1 &
91 if test $WAIT != 0 ; then
92 echo SLAVE R2 PID $SLAVEPID
95 KILLPIDS="$KILLPIDS $SLAVEPID"
97 echo "Using ldapsearch to check that R2 slave slapd(pid=$SLAVEPID) is running..."
98 for i in 0 1 2 3 4 5; do
99 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT3 \
100 'objectclass=*' > /dev/null 2>&1
102 if test $RC = 0 ; then
105 echo "Waiting 5 seconds for R2 slave slapd to start..."
109 if test $RC != 0 ; then
110 echo "ldapsearch failed ($RC)!"
111 test $KILLSERVERS != no && kill -HUP $KILLPIDS
115 echo "Starting P1 slave slapd on TCP/IP port $PORT4..."
116 . $CONFFILTER $BACKEND $MONITORDB < $P1SRSLAVECONF > $CONF4
117 $SLAPD -f $CONF4 -h $URI4 -d $LVL $TIMING > $LOG4 2>&1 &
119 if test $WAIT != 0 ; then
120 echo SLAVE P1 PID $SLAVEPID
123 KILLPIDS="$KILLPIDS $SLAVEPID"
125 echo "Using ldapsearch to check that P1 slave slapd(pid=$SLAVEPID) is running..."
126 for i in 0 1 2 3 4 5; do
127 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT4 \
128 'objectclass=*' > /dev/null 2>&1
130 if test $RC = 0 ; then
133 echo "Waiting 5 seconds for P1 slave slapd to start..."
137 if test $RC != 0 ; then
138 echo "ldapsearch failed ($RC)!"
139 test $KILLSERVERS != no && kill -HUP $KILLPIDS
143 echo "Starting P2 slave slapd on TCP/IP port $PORT5..."
144 . $CONFFILTER $BACKEND $MONITORDB < $P2SRSLAVECONF > $CONF5
145 $SLAPD -f $CONF5 -h $URI5 -d $LVL $TIMING > $LOG5 2>&1 &
147 if test $WAIT != 0 ; then
148 echo SLAVE P2 PID $SLAVEPID
151 KILLPIDS="$KILLPIDS $SLAVEPID"
153 echo "Using ldapsearch to check that P2 slave slapd(pid=$SLAVEPID) is running..."
154 for i in 0 1 2 3 4 5; do
155 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT5 \
156 'objectclass=*' > /dev/null 2>&1
158 if test $RC = 0 ; then
161 echo "Waiting 5 seconds for P2 slave slapd to start..."
165 if test $RC != 0 ; then
166 echo "ldapsearch failed ($RC)!"
167 test $KILLSERVERS != no && kill -HUP $KILLPIDS
171 echo "Starting P3 slave slapd on TCP/IP port $PORT6..."
172 . $CONFFILTER $BACKEND $MONITORDB < $P3SRSLAVECONF > $CONF6
173 $SLAPD -f $CONF6 -h $URI6 -d $LVL $TIMING > $LOG6 2>&1 &
175 if test $WAIT != 0 ; then
176 echo SLAVE P3 PID $SLAVEPID
179 KILLPIDS="$KILLPIDS $SLAVEPID"
181 echo "Using ldapsearch to check that P3 slave slapd(pid=$SLAVEPID) is running..."
182 for i in 0 1 2 3 4 5; do
183 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT6 \
184 'objectclass=*' > /dev/null 2>&1
186 if test $RC = 0 ; then
189 echo "Waiting 5 seconds for P3 slave slapd to start..."
193 if test $RC != 0 ; then
194 echo "ldapsearch failed ($RC)!"
195 test $KILLSERVERS != no && kill -HUP $KILLPIDS
199 echo "Using ldapadd to populate the master directory..."
200 $LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD < \
201 $LDIFORDEREDNOCP > /dev/null 2>&1
203 if test $RC != 0 ; then
204 echo "ldapadd failed ($RC)!"
205 test $KILLSERVERS != no && kill -HUP $KILLPIDS
209 echo "Waiting 25 seconds for syncrepl to receive changes..."
212 echo "Using ldapmodify to modify master directory..."
215 # Do some modifications
218 $LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
219 $TESTOUT 2>&1 << EOMODS
220 dn: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US
231 dn: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
237 dn: cn=ITD Staff,ou=Groups,o=University of Michigan,c=US
240 uniquemember: cn=James A Jones 2, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
241 uniquemember: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
244 uniquemember: cn=Dorothy Stevens, ou=Alumni Association, ou=People, o=University of Michigan, c=US
245 uniquemember: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US
247 dn: cn=All Staff,ou=Groups,o=University of Michigan,c=US
251 dn: cn=Gern Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
253 objectclass: OpenLDAPperson
257 title: Chief Investigator, ITD
258 postaladdress: ITD $ 535 W. William St $ Ann Arbor, MI 48103
259 seealso: cn=All Staff, ou=Groups, o=University of Michigan, c=US
261 homepostaladdress: 844 Brown St. Apt. 4 $ Ann Arbor, MI 48104
262 description: Very odd
263 facsimiletelephonenumber: +1 313 555 7557
264 telephonenumber: +1 313 555 8343
265 mail: gjensen@mailgw.example.com
266 homephone: +1 313 555 8844
268 dn: ou=Retired, ou=People, o=University of Michigan, c=US
270 objectclass: organizationalUnit
273 dn: cn=Rosco P. Coltrane, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
275 objectclass: OpenLDAPperson
276 cn: Rosco P. Coltrane
280 dn: cn=Rosco P. Coltrane, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
282 newrdn: cn=Rosco P. Coltrane
284 newsuperior: ou=Retired, ou=People, o=University of Michigan, c=US
286 dn: cn=James A Jones 2, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
292 if test $RC != 0 ; then
293 echo "ldapmodify failed ($RC)!"
294 test $KILLSERVERS != no && kill -HUP $KILLPIDS
298 echo "Waiting 25 seconds for syncrepl to receive changes..."
301 echo "Using ldapsearch to read all the entries from the master..."
302 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
303 'objectclass=*' > $MASTEROUT 2>&1
306 if test $RC != 0 ; then
307 echo "ldapsearch failed at master ($RC)!"
308 test $KILLSERVERS != no && kill -HUP $KILLPIDS
312 echo "Using ldapsearch to read all the entries from the R1 slave..."
313 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT2 \
314 'objectclass=*' > $SERVER2OUT 2>&1
317 if test $RC != 0 ; then
318 echo "ldapsearch failed at R1 slave ($RC)!"
319 test $KILLSERVERS != no && kill -HUP $KILLPIDS
323 echo "Using ldapsearch to read all the entries from the R2 slave..."
324 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT3 \
325 'objectclass=*' > $SERVER3OUT 2>&1
328 if test $RC != 0 ; then
329 echo "ldapsearch failed at R2 slave ($RC)!"
330 test $KILLSERVERS != no && kill -HUP $KILLPIDS
334 echo "Using ldapsearch to read all the entries from the P1 slave..."
335 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT4 \
336 'objectclass=*' > $SERVER4OUT 2>&1
339 if test $RC != 0 ; then
340 echo "ldapsearch failed at P1 slave ($RC)!"
341 test $KILLSERVERS != no && kill -HUP $KILLPIDS
345 echo "Using ldapsearch to read all the entries from the P2 slave..."
346 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT5 \
347 'objectclass=*' > $SERVER5OUT 2>&1
350 if test $RC != 0 ; then
351 echo "ldapsearch failed at P2 slave ($RC)!"
352 test $KILLSERVERS != no && kill -HUP $KILLPIDS
356 echo "Using ldapsearch to read all the entries from the P3 slave..."
357 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT6 \
358 'objectclass=*' > $SERVER6OUT 2>&1
361 if test $RC != 0 ; then
362 echo "ldapsearch failed at P3 slave ($RC)!"
363 test $KILLSERVERS != no && kill -HUP $KILLPIDS
367 test $KILLSERVERS != no && kill -HUP $KILLPIDS
369 echo "Filtering master ldapsearch results..."
370 . $LDIFFILTER < $MASTEROUT > $MASTERFLT
371 echo "Filtering R1 slave ldapsearch results..."
372 . $LDIFFILTER < $SERVER2OUT > $SERVER2FLT
373 echo "Filtering R2 slave ldapsearch results..."
374 . $LDIFFILTER < $SERVER3OUT > $SERVER3FLT
375 echo "Filtering P1 slave ldapsearch results..."
376 . $LDIFFILTER < $SERVER4OUT > $SERVER4FLT
377 echo "Filtering P2 slave ldapsearch results..."
378 . $LDIFFILTER < $SERVER5OUT > $SERVER5FLT
379 echo "Filtering P3 slave ldapsearch results..."
380 . $LDIFFILTER < $SERVER6OUT > $SERVER6FLT
382 echo "Comparing retrieved entries from master and R1 slave..."
383 $CMP $MASTERFLT $SERVER2FLT > $CMPOUT
385 if test $? != 0 ; then
386 echo "test failed - master and R1 slave databases differ"
390 echo "Comparing retrieved entries from master and R2 slave..."
391 $CMP $MASTERFLT $SERVER3FLT > $CMPOUT
393 if test $? != 0 ; then
394 echo "test failed - master and R2 slave databases differ"
398 echo "Comparing retrieved entries from master and P1 slave..."
399 $CMP $MASTERFLT $SERVER4FLT > $CMPOUT
401 if test $? != 0 ; then
402 echo "test failed - master and P1 slave databases differ"
406 echo "Comparing retrieved entries from master and P2 slave..."
407 $CMP $MASTERFLT $SERVER5FLT > $CMPOUT
409 if test $? != 0 ; then
410 echo "test failed - master and P2 slave databases differ"
414 echo "Comparing retrieved entries from master and P3 slave..."
415 $CMP $MASTERFLT $SERVER6FLT > $CMPOUT
417 if test $? != 0 ; then
418 echo "test failed - master and P3 slave databases differ"
422 echo ">>>>> Test succeeded"