| 1 |
#! /bin/sh |
| 2 |
# $OpenLDAP$ |
| 3 |
## This work is part of OpenLDAP Software <http://www.openldap.org/>. |
| 4 |
## |
| 5 |
## Copyright 1998-2024 The OpenLDAP Foundation. |
| 6 |
## All rights reserved. |
| 7 |
## |
| 8 |
## Redistribution and use in source and binary forms, with or without |
| 9 |
## modification, are permitted only as authorized by the OpenLDAP |
| 10 |
## Public License. |
| 11 |
## |
| 12 |
## A copy of this license is available in the file LICENSE in the |
| 13 |
## top-level directory of the distribution or, alternatively, at |
| 14 |
## <http://www.OpenLDAP.org/license.html>. |
| 15 |
|
| 16 |
echo "running defines.sh" |
| 17 |
. $SRCDIR/scripts/defines.sh |
| 18 |
|
| 19 |
OPATTRS="entryUUID creatorsName createTimestamp modifiersName modifyTimestamp" |
| 20 |
|
| 21 |
if test $SYNCPROV = syncprovno; then |
| 22 |
echo "Syncrepl provider overlay not available, test skipped" |
| 23 |
exit 0 |
| 24 |
fi |
| 25 |
|
| 26 |
mkdir -p $TESTDIR $DBDIR1 $DBDIR4 |
| 27 |
|
| 28 |
# |
| 29 |
# Test replication: |
| 30 |
# - start provider |
| 31 |
# - start consumer |
| 32 |
# - populate over ldap |
| 33 |
# - perform some modifies and deleted |
| 34 |
# - attempt to modify the consumer (referral or chain) |
| 35 |
# - retrieve database over ldap and compare against expected results |
| 36 |
# |
| 37 |
|
| 38 |
echo "Starting provider slapd on TCP/IP port $PORT1..." |
| 39 |
. $CONFFILTER $BACKEND < $SRPROVIDERCONF > $CONF1 |
| 40 |
$SLAPD -f $CONF1 -h $URI1 -d $LVL > $LOG1 2>&1 & |
| 41 |
PID=$! |
| 42 |
if test $WAIT != 0 ; then |
| 43 |
echo PID $PID |
| 44 |
read foo |
| 45 |
fi |
| 46 |
KILLPIDS="$PID" |
| 47 |
|
| 48 |
sleep 1 |
| 49 |
|
| 50 |
echo "Using ldapsearch to check that provider slapd is running..." |
| 51 |
for i in 0 1 2 3 4 5; do |
| 52 |
$LDAPSEARCH -s base -b "$MONITOR" -H $URI1 \ |
| 53 |
'objectclass=*' > /dev/null 2>&1 |
| 54 |
RC=$? |
| 55 |
if test $RC = 0 ; then |
| 56 |
break |
| 57 |
fi |
| 58 |
echo "Waiting 5 seconds for slapd to start..." |
| 59 |
sleep 5 |
| 60 |
done |
| 61 |
|
| 62 |
if test $RC != 0 ; then |
| 63 |
echo "ldapsearch failed ($RC)!" |
| 64 |
test $KILLSERVERS != no && kill -HUP $KILLPIDS |
| 65 |
exit $RC |
| 66 |
fi |
| 67 |
|
| 68 |
echo "Using ldapadd to create the context prefix entry in the provider..." |
| 69 |
$LDAPADD -D "$MANAGERDN" -H $URI1 -w $PASSWD < \ |
| 70 |
$LDIFORDEREDCP > /dev/null 2>&1 |
| 71 |
RC=$? |
| 72 |
if test $RC != 0 ; then |
| 73 |
echo "ldapadd failed ($RC)!" |
| 74 |
test $KILLSERVERS != no && kill -HUP $KILLPIDS |
| 75 |
exit $RC |
| 76 |
fi |
| 77 |
|
| 78 |
echo "Starting consumer slapd on TCP/IP port $PORT4..." |
| 79 |
. $CONFFILTER $BACKEND < $P1SRCONSUMERCONF > $CONF4 |
| 80 |
$SLAPD -f $CONF4 -h $URI4 -d $LVL > $LOG4 2>&1 & |
| 81 |
CONSUMERPID=$! |
| 82 |
if test $WAIT != 0 ; then |
| 83 |
echo CONSUMERPID $CONSUMERPID |
| 84 |
read foo |
| 85 |
fi |
| 86 |
KILLPIDS="$KILLPIDS $CONSUMERPID" |
| 87 |
|
| 88 |
sleep 1 |
| 89 |
|
| 90 |
echo "Using ldapsearch to check that consumer slapd is running..." |
| 91 |
for i in 0 1 2 3 4 5; do |
| 92 |
$LDAPSEARCH -s base -b "$MONITOR" -H $URI4 \ |
| 93 |
'objectclass=*' > /dev/null 2>&1 |
| 94 |
RC=$? |
| 95 |
if test $RC = 0 ; then |
| 96 |
break |
| 97 |
fi |
| 98 |
echo "Waiting 5 seconds for slapd to start..." |
| 99 |
sleep 5 |
| 100 |
done |
| 101 |
|
| 102 |
if test $RC != 0 ; then |
| 103 |
echo "ldapsearch failed ($RC)!" |
| 104 |
test $KILLSERVERS != no && kill -HUP $KILLPIDS |
| 105 |
exit $RC |
| 106 |
fi |
| 107 |
|
| 108 |
echo "Using ldapadd to populate the provider directory..." |
| 109 |
$LDAPADD -D "$MANAGERDN" -H $URI1 -w $PASSWD < \ |
| 110 |
$LDIFORDEREDNOCP > /dev/null 2>&1 |
| 111 |
RC=$? |
| 112 |
if test $RC != 0 ; then |
| 113 |
echo "ldapadd failed ($RC)!" |
| 114 |
test $KILLSERVERS != no && kill -HUP $KILLPIDS |
| 115 |
exit $RC |
| 116 |
fi |
| 117 |
|
| 118 |
echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..." |
| 119 |
sleep $SLEEP1 |
| 120 |
|
| 121 |
echo "Using ldapsearch to read all the entries from the provider..." |
| 122 |
$LDAPSEARCH -S "" -b "$BASEDN" -H $URI1 \ |
| 123 |
'(objectclass=*)' '*' $OPATTRS > $PROVIDEROUT 2>&1 |
| 124 |
RC=$? |
| 125 |
|
| 126 |
if test $RC != 0 ; then |
| 127 |
echo "ldapsearch failed at provider ($RC)!" |
| 128 |
test $KILLSERVERS != no && kill -HUP $KILLPIDS |
| 129 |
exit $RC |
| 130 |
fi |
| 131 |
|
| 132 |
echo "Using ldapsearch to read all the entries from the consumer..." |
| 133 |
$LDAPSEARCH -S "" -b "$BASEDN" -H $URI4 \ |
| 134 |
'(objectclass=*)' '*' $OPATTRS > $CONSUMEROUT 2>&1 |
| 135 |
RC=$? |
| 136 |
|
| 137 |
if test $RC != 0 ; then |
| 138 |
echo "ldapsearch failed at consumer ($RC)!" |
| 139 |
test $KILLSERVERS != no && kill -HUP $KILLPIDS |
| 140 |
exit $RC |
| 141 |
fi |
| 142 |
|
| 143 |
echo "Filtering provider results..." |
| 144 |
$LDIFFILTER < $PROVIDEROUT > $PROVIDERFLT |
| 145 |
echo "Filtering consumer results..." |
| 146 |
$LDIFFILTER < $CONSUMEROUT > $CONSUMERFLT |
| 147 |
|
| 148 |
echo "Comparing retrieved entries from provider and consumer..." |
| 149 |
$CMP $PROVIDERFLT $CONSUMERFLT > $CMPOUT |
| 150 |
|
| 151 |
if test $? != 0 ; then |
| 152 |
echo "test failed - provider and consumer databases differ" |
| 153 |
test $KILLSERVERS != no && kill -HUP $KILLPIDS |
| 154 |
exit 1 |
| 155 |
fi |
| 156 |
|
| 157 |
echo "Stopping the provider, sleeping 10 seconds and restarting it..." |
| 158 |
kill -HUP "$PID" |
| 159 |
wait $PID |
| 160 |
sleep 10 |
| 161 |
echo "RESTART" >> $LOG1 |
| 162 |
$SLAPD -f $CONF1 -h $URI1 -d $LVL >> $LOG1 2>&1 & |
| 163 |
PID=$! |
| 164 |
if test $WAIT != 0 ; then |
| 165 |
echo PID $PID |
| 166 |
read foo |
| 167 |
fi |
| 168 |
KILLPIDS="$PID $CONSUMERPID" |
| 169 |
|
| 170 |
sleep 1 |
| 171 |
|
| 172 |
echo "Using ldapsearch to check that provider slapd is running..." |
| 173 |
for i in 0 1 2 3 4 5; do |
| 174 |
$LDAPSEARCH -s base -b "$MONITOR" -H $URI1 \ |
| 175 |
'objectclass=*' > /dev/null 2>&1 |
| 176 |
RC=$? |
| 177 |
if test $RC = 0 ; then |
| 178 |
break |
| 179 |
fi |
| 180 |
echo "Waiting 5 seconds for slapd to start..." |
| 181 |
sleep 5 |
| 182 |
done |
| 183 |
|
| 184 |
echo "Waiting $SLEEP1 seconds for consumer to reconnect..." |
| 185 |
sleep $SLEEP1 |
| 186 |
|
| 187 |
if test $RC != 0 ; then |
| 188 |
echo "ldapsearch failed ($RC)!" |
| 189 |
test $KILLSERVERS != no && kill -HUP $KILLPIDS |
| 190 |
exit $RC |
| 191 |
fi |
| 192 |
|
| 193 |
echo "Using ldapmodify to modify provider directory..." |
| 194 |
|
| 195 |
# |
| 196 |
# Do some modifications |
| 197 |
# |
| 198 |
|
| 199 |
$LDAPMODIFY -v -D "$MANAGERDN" -H $URI1 -w $PASSWD > \ |
| 200 |
$TESTOUT 2>&1 << EOMODS |
| 201 |
dn: cn=James A Jones 1, ou=Alumni Association, ou=People, dc=example,dc=com |
| 202 |
changetype: modify |
| 203 |
add: drink |
| 204 |
drink: Orange Juice |
| 205 |
- |
| 206 |
delete: sn |
| 207 |
sn: Jones |
| 208 |
- |
| 209 |
add: sn |
| 210 |
sn: Jones |
| 211 |
|
| 212 |
dn: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, dc=example,dc=com |
| 213 |
changetype: modify |
| 214 |
replace: drink |
| 215 |
drink: Iced Tea |
| 216 |
|
| 217 |
dn: cn=ITD Staff,ou=Groups,dc=example,dc=com |
| 218 |
changetype: modify |
| 219 |
delete: uniquemember |
| 220 |
uniquemember: cn=James A Jones 2, ou=Information Technology Division, ou=People, dc=example,dc=com |
| 221 |
uniquemember: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, dc=example,dc=com |
| 222 |
- |
| 223 |
add: uniquemember |
| 224 |
uniquemember: cn=Dorothy Stevens, ou=Alumni Association, ou=People, dc=example,dc=com |
| 225 |
uniquemember: cn=James A Jones 1, ou=Alumni Association, ou=People, dc=example,dc=com |
| 226 |
|
| 227 |
dn: cn=All Staff,ou=Groups,dc=example,dc=com |
| 228 |
changetype: modify |
| 229 |
delete: description |
| 230 |
|
| 231 |
dn: cn=Gern Jensen, ou=Information Technology Division, ou=People, dc=example,dc=com |
| 232 |
changetype: add |
| 233 |
objectclass: OpenLDAPperson |
| 234 |
cn: Gern Jensen |
| 235 |
sn: Jensen |
| 236 |
uid: gjensen |
| 237 |
title: Chief Investigator, ITD |
| 238 |
postaladdress: ITD $ 535 W. William St $ Ann Arbor, MI 48103 |
| 239 |
seealso: cn=All Staff, ou=Groups, dc=example,dc=com |
| 240 |
drink: Coffee |
| 241 |
homepostaladdress: 844 Brown St. Apt. 4 $ Ann Arbor, MI 48104 |
| 242 |
description: Very odd |
| 243 |
facsimiletelephonenumber: +1 313 555 7557 |
| 244 |
facsimiletelephonenumber: +1 313 555 9998 |
| 245 |
facsimiletelephonenumber: +1 313 555 9999 |
| 246 |
telephonenumber: +1 313 555 8343 |
| 247 |
mail: [email protected] |
| 248 |
homephone: +1 313 555 8844 |
| 249 |
|
| 250 |
# modify attribute with no matching rule (ITS#6458) |
| 251 |
dn: cn=Gern Jensen, ou=Information Technology Division, ou=People, dc=example,dc=com |
| 252 |
changetype: modify |
| 253 |
replace: facsimiletelephonenumber |
| 254 |
facsimiletelephonenumber: +1 313 555 9998 |
| 255 |
facsimiletelephonenumber: +1 313 555 9999 |
| 256 |
|
| 257 |
dn: cn=Gern Jensen, ou=Information Technology Division, ou=People, dc=example,dc=com |
| 258 |
changetype: modify |
| 259 |
replace: facsimiletelephonenumber |
| 260 |
facsimiletelephonenumber: +1 313 555 9998 |
| 261 |
facsimiletelephonenumber: +1 313 555 9999 |
| 262 |
facsimiletelephonenumber: +1 313 555 7557 |
| 263 |
|
| 264 |
dn: cn=Gern Jensen, ou=Information Technology Division, ou=People, dc=example,dc=com |
| 265 |
changetype: modify |
| 266 |
replace: facsimiletelephonenumber |
| 267 |
facsimiletelephonenumber: +1 313 555 9998 |
| 268 |
facsimiletelephonenumber: +1 313 555 9999 |
| 269 |
|
| 270 |
dn: ou=Retired, ou=People, dc=example,dc=com |
| 271 |
changetype: add |
| 272 |
objectclass: organizationalUnit |
| 273 |
ou: Retired |
| 274 |
|
| 275 |
dn: cn=Rosco P. Coltrane, ou=Information Technology Division, ou=People, dc=example,dc=com |
| 276 |
changetype: add |
| 277 |
objectclass: OpenLDAPperson |
| 278 |
cn: Rosco P. Coltrane |
| 279 |
sn: Coltrane |
| 280 |
uid: rosco |
| 281 |
description: Fat tycoon |
| 282 |
|
| 283 |
dn: cn=Rosco P. Coltrane, ou=Information Technology Division, ou=People, dc=example,dc=com |
| 284 |
changetype: modrdn |
| 285 |
newrdn: cn=Rosco P. Coltrane |
| 286 |
deleteoldrdn: 1 |
| 287 |
newsuperior: ou=Retired, ou=People, dc=example,dc=com |
| 288 |
|
| 289 |
dn: cn=James A Jones 2, ou=Information Technology Division, ou=People, dc=example,dc=com |
| 290 |
changetype: delete |
| 291 |
|
| 292 |
dn: dc=testdomain1,dc=example,dc=com |
| 293 |
changetype: modrdn |
| 294 |
newrdn: dc=itsdomain1 |
| 295 |
deleteoldrdn: 1 |
| 296 |
|
| 297 |
dn: dc=itsdomain1,dc=example,dc=com |
| 298 |
changetype: modify |
| 299 |
replace: description |
| 300 |
description: Example, Inc. ITS test domain |
| 301 |
|
| 302 |
dn: dc=testdomain2,dc=example,dc=com |
| 303 |
changetype: modrdn |
| 304 |
newrdn: dc=itsdomain2 |
| 305 |
deleteoldrdn: 1 |
| 306 |
|
| 307 |
EOMODS |
| 308 |
|
| 309 |
RC=$? |
| 310 |
if test $RC != 0 ; then |
| 311 |
echo "ldapmodify failed ($RC)!" |
| 312 |
test $KILLSERVERS != no && kill -HUP $KILLPIDS |
| 313 |
exit $RC |
| 314 |
fi |
| 315 |
|
| 316 |
echo "Using ldappasswd to change some passwords..." |
| 317 |
$LDAPPASSWD -D "$MANAGERDN" -H $URI1 -w $PASSWD \ |
| 318 |
'cn=Bjorn Jensen,ou=Information Technology Division,ou=People,dc=example,dc=com' \ |
| 319 |
> $TESTOUT 2>&1 |
| 320 |
RC=$? |
| 321 |
if test $RC != 0 ; then |
| 322 |
echo "ldapmodify failed ($RC)!" |
| 323 |
test $KILLSERVERS != no && kill -HUP $KILLPIDS |
| 324 |
exit $RC |
| 325 |
fi |
| 326 |
|
| 327 |
echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..." |
| 328 |
sleep $SLEEP1 |
| 329 |
|
| 330 |
echo "Using ldapsearch to read all the entries from the provider..." |
| 331 |
$LDAPSEARCH -S "" -b "$BASEDN" -H $URI1 \ |
| 332 |
'(objectclass=*)' '*' $OPATTRS > $PROVIDEROUT 2>&1 |
| 333 |
RC=$? |
| 334 |
|
| 335 |
if test $RC != 0 ; then |
| 336 |
echo "ldapsearch failed at provider ($RC)!" |
| 337 |
test $KILLSERVERS != no && kill -HUP $KILLPIDS |
| 338 |
exit $RC |
| 339 |
fi |
| 340 |
|
| 341 |
echo "Using ldapsearch to read all the entries from the consumer..." |
| 342 |
$LDAPSEARCH -S "" -b "$BASEDN" -H $URI4 \ |
| 343 |
'(objectclass=*)' '*' $OPATTRS > $CONSUMEROUT 2>&1 |
| 344 |
RC=$? |
| 345 |
|
| 346 |
if test $RC != 0 ; then |
| 347 |
echo "ldapsearch failed at consumer ($RC)!" |
| 348 |
test $KILLSERVERS != no && kill -HUP $KILLPIDS |
| 349 |
exit $RC |
| 350 |
fi |
| 351 |
|
| 352 |
echo "Filtering provider results..." |
| 353 |
$LDIFFILTER < $PROVIDEROUT > $PROVIDERFLT |
| 354 |
echo "Filtering consumer results..." |
| 355 |
$LDIFFILTER < $CONSUMEROUT > $CONSUMERFLT |
| 356 |
|
| 357 |
echo "Comparing retrieved entries from provider and consumer..." |
| 358 |
$CMP $PROVIDERFLT $CONSUMERFLT > $CMPOUT |
| 359 |
|
| 360 |
if test $? != 0 ; then |
| 361 |
echo "test failed - provider and consumer databases differ" |
| 362 |
test $KILLSERVERS != no && kill -HUP $KILLPIDS |
| 363 |
exit 1 |
| 364 |
fi |
| 365 |
|
| 366 |
echo "Stopping consumer to test recovery..." |
| 367 |
kill -HUP $CONSUMERPID |
| 368 |
wait $CONSUMERPID |
| 369 |
|
| 370 |
echo "Modifying more entries on the provider..." |
| 371 |
$LDAPMODIFY -v -D "$MANAGERDN" -H $URI1 -w $PASSWD >> \ |
| 372 |
$TESTOUT 2>&1 << EOMODS |
| 373 |
dn: cn=Rosco P. Coltrane, ou=Retired, ou=People, dc=example,dc=com |
| 374 |
changetype: delete |
| 375 |
|
| 376 |
dn: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, dc=example,dc=com |
| 377 |
changetype: modify |
| 378 |
add: drink |
| 379 |
drink: Mad Dog 20/20 |
| 380 |
|
| 381 |
dn: cn=Rosco P. Coltrane, ou=Retired, ou=People, dc=example,dc=com |
| 382 |
changetype: add |
| 383 |
objectclass: OpenLDAPperson |
| 384 |
sn: Coltrane |
| 385 |
uid: rosco |
| 386 |
cn: Rosco P. Coltrane |
| 387 |
|
| 388 |
dn: dc=itsdomain2,dc=example,dc=com |
| 389 |
changetype: modify |
| 390 |
replace: description |
| 391 |
description: Example, Inc. itsdomain2 test domain |
| 392 |
|
| 393 |
# rename with a newly added newSuperior while the consumer is down (ITS#6472) |
| 394 |
dn: ou=New Branch,dc=example,dc=com |
| 395 |
changetype: add |
| 396 |
objectClass: organizationalUnit |
| 397 |
ou: New Branch |
| 398 |
|
| 399 |
dn: cn=Dorothy Stevens, ou=Alumni Association, ou=People, dc=example,dc=com |
| 400 |
changetype: modrdn |
| 401 |
newrdn: cn=Dorothy Stevens |
| 402 |
deleteoldrdn: 0 |
| 403 |
newsuperior: ou=New Branch,dc=example,dc=com |
| 404 |
|
| 405 |
EOMODS |
| 406 |
|
| 407 |
RC=$? |
| 408 |
if test $RC != 0 ; then |
| 409 |
echo "ldapmodify failed ($RC)!" |
| 410 |
test $KILLSERVERS != no && kill -HUP $KILLPIDS |
| 411 |
exit $RC |
| 412 |
fi |
| 413 |
|
| 414 |
echo "Restarting consumer..." |
| 415 |
echo "RESTART" >> $LOG4 |
| 416 |
$SLAPD -f $CONF4 -h $URI4 -d $LVL >> $LOG4 2>&1 & |
| 417 |
CONSUMERPID=$! |
| 418 |
if test $WAIT != 0 ; then |
| 419 |
echo CONSUMERPID $CONSUMERPID |
| 420 |
read foo |
| 421 |
fi |
| 422 |
KILLPIDS="$PID $CONSUMERPID" |
| 423 |
|
| 424 |
echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..." |
| 425 |
sleep $SLEEP1 |
| 426 |
|
| 427 |
echo "Using ldapsearch to read all the entries from the provider..." |
| 428 |
$LDAPSEARCH -S "" -b "$BASEDN" -H $URI1 \ |
| 429 |
'(objectclass=*)' '*' $OPATTRS > $PROVIDEROUT 2>&1 |
| 430 |
RC=$? |
| 431 |
|
| 432 |
if test $RC != 0 ; then |
| 433 |
echo "ldapsearch failed at provider ($RC)!" |
| 434 |
test $KILLSERVERS != no && kill -HUP $KILLPIDS |
| 435 |
exit $RC |
| 436 |
fi |
| 437 |
|
| 438 |
echo "Using ldapsearch to read all the entries from the consumer..." |
| 439 |
$LDAPSEARCH -S "" -b "$BASEDN" -H $URI4 \ |
| 440 |
'(objectclass=*)' '*' $OPATTRS > $CONSUMEROUT 2>&1 |
| 441 |
RC=$? |
| 442 |
|
| 443 |
if test $RC != 0 ; then |
| 444 |
echo "ldapsearch failed at consumer ($RC)!" |
| 445 |
test $KILLSERVERS != no && kill -HUP $KILLPIDS |
| 446 |
exit $RC |
| 447 |
fi |
| 448 |
|
| 449 |
echo "Filtering provider results..." |
| 450 |
$LDIFFILTER < $PROVIDEROUT > $PROVIDERFLT |
| 451 |
echo "Filtering consumer results..." |
| 452 |
$LDIFFILTER < $CONSUMEROUT > $CONSUMERFLT |
| 453 |
|
| 454 |
echo "Comparing retrieved entries from provider and consumer..." |
| 455 |
$CMP $PROVIDERFLT $CONSUMERFLT > $CMPOUT |
| 456 |
|
| 457 |
if test $? != 0 ; then |
| 458 |
echo "test failed - provider and consumer databases differ" |
| 459 |
test $KILLSERVERS != no && kill -HUP $KILLPIDS |
| 460 |
exit 1 |
| 461 |
fi |
| 462 |
|
| 463 |
if test ! $BACKLDAP = "ldapno" ; then |
| 464 |
echo "Try updating the consumer slapd..." |
| 465 |
$LDAPMODIFY -v -D "$MANAGERDN" -H $URI4 -w $PASSWD > \ |
| 466 |
$TESTOUT 2>&1 << EOMODS |
| 467 |
dn: cn=James A Jones 1, ou=Alumni Association, ou=People, dc=example, dc=com |
| 468 |
changetype: modify |
| 469 |
add: description |
| 470 |
description: This write must fail because directed to a shadow context, |
| 471 |
description: unless the chain overlay is configured appropriately ;) |
| 472 |
|
| 473 |
EOMODS |
| 474 |
|
| 475 |
RC=$? |
| 476 |
if test $RC != 0 ; then |
| 477 |
echo "ldapmodify failed ($RC)!" |
| 478 |
test $KILLSERVERS != no && kill -HUP $KILLPIDS |
| 479 |
exit $RC |
| 480 |
fi |
| 481 |
|
| 482 |
# ITS#4964 |
| 483 |
echo "Trying to change some passwords on the consumer..." |
| 484 |
$LDAPPASSWD -D "$MANAGERDN" -H $URI4 -w $PASSWD \ |
| 485 |
'cn=Barbara Jensen,ou=Information Technology Division,ou=People,dc=example,dc=com' \ |
| 486 |
> $TESTOUT 2>&1 |
| 487 |
RC=$? |
| 488 |
if test $RC != 0 ; then |
| 489 |
echo "ldapmodify failed ($RC)!" |
| 490 |
test $KILLSERVERS != no && kill -HUP $KILLPIDS |
| 491 |
exit $RC |
| 492 |
fi |
| 493 |
|
| 494 |
echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..." |
| 495 |
sleep $SLEEP1 |
| 496 |
fi |
| 497 |
|
| 498 |
# Testing a cancel exop (should go in its own testcase) |
| 499 |
$LDAPSEARCH -D "$MANAGERDN" -H $URI1 -w $PASSWD \ |
| 500 |
-e '!cancel' \ |
| 501 |
'(objectclass=*)' '*' $OPATTRS > $TESTOUT 2>&1 |
| 502 |
RC=$? |
| 503 |
# cancelled operation returns -1, so no point of checking return code, either |
| 504 |
# it's cancelled or we get stuck forever |
| 505 |
|
| 506 |
echo "Using ldapsearch to read all the entries from the provider..." |
| 507 |
$LDAPSEARCH -S "" -b "$BASEDN" -H $URI1 \ |
| 508 |
'(objectclass=*)' '*' $OPATTRS > $PROVIDEROUT 2>&1 |
| 509 |
RC=$? |
| 510 |
|
| 511 |
if test $RC != 0 ; then |
| 512 |
echo "ldapsearch failed at provider ($RC)!" |
| 513 |
test $KILLSERVERS != no && kill -HUP $KILLPIDS |
| 514 |
exit $RC |
| 515 |
fi |
| 516 |
|
| 517 |
echo "Using ldapsearch to read all the entries from the consumer..." |
| 518 |
$LDAPSEARCH -S "" -b "$BASEDN" -H $URI4 \ |
| 519 |
'(objectclass=*)' '*' $OPATTRS > $CONSUMEROUT 2>&1 |
| 520 |
RC=$? |
| 521 |
|
| 522 |
if test $RC != 0 ; then |
| 523 |
echo "ldapsearch failed at consumer ($RC)!" |
| 524 |
test $KILLSERVERS != no && kill -HUP $KILLPIDS |
| 525 |
exit $RC |
| 526 |
fi |
| 527 |
|
| 528 |
echo "Filtering provider results..." |
| 529 |
$LDIFFILTER < $PROVIDEROUT > $PROVIDERFLT |
| 530 |
echo "Filtering consumer results..." |
| 531 |
$LDIFFILTER < $CONSUMEROUT > $CONSUMERFLT |
| 532 |
|
| 533 |
echo "Comparing retrieved entries from provider and consumer..." |
| 534 |
$CMP $PROVIDERFLT $CONSUMERFLT > $CMPOUT |
| 535 |
|
| 536 |
if test $? != 0 ; then |
| 537 |
echo "test failed - provider and consumer databases differ" |
| 538 |
test $KILLSERVERS != no && kill -HUP $KILLPIDS |
| 539 |
exit 1 |
| 540 |
fi |
| 541 |
|
| 542 |
test $KILLSERVERS != no && kill -HUP $KILLPIDS |
| 543 |
|
| 544 |
echo ">>>>> Test succeeded" |
| 545 |
|
| 546 |
test $KILLSERVERS != no && wait |
| 547 |
|
| 548 |
exit 0 |