X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=tests%2Fscripts%2Ftest019-syncreplication-cascade;h=d3b72ca0d39cbc646408fca1a5e47c68b142290b;hb=1adc0b9b1c39ac588adf22acf46f30e24b802682;hp=2a92834d68055047227595425403e02f026ad887;hpb=cc5e41723430ebe1d37c1307b6d6bb015af059a0;p=openldap diff --git a/tests/scripts/test019-syncreplication-cascade b/tests/scripts/test019-syncreplication-cascade index 2a92834d68..d3b72ca0d3 100755 --- a/tests/scripts/test019-syncreplication-cascade +++ b/tests/scripts/test019-syncreplication-cascade @@ -1,10 +1,27 @@ #! /bin/sh # $OpenLDAP$ +## This work is part of OpenLDAP Software . +## +## Copyright 1998-2011 The OpenLDAP Foundation. +## All rights reserved. +## +## Redistribution and use in source and binary forms, with or without +## modification, are permitted only as authorized by the OpenLDAP +## Public License. +## +## A copy of this license is available in the file LICENSE in the +## top-level directory of the distribution or, alternatively, at +## . echo "running defines.sh" . $SRCDIR/scripts/defines.sh -mkdir $TESTDIR $DBDIR1 $DBDIR2 $DBDIR3 $DBDIR4 $DBDIR5 $DBDIR6 +if test $SYNCPROV = syncprovno; then + echo "Syncrepl provider overlay not available, test skipped" + exit 0 +fi + +mkdir -p $TESTDIR $DBDIR1 $DBDIR2 $DBDIR3 $DBDIR4 $DBDIR5 $DBDIR6 # # Test replication: @@ -25,6 +42,8 @@ if test $WAIT != 0 ; then fi KILLPIDS="$PID" +sleep 1 + echo "Using ldapsearch to check that master slapd (pid=$PID) is running..." for i in 0 1 2 3 4 5; do $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \ @@ -63,7 +82,9 @@ if test $WAIT != 0 ; then fi KILLPIDS="$KILLPIDS $SLAVEPID" -echo "Using ldapsearch to check that R1 slave slapd(pid=$SLAVEPID) is running..." +sleep 1 + +echo "Using ldapsearch to check that R1 slave slapd (pid=$SLAVEPID) is running..." for i in 0 1 2 3 4 5; do $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT2 \ 'objectclass=*' > /dev/null 2>&1 @@ -91,7 +112,9 @@ if test $WAIT != 0 ; then fi KILLPIDS="$KILLPIDS $SLAVEPID" -echo "Using ldapsearch to check that R2 slave slapd(pid=$SLAVEPID) is running..." +sleep 1 + +echo "Using ldapsearch to check that R2 slave slapd (pid=$SLAVEPID) is running..." for i in 0 1 2 3 4 5; do $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT3 \ 'objectclass=*' > /dev/null 2>&1 @@ -119,7 +142,9 @@ if test $WAIT != 0 ; then fi KILLPIDS="$KILLPIDS $SLAVEPID" -echo "Using ldapsearch to check that P1 slave slapd(pid=$SLAVEPID) is running..." +sleep 1 + +echo "Using ldapsearch to check that P1 slave slapd (pid=$SLAVEPID) is running..." for i in 0 1 2 3 4 5; do $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT4 \ 'objectclass=*' > /dev/null 2>&1 @@ -147,7 +172,9 @@ if test $WAIT != 0 ; then fi KILLPIDS="$KILLPIDS $SLAVEPID" -echo "Using ldapsearch to check that P2 slave slapd(pid=$SLAVEPID) is running..." +sleep 1 + +echo "Using ldapsearch to check that P2 slave slapd (pid=$SLAVEPID) is running..." for i in 0 1 2 3 4 5; do $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT5 \ 'objectclass=*' > /dev/null 2>&1 @@ -175,7 +202,9 @@ if test $WAIT != 0 ; then fi KILLPIDS="$KILLPIDS $SLAVEPID" -echo "Using ldapsearch to check that P3 slave slapd(pid=$SLAVEPID) is running..." +sleep 1 + +echo "Using ldapsearch to check that P3 slave slapd (pid=$SLAVEPID) is running..." for i in 0 1 2 3 4 5; do $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT6 \ 'objectclass=*' > /dev/null 2>&1 @@ -203,8 +232,8 @@ if test $RC != 0 ; then exit $RC fi -echo "Waiting 25 seconds for syncrepl to receive changes..." -sleep 25 +echo "Waiting $SLEEP2 seconds for syncrepl to receive changes..." +sleep $SLEEP2 echo "Using ldapmodify to modify master directory..." @@ -214,7 +243,7 @@ echo "Using ldapmodify to modify master directory..." $LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \ $TESTOUT 2>&1 << EOMODS -dn: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US +dn: cn=James A Jones 1, ou=Alumni Association, ou=People, dc=example,dc=com changetype: modify add: drink drink: Orange Juice @@ -225,27 +254,27 @@ sn: Jones add: sn sn: Jones -dn: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US +dn: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, dc=example,dc=com changetype: modify replace: drink drink: Iced Tea drink: Mad Dog 20/20 -dn: cn=ITD Staff,ou=Groups,o=University of Michigan,c=US +dn: cn=ITD Staff,ou=Groups,dc=example,dc=com changetype: modify delete: uniquemember -uniquemember: cn=James A Jones 2, ou=Information Technology Division, ou=People, o=University of Michigan, c=US -uniquemember: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US +uniquemember: cn=James A Jones 2, ou=Information Technology Division, ou=People, dc=example,dc=com +uniquemember: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, dc=example,dc=com - add: uniquemember -uniquemember: cn=Dorothy Stevens, ou=Alumni Association, ou=People, o=University of Michigan, c=US -uniquemember: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US +uniquemember: cn=Dorothy Stevens, ou=Alumni Association, ou=People, dc=example,dc=com +uniquemember: cn=James A Jones 1, ou=Alumni Association, ou=People, dc=example,dc=com -dn: cn=All Staff,ou=Groups,o=University of Michigan,c=US +dn: cn=All Staff,ou=Groups,dc=example,dc=com changetype: modify delete: description -dn: cn=Gern Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US +dn: cn=Gern Jensen, ou=Information Technology Division, ou=People, dc=example,dc=com changetype: add objectclass: OpenLDAPperson cn: Gern Jensen @@ -253,7 +282,7 @@ sn: Jensen uid: gjensen title: Chief Investigator, ITD postaladdress: ITD $ 535 W. William St $ Ann Arbor, MI 48103 -seealso: cn=All Staff, ou=Groups, o=University of Michigan, c=US +seealso: cn=All Staff, ou=Groups, dc=example,dc=com drink: Coffee homepostaladdress: 844 Brown St. Apt. 4 $ Ann Arbor, MI 48104 description: Very odd @@ -262,27 +291,42 @@ telephonenumber: +1 313 555 8343 mail: gjensen@mailgw.example.com homephone: +1 313 555 8844 -dn: ou=Retired, ou=People, o=University of Michigan, c=US +dn: ou=Retired, ou=People, dc=example,dc=com changetype: add objectclass: organizationalUnit ou: Retired -dn: cn=Rosco P. Coltrane, ou=Information Technology Division, ou=People, o=University of Michigan, c=US +dn: cn=Rosco P. Coltrane, ou=Information Technology Division, ou=People, dc=example,dc=com changetype: add objectclass: OpenLDAPperson cn: Rosco P. Coltrane sn: Coltrane uid: rosco -dn: cn=Rosco P. Coltrane, ou=Information Technology Division, ou=People, o=University of Michigan, c=US +dn: cn=Rosco P. Coltrane, ou=Information Technology Division, ou=People, dc=example,dc=com changetype: modrdn newrdn: cn=Rosco P. Coltrane deleteoldrdn: 1 -newsuperior: ou=Retired, ou=People, o=University of Michigan, c=US +newsuperior: ou=Retired, ou=People, dc=example,dc=com -dn: cn=James A Jones 2, ou=Information Technology Division, ou=People, o=University of Michigan, c=US +dn: cn=James A Jones 2, ou=Information Technology Division, ou=People, dc=example,dc=com changetype: delete +dn: dc=testdomain1,dc=example,dc=com +changetype: modrdn +newrdn: dc=itsdomain1 +deleteoldrdn: 1 + +dn: dc=itsdomain1,dc=example,dc=com +changetype: modify +replace: description +description: Example, Inc. ITS test domain + +dn: dc=testdomain2,dc=example,dc=com +changetype: modrdn +newrdn: dc=itsdomain2 +deleteoldrdn: 1 + EOMODS RC=$? @@ -292,12 +336,32 @@ if test $RC != 0 ; then exit $RC fi -echo "Waiting 25 seconds for syncrepl to receive changes..." -sleep 25 +echo "Waiting $SLEEP2 seconds for syncrepl to receive changes..." +sleep $SLEEP2 + +echo "Performing modify alone on provider..." +$LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \ + $TESTOUT 2>&1 << EOMODS +dn: dc=itsdomain2,dc=example,dc=com +changetype: modify +replace: description +description: Example, Inc. itsdomain2 test domain + +EOMODS + +RC=$? +if test $RC != 0 ; then + echo "ldapmodify failed ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit $RC +fi + +echo "Waiting $SLEEP2 seconds for syncrepl to receive changes..." +sleep $SLEEP2 echo "Using ldapsearch to read all the entries from the master..." $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \ - 'objectclass=*' > $MASTEROUT 2>&1 + '(objectClass=*)' '*' entryCSN > $MASTEROUT 2>&1 RC=$? if test $RC != 0 ; then @@ -308,7 +372,7 @@ fi echo "Using ldapsearch to read all the entries from the R1 slave..." $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT2 \ - 'objectclass=*' > $SERVER2OUT 2>&1 + '(objectClass=*)' '*' entryCSN > $SERVER2OUT 2>&1 RC=$? if test $RC != 0 ; then @@ -319,7 +383,7 @@ fi echo "Using ldapsearch to read all the entries from the R2 slave..." $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT3 \ - 'objectclass=*' > $SERVER3OUT 2>&1 + '(objectClass=*)' '*' entryCSN > $SERVER3OUT 2>&1 RC=$? if test $RC != 0 ; then @@ -330,7 +394,7 @@ fi echo "Using ldapsearch to read all the entries from the P1 slave..." $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT4 \ - 'objectclass=*' > $SERVER4OUT 2>&1 + '(objectClass=*)' '*' entryCSN > $SERVER4OUT 2>&1 RC=$? if test $RC != 0 ; then @@ -341,7 +405,7 @@ fi echo "Using ldapsearch to read all the entries from the P2 slave..." $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT5 \ - 'objectclass=*' > $SERVER5OUT 2>&1 + '(objectClass=*)' '*' entryCSN > $SERVER5OUT 2>&1 RC=$? if test $RC != 0 ; then @@ -352,7 +416,7 @@ fi echo "Using ldapsearch to read all the entries from the P3 slave..." $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT6 \ - 'objectclass=*' > $SERVER6OUT 2>&1 + '(objectClass=*)' '*' entryCSN > $SERVER6OUT 2>&1 RC=$? if test $RC != 0 ; then @@ -364,17 +428,17 @@ fi test $KILLSERVERS != no && kill -HUP $KILLPIDS echo "Filtering master ldapsearch results..." -. $LDIFFILTER < $MASTEROUT > $MASTERFLT +$LDIFFILTER < $MASTEROUT > $MASTERFLT echo "Filtering R1 slave ldapsearch results..." -. $LDIFFILTER < $SERVER2OUT > $SERVER2FLT +$LDIFFILTER < $SERVER2OUT > $SERVER2FLT echo "Filtering R2 slave ldapsearch results..." -. $LDIFFILTER < $SERVER3OUT > $SERVER3FLT +$LDIFFILTER < $SERVER3OUT > $SERVER3FLT echo "Filtering P1 slave ldapsearch results..." -. $LDIFFILTER < $SERVER4OUT > $SERVER4FLT +$LDIFFILTER < $SERVER4OUT > $SERVER4FLT echo "Filtering P2 slave ldapsearch results..." -. $LDIFFILTER < $SERVER5OUT > $SERVER5FLT +$LDIFFILTER < $SERVER5OUT > $SERVER5FLT echo "Filtering P3 slave ldapsearch results..." -. $LDIFFILTER < $SERVER6OUT > $SERVER6FLT +$LDIFFILTER < $SERVER6OUT > $SERVER6FLT echo "Comparing retrieved entries from master and R1 slave..." $CMP $MASTERFLT $SERVER2FLT > $CMPOUT @@ -417,4 +481,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0