test018-syncreplication-persist revision 1.1.1.1.6.2 1 1.1.1.1.6.2 wrstuden #! /bin/sh
2 1.1.1.1.6.2 wrstuden # $OpenLDAP: pkg/ldap/tests/scripts/test018-syncreplication-persist,v 1.38.2.3 2008/02/11 23:26:51 kurt Exp $
3 1.1.1.1.6.2 wrstuden ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
4 1.1.1.1.6.2 wrstuden ##
5 1.1.1.1.6.2 wrstuden ## Copyright 1998-2008 The OpenLDAP Foundation.
6 1.1.1.1.6.2 wrstuden ## All rights reserved.
7 1.1.1.1.6.2 wrstuden ##
8 1.1.1.1.6.2 wrstuden ## Redistribution and use in source and binary forms, with or without
9 1.1.1.1.6.2 wrstuden ## modification, are permitted only as authorized by the OpenLDAP
10 1.1.1.1.6.2 wrstuden ## Public License.
11 1.1.1.1.6.2 wrstuden ##
12 1.1.1.1.6.2 wrstuden ## A copy of this license is available in the file LICENSE in the
13 1.1.1.1.6.2 wrstuden ## top-level directory of the distribution or, alternatively, at
14 1.1.1.1.6.2 wrstuden ## <http://www.OpenLDAP.org/license.html>.
15 1.1.1.1.6.2 wrstuden
16 1.1.1.1.6.2 wrstuden if test "$BACKEND" != "bdb" && test "$BACKEND" != "hdb" ; then
17 1.1.1.1.6.2 wrstuden echo "Test does not support $BACKEND"
18 1.1.1.1.6.2 wrstuden exit 0
19 1.1.1.1.6.2 wrstuden fi
20 1.1.1.1.6.2 wrstuden
21 1.1.1.1.6.2 wrstuden echo "running defines.sh"
22 1.1.1.1.6.2 wrstuden . $SRCDIR/scripts/defines.sh
23 1.1.1.1.6.2 wrstuden
24 1.1.1.1.6.2 wrstuden if test $SYNCPROV = syncprovno; then
25 1.1.1.1.6.2 wrstuden echo "Syncrepl provider overlay not available, test skipped"
26 1.1.1.1.6.2 wrstuden exit 0
27 1.1.1.1.6.2 wrstuden fi
28 1.1.1.1.6.2 wrstuden
29 1.1.1.1.6.2 wrstuden mkdir -p $TESTDIR $DBDIR1 $DBDIR4
30 1.1.1.1.6.2 wrstuden
31 1.1.1.1.6.2 wrstuden #
32 1.1.1.1.6.2 wrstuden # Test replication:
33 1.1.1.1.6.2 wrstuden # - start producer
34 1.1.1.1.6.2 wrstuden # - start consumer
35 1.1.1.1.6.2 wrstuden # - populate over ldap
36 1.1.1.1.6.2 wrstuden # - perform some modifies and deleted
37 1.1.1.1.6.2 wrstuden # - attempt to modify the consumer (referral or chain)
38 1.1.1.1.6.2 wrstuden # - retrieve database over ldap and compare against expected results
39 1.1.1.1.6.2 wrstuden #
40 1.1.1.1.6.2 wrstuden
41 1.1.1.1.6.2 wrstuden echo "Starting producer slapd on TCP/IP port $PORT1..."
42 1.1.1.1.6.2 wrstuden . $CONFFILTER $BACKEND $MONITORDB < $SRMASTERCONF > $CONF1
43 1.1.1.1.6.2 wrstuden $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
44 1.1.1.1.6.2 wrstuden PID=$!
45 1.1.1.1.6.2 wrstuden if test $WAIT != 0 ; then
46 1.1.1.1.6.2 wrstuden echo PID $PID
47 1.1.1.1.6.2 wrstuden read foo
48 1.1.1.1.6.2 wrstuden fi
49 1.1.1.1.6.2 wrstuden KILLPIDS="$PID"
50 1.1.1.1.6.2 wrstuden
51 1.1.1.1.6.2 wrstuden sleep 1
52 1.1.1.1.6.2 wrstuden
53 1.1.1.1.6.2 wrstuden echo "Using ldapsearch to check that producer slapd is running..."
54 1.1.1.1.6.2 wrstuden for i in 0 1 2 3 4 5; do
55 1.1.1.1.6.2 wrstuden $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
56 1.1.1.1.6.2 wrstuden 'objectclass=*' > /dev/null 2>&1
57 1.1.1.1.6.2 wrstuden RC=$?
58 1.1.1.1.6.2 wrstuden if test $RC = 0 ; then
59 1.1.1.1.6.2 wrstuden break
60 1.1.1.1.6.2 wrstuden fi
61 1.1.1.1.6.2 wrstuden echo "Waiting 5 seconds for slapd to start..."
62 1.1.1.1.6.2 wrstuden sleep 5
63 1.1.1.1.6.2 wrstuden done
64 1.1.1.1.6.2 wrstuden
65 1.1.1.1.6.2 wrstuden if test $RC != 0 ; then
66 1.1.1.1.6.2 wrstuden echo "ldapsearch failed ($RC)!"
67 1.1.1.1.6.2 wrstuden test $KILLSERVERS != no && kill -HUP $KILLPIDS
68 1.1.1.1.6.2 wrstuden exit $RC
69 1.1.1.1.6.2 wrstuden fi
70 1.1.1.1.6.2 wrstuden
71 1.1.1.1.6.2 wrstuden echo "Using ldapadd to create the context prefix entry in the producer..."
72 1.1.1.1.6.2 wrstuden $LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD < \
73 1.1.1.1.6.2 wrstuden $LDIFORDEREDCP > /dev/null 2>&1
74 1.1.1.1.6.2 wrstuden RC=$?
75 1.1.1.1.6.2 wrstuden if test $RC != 0 ; then
76 1.1.1.1.6.2 wrstuden echo "ldapadd failed ($RC)!"
77 1.1.1.1.6.2 wrstuden test $KILLSERVERS != no && kill -HUP $KILLPIDS
78 1.1.1.1.6.2 wrstuden exit $RC
79 1.1.1.1.6.2 wrstuden fi
80 1.1.1.1.6.2 wrstuden
81 1.1.1.1.6.2 wrstuden echo "Starting consumer slapd on TCP/IP port $PORT4..."
82 1.1.1.1.6.2 wrstuden . $CONFFILTER $BACKEND $MONITORDB < $P1SRSLAVECONF > $CONF4
83 1.1.1.1.6.2 wrstuden $SLAPD -f $CONF4 -h $URI4 -d $LVL $TIMING > $LOG4 2>&1 &
84 1.1.1.1.6.2 wrstuden SLAVEPID=$!
85 1.1.1.1.6.2 wrstuden if test $WAIT != 0 ; then
86 1.1.1.1.6.2 wrstuden echo SLAVEPID $SLAVEPID
87 1.1.1.1.6.2 wrstuden read foo
88 1.1.1.1.6.2 wrstuden fi
89 1.1.1.1.6.2 wrstuden KILLPIDS="$KILLPIDS $SLAVEPID"
90 1.1.1.1.6.2 wrstuden
91 1.1.1.1.6.2 wrstuden sleep 1
92 1.1.1.1.6.2 wrstuden
93 1.1.1.1.6.2 wrstuden echo "Using ldapsearch to check that consumer slapd is running..."
94 1.1.1.1.6.2 wrstuden for i in 0 1 2 3 4 5; do
95 1.1.1.1.6.2 wrstuden $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT4 \
96 1.1.1.1.6.2 wrstuden 'objectclass=*' > /dev/null 2>&1
97 1.1.1.1.6.2 wrstuden RC=$?
98 1.1.1.1.6.2 wrstuden if test $RC = 0 ; then
99 1.1.1.1.6.2 wrstuden break
100 1.1.1.1.6.2 wrstuden fi
101 1.1.1.1.6.2 wrstuden echo "Waiting 5 seconds for slapd to start..."
102 1.1.1.1.6.2 wrstuden sleep 5
103 1.1.1.1.6.2 wrstuden done
104 1.1.1.1.6.2 wrstuden
105 1.1.1.1.6.2 wrstuden if test $RC != 0 ; then
106 1.1.1.1.6.2 wrstuden echo "ldapsearch failed ($RC)!"
107 1.1.1.1.6.2 wrstuden test $KILLSERVERS != no && kill -HUP $KILLPIDS
108 1.1.1.1.6.2 wrstuden exit $RC
109 1.1.1.1.6.2 wrstuden fi
110 1.1.1.1.6.2 wrstuden
111 1.1.1.1.6.2 wrstuden echo "Using ldapadd to populate the producer directory..."
112 1.1.1.1.6.2 wrstuden $LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD < \
113 1.1.1.1.6.2 wrstuden $LDIFORDEREDNOCP > /dev/null 2>&1
114 1.1.1.1.6.2 wrstuden RC=$?
115 1.1.1.1.6.2 wrstuden if test $RC != 0 ; then
116 1.1.1.1.6.2 wrstuden echo "ldapadd failed ($RC)!"
117 1.1.1.1.6.2 wrstuden test $KILLSERVERS != no && kill -HUP $KILLPIDS
118 1.1.1.1.6.2 wrstuden exit $RC
119 1.1.1.1.6.2 wrstuden fi
120 1.1.1.1.6.2 wrstuden
121 1.1.1.1.6.2 wrstuden echo "Waiting 15 seconds for syncrepl to receive changes..."
122 1.1.1.1.6.2 wrstuden sleep 15
123 1.1.1.1.6.2 wrstuden
124 1.1.1.1.6.2 wrstuden echo "Stopping the provider, sleeping 10 seconds and restarting it..."
125 1.1.1.1.6.2 wrstuden kill -HUP "$PID"
126 1.1.1.1.6.2 wrstuden wait $PID
127 1.1.1.1.6.2 wrstuden sleep 10
128 1.1.1.1.6.2 wrstuden echo "RESTART" >> $LOG1
129 1.1.1.1.6.2 wrstuden $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING >> $LOG1 2>&1 &
130 1.1.1.1.6.2 wrstuden PID=$!
131 1.1.1.1.6.2 wrstuden if test $WAIT != 0 ; then
132 1.1.1.1.6.2 wrstuden echo PID $PID
133 1.1.1.1.6.2 wrstuden read foo
134 1.1.1.1.6.2 wrstuden fi
135 1.1.1.1.6.2 wrstuden KILLPIDS="$PID $SLAVEPID"
136 1.1.1.1.6.2 wrstuden
137 1.1.1.1.6.2 wrstuden sleep 1
138 1.1.1.1.6.2 wrstuden
139 1.1.1.1.6.2 wrstuden echo "Using ldapsearch to check that producer slapd is running..."
140 1.1.1.1.6.2 wrstuden for i in 0 1 2 3 4 5; do
141 1.1.1.1.6.2 wrstuden $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
142 1.1.1.1.6.2 wrstuden 'objectclass=*' > /dev/null 2>&1
143 1.1.1.1.6.2 wrstuden RC=$?
144 1.1.1.1.6.2 wrstuden if test $RC = 0 ; then
145 1.1.1.1.6.2 wrstuden break
146 1.1.1.1.6.2 wrstuden fi
147 1.1.1.1.6.2 wrstuden echo "Waiting 5 seconds for slapd to start..."
148 1.1.1.1.6.2 wrstuden sleep 5
149 1.1.1.1.6.2 wrstuden done
150 1.1.1.1.6.2 wrstuden
151 1.1.1.1.6.2 wrstuden if test $RC != 0 ; then
152 1.1.1.1.6.2 wrstuden echo "ldapsearch failed ($RC)!"
153 1.1.1.1.6.2 wrstuden test $KILLSERVERS != no && kill -HUP $KILLPIDS
154 1.1.1.1.6.2 wrstuden exit $RC
155 1.1.1.1.6.2 wrstuden fi
156 1.1.1.1.6.2 wrstuden
157 1.1.1.1.6.2 wrstuden echo "Using ldapmodify to modify producer directory..."
158 1.1.1.1.6.2 wrstuden
159 1.1.1.1.6.2 wrstuden #
160 1.1.1.1.6.2 wrstuden # Do some modifications
161 1.1.1.1.6.2 wrstuden #
162 1.1.1.1.6.2 wrstuden
163 1.1.1.1.6.2 wrstuden $LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
164 1.1.1.1.6.2 wrstuden $TESTOUT 2>&1 << EOMODS
165 1.1.1.1.6.2 wrstuden dn: cn=James A Jones 1, ou=Alumni Association, ou=People, dc=example,dc=com
166 1.1.1.1.6.2 wrstuden changetype: modify
167 1.1.1.1.6.2 wrstuden add: drink
168 1.1.1.1.6.2 wrstuden drink: Orange Juice
169 1.1.1.1.6.2 wrstuden -
170 1.1.1.1.6.2 wrstuden delete: sn
171 1.1.1.1.6.2 wrstuden sn: Jones
172 1.1.1.1.6.2 wrstuden -
173 1.1.1.1.6.2 wrstuden add: sn
174 1.1.1.1.6.2 wrstuden sn: Jones
175 1.1.1.1.6.2 wrstuden
176 1.1.1.1.6.2 wrstuden dn: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, dc=example,dc=com
177 1.1.1.1.6.2 wrstuden changetype: modify
178 1.1.1.1.6.2 wrstuden replace: drink
179 1.1.1.1.6.2 wrstuden drink: Iced Tea
180 1.1.1.1.6.2 wrstuden
181 1.1.1.1.6.2 wrstuden dn: cn=ITD Staff,ou=Groups,dc=example,dc=com
182 1.1.1.1.6.2 wrstuden changetype: modify
183 1.1.1.1.6.2 wrstuden delete: uniquemember
184 1.1.1.1.6.2 wrstuden uniquemember: cn=James A Jones 2, ou=Information Technology Division, ou=People, dc=example,dc=com
185 1.1.1.1.6.2 wrstuden uniquemember: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, dc=example,dc=com
186 1.1.1.1.6.2 wrstuden -
187 1.1.1.1.6.2 wrstuden add: uniquemember
188 1.1.1.1.6.2 wrstuden uniquemember: cn=Dorothy Stevens, ou=Alumni Association, ou=People, dc=example,dc=com
189 1.1.1.1.6.2 wrstuden uniquemember: cn=James A Jones 1, ou=Alumni Association, ou=People, dc=example,dc=com
190 1.1.1.1.6.2 wrstuden
191 1.1.1.1.6.2 wrstuden dn: cn=All Staff,ou=Groups,dc=example,dc=com
192 1.1.1.1.6.2 wrstuden changetype: modify
193 1.1.1.1.6.2 wrstuden delete: description
194 1.1.1.1.6.2 wrstuden
195 1.1.1.1.6.2 wrstuden dn: cn=Gern Jensen, ou=Information Technology Division, ou=People, dc=example,dc=com
196 1.1.1.1.6.2 wrstuden changetype: add
197 1.1.1.1.6.2 wrstuden objectclass: OpenLDAPperson
198 1.1.1.1.6.2 wrstuden cn: Gern Jensen
199 1.1.1.1.6.2 wrstuden sn: Jensen
200 1.1.1.1.6.2 wrstuden uid: gjensen
201 1.1.1.1.6.2 wrstuden title: Chief Investigator, ITD
202 1.1.1.1.6.2 wrstuden postaladdress: ITD $ 535 W. William St $ Ann Arbor, MI 48103
203 1.1.1.1.6.2 wrstuden seealso: cn=All Staff, ou=Groups, dc=example,dc=com
204 1.1.1.1.6.2 wrstuden drink: Coffee
205 1.1.1.1.6.2 wrstuden homepostaladdress: 844 Brown St. Apt. 4 $ Ann Arbor, MI 48104
206 1.1.1.1.6.2 wrstuden description: Very odd
207 1.1.1.1.6.2 wrstuden facsimiletelephonenumber: +1 313 555 7557
208 1.1.1.1.6.2 wrstuden telephonenumber: +1 313 555 8343
209 1.1.1.1.6.2 wrstuden mail: gjensen@mailgw.example.com
210 1.1.1.1.6.2 wrstuden homephone: +1 313 555 8844
211 1.1.1.1.6.2 wrstuden
212 1.1.1.1.6.2 wrstuden dn: ou=Retired, ou=People, dc=example,dc=com
213 1.1.1.1.6.2 wrstuden changetype: add
214 1.1.1.1.6.2 wrstuden objectclass: organizationalUnit
215 1.1.1.1.6.2 wrstuden ou: Retired
216 1.1.1.1.6.2 wrstuden
217 1.1.1.1.6.2 wrstuden dn: cn=Rosco P. Coltrane, ou=Information Technology Division, ou=People, dc=example,dc=com
218 1.1.1.1.6.2 wrstuden changetype: add
219 1.1.1.1.6.2 wrstuden objectclass: OpenLDAPperson
220 1.1.1.1.6.2 wrstuden cn: Rosco P. Coltrane
221 1.1.1.1.6.2 wrstuden sn: Coltrane
222 1.1.1.1.6.2 wrstuden uid: rosco
223 1.1.1.1.6.2 wrstuden description: Fat tycoon
224 1.1.1.1.6.2 wrstuden
225 1.1.1.1.6.2 wrstuden dn: cn=Rosco P. Coltrane, ou=Information Technology Division, ou=People, dc=example,dc=com
226 1.1.1.1.6.2 wrstuden changetype: modrdn
227 1.1.1.1.6.2 wrstuden newrdn: cn=Rosco P. Coltrane
228 1.1.1.1.6.2 wrstuden deleteoldrdn: 1
229 1.1.1.1.6.2 wrstuden newsuperior: ou=Retired, ou=People, dc=example,dc=com
230 1.1.1.1.6.2 wrstuden
231 1.1.1.1.6.2 wrstuden dn: cn=James A Jones 2, ou=Information Technology Division, ou=People, dc=example,dc=com
232 1.1.1.1.6.2 wrstuden changetype: delete
233 1.1.1.1.6.2 wrstuden
234 1.1.1.1.6.2 wrstuden EOMODS
235 1.1.1.1.6.2 wrstuden
236 1.1.1.1.6.2 wrstuden RC=$?
237 1.1.1.1.6.2 wrstuden if test $RC != 0 ; then
238 1.1.1.1.6.2 wrstuden echo "ldapmodify failed ($RC)!"
239 1.1.1.1.6.2 wrstuden test $KILLSERVERS != no && kill -HUP $KILLPIDS
240 1.1.1.1.6.2 wrstuden exit $RC
241 1.1.1.1.6.2 wrstuden fi
242 1.1.1.1.6.2 wrstuden
243 1.1.1.1.6.2 wrstuden echo "Using ldappasswd to change some passwords..."
244 1.1.1.1.6.2 wrstuden $LDAPPASSWD -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD \
245 1.1.1.1.6.2 wrstuden 'cn=Bjorn Jensen,ou=Information Technology Division,ou=People,dc=example,dc=com' \
246 1.1.1.1.6.2 wrstuden > $TESTOUT 2>&1
247 1.1.1.1.6.2 wrstuden RC=$?
248 1.1.1.1.6.2 wrstuden if test $RC != 0 ; then
249 1.1.1.1.6.2 wrstuden echo "ldapmodify failed ($RC)!"
250 1.1.1.1.6.2 wrstuden test $KILLSERVERS != no && kill -HUP $KILLPIDS
251 1.1.1.1.6.2 wrstuden exit $RC
252 1.1.1.1.6.2 wrstuden fi
253 1.1.1.1.6.2 wrstuden
254 1.1.1.1.6.2 wrstuden echo "Waiting 15 seconds for syncrepl to receive changes..."
255 1.1.1.1.6.2 wrstuden sleep 15
256 1.1.1.1.6.2 wrstuden
257 1.1.1.1.6.2 wrstuden echo "Stopping consumer to test recovery..."
258 1.1.1.1.6.2 wrstuden kill -HUP $SLAVEPID
259 1.1.1.1.6.2 wrstuden wait $SLAVEPID
260 1.1.1.1.6.2 wrstuden
261 1.1.1.1.6.2 wrstuden echo "Modifying more entries on the producer..."
262 1.1.1.1.6.2 wrstuden $LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD >> \
263 1.1.1.1.6.2 wrstuden $TESTOUT 2>&1 << EOMODS
264 1.1.1.1.6.2 wrstuden dn: cn=Rosco P. Coltrane, ou=Retired, ou=People, dc=example,dc=com
265 1.1.1.1.6.2 wrstuden changetype: delete
266 1.1.1.1.6.2 wrstuden
267 1.1.1.1.6.2 wrstuden dn: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, dc=example,dc=com
268 1.1.1.1.6.2 wrstuden changetype: modify
269 1.1.1.1.6.2 wrstuden add: drink
270 1.1.1.1.6.2 wrstuden drink: Mad Dog 20/20
271 1.1.1.1.6.2 wrstuden
272 1.1.1.1.6.2 wrstuden dn: cn=Rosco P. Coltrane, ou=Retired, ou=People, dc=example,dc=com
273 1.1.1.1.6.2 wrstuden changetype: add
274 1.1.1.1.6.2 wrstuden objectclass: OpenLDAPperson
275 1.1.1.1.6.2 wrstuden sn: Coltrane
276 1.1.1.1.6.2 wrstuden uid: rosco
277 1.1.1.1.6.2 wrstuden cn: Rosco P. Coltrane
278 1.1.1.1.6.2 wrstuden
279 1.1.1.1.6.2 wrstuden EOMODS
280 1.1.1.1.6.2 wrstuden
281 1.1.1.1.6.2 wrstuden echo "Restarting consumer..."
282 1.1.1.1.6.2 wrstuden echo "RESTART" >> $LOG4
283 1.1.1.1.6.2 wrstuden $SLAPD -f $CONF4 -h $URI4 -d $LVL $TIMING >> $LOG4 2>&1 &
284 1.1.1.1.6.2 wrstuden SLAVEPID=$!
285 1.1.1.1.6.2 wrstuden if test $WAIT != 0 ; then
286 1.1.1.1.6.2 wrstuden echo SLAVEPID $SLAVEPID
287 1.1.1.1.6.2 wrstuden read foo
288 1.1.1.1.6.2 wrstuden fi
289 1.1.1.1.6.2 wrstuden KILLPIDS="$PID $SLAVEPID"
290 1.1.1.1.6.2 wrstuden
291 1.1.1.1.6.2 wrstuden echo "Waiting 25 seconds for syncrepl to receive changes..."
292 1.1.1.1.6.2 wrstuden sleep 25
293 1.1.1.1.6.2 wrstuden
294 1.1.1.1.6.2 wrstuden if test ! $BACKLDAP = "ldapno" ; then
295 1.1.1.1.6.2 wrstuden echo "Try updating the consumer slapd..."
296 1.1.1.1.6.2 wrstuden $LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT4 -w $PASSWD > \
297 1.1.1.1.6.2 wrstuden $TESTOUT 2>&1 << EOMODS
298 1.1.1.1.6.2 wrstuden dn: cn=James A Jones 1, ou=Alumni Association, ou=People, dc=example, dc=com
299 1.1.1.1.6.2 wrstuden changetype: modify
300 1.1.1.1.6.2 wrstuden add: description
301 1.1.1.1.6.2 wrstuden description: This write must fail because directed to a shadow context,
302 1.1.1.1.6.2 wrstuden description: unless the chain overlay is configured appropriately ;)
303 1.1.1.1.6.2 wrstuden
304 1.1.1.1.6.2 wrstuden EOMODS
305 1.1.1.1.6.2 wrstuden
306 1.1.1.1.6.2 wrstuden RC=$?
307 1.1.1.1.6.2 wrstuden if test $RC != 0 ; then
308 1.1.1.1.6.2 wrstuden echo "ldapmodify failed ($RC)!"
309 1.1.1.1.6.2 wrstuden test $KILLSERVERS != no && kill -HUP $KILLPIDS
310 1.1.1.1.6.2 wrstuden exit $RC
311 1.1.1.1.6.2 wrstuden fi
312 1.1.1.1.6.2 wrstuden
313 1.1.1.1.6.2 wrstuden # ITS#4964
314 1.1.1.1.6.2 wrstuden echo "Trying to change some passwords on the consumer..."
315 1.1.1.1.6.2 wrstuden $LDAPPASSWD -D "$MANAGERDN" -h $LOCALHOST -p $PORT4 -w $PASSWD \
316 1.1.1.1.6.2 wrstuden 'cn=Barbara Jensen,ou=Information Technology Division,ou=People,dc=example,dc=com' \
317 1.1.1.1.6.2 wrstuden > $TESTOUT 2>&1
318 1.1.1.1.6.2 wrstuden RC=$?
319 1.1.1.1.6.2 wrstuden if test $RC != 0 ; then
320 1.1.1.1.6.2 wrstuden echo "ldapmodify failed ($RC)!"
321 1.1.1.1.6.2 wrstuden test $KILLSERVERS != no && kill -HUP $KILLPIDS
322 1.1.1.1.6.2 wrstuden exit $RC
323 1.1.1.1.6.2 wrstuden fi
324 1.1.1.1.6.2 wrstuden
325 1.1.1.1.6.2 wrstuden echo "Waiting 15 seconds for syncrepl to receive changes..."
326 1.1.1.1.6.2 wrstuden sleep 15
327 1.1.1.1.6.2 wrstuden fi
328 1.1.1.1.6.2 wrstuden
329 1.1.1.1.6.2 wrstuden OPATTRS="entryUUID creatorsName createTimestamp modifiersName modifyTimestamp"
330 1.1.1.1.6.2 wrstuden
331 1.1.1.1.6.2 wrstuden echo "Using ldapsearch to read all the entries from the producer..."
332 1.1.1.1.6.2 wrstuden $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
333 1.1.1.1.6.2 wrstuden '(objectclass=*)' '*' $OPATTRS > $MASTEROUT 2>&1
334 1.1.1.1.6.2 wrstuden RC=$?
335 1.1.1.1.6.2 wrstuden
336 1.1.1.1.6.2 wrstuden if test $RC != 0 ; then
337 1.1.1.1.6.2 wrstuden echo "ldapsearch failed at producer ($RC)!"
338 1.1.1.1.6.2 wrstuden test $KILLSERVERS != no && kill -HUP $KILLPIDS
339 1.1.1.1.6.2 wrstuden exit $RC
340 1.1.1.1.6.2 wrstuden fi
341 1.1.1.1.6.2 wrstuden
342 1.1.1.1.6.2 wrstuden echo "Using ldapsearch to read all the entries from the consumer..."
343 1.1.1.1.6.2 wrstuden $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT4 \
344 1.1.1.1.6.2 wrstuden '(objectclass=*)' '*' $OPATTRS > $SLAVEOUT 2>&1
345 1.1.1.1.6.2 wrstuden RC=$?
346 1.1.1.1.6.2 wrstuden
347 1.1.1.1.6.2 wrstuden if test $RC != 0 ; then
348 1.1.1.1.6.2 wrstuden echo "ldapsearch failed at consumer ($RC)!"
349 1.1.1.1.6.2 wrstuden test $KILLSERVERS != no && kill -HUP $KILLPIDS
350 1.1.1.1.6.2 wrstuden exit $RC
351 1.1.1.1.6.2 wrstuden fi
352 1.1.1.1.6.2 wrstuden
353 1.1.1.1.6.2 wrstuden test $KILLSERVERS != no && kill -HUP $KILLPIDS
354 1.1.1.1.6.2 wrstuden
355 1.1.1.1.6.2 wrstuden echo "Filtering producer results..."
356 1.1.1.1.6.2 wrstuden . $LDIFFILTER < $MASTEROUT > $MASTERFLT
357 1.1.1.1.6.2 wrstuden echo "Filtering consumer results..."
358 1.1.1.1.6.2 wrstuden . $LDIFFILTER < $SLAVEOUT > $SLAVEFLT
359 1.1.1.1.6.2 wrstuden
360 1.1.1.1.6.2 wrstuden echo "Comparing retrieved entries from producer and consumer..."
361 1.1.1.1.6.2 wrstuden $CMP $MASTERFLT $SLAVEFLT > $CMPOUT
362 1.1.1.1.6.2 wrstuden
363 1.1.1.1.6.2 wrstuden if test $? != 0 ; then
364 1.1.1.1.6.2 wrstuden echo "test failed - producer and consumer databases differ"
365 1.1.1.1.6.2 wrstuden exit 1
366 1.1.1.1.6.2 wrstuden fi
367 1.1.1.1.6.2 wrstuden
368 1.1.1.1.6.2 wrstuden echo ">>>>> Test succeeded"
369 1.1.1.1.6.2 wrstuden
370 1.1.1.1.6.2 wrstuden test $KILLSERVERS != no && wait
371 1.1.1.1.6.2 wrstuden
372 1.1.1.1.6.2 wrstuden exit 0
373