X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=tests%2Fscripts%2Ftest058-syncrepl-asymmetric;h=aa0c9b513087235b9d05af7c54f326aad48f53f2;hb=f980c64cb63abca0928e176a9443d8513b74ef74;hp=4670af6a61e32599e879ca85bf574dfc13a6f546;hpb=6dff367fce1143cc9e0c5adb1117ef0b01c7db73;p=openldap diff --git a/tests/scripts/test058-syncrepl-asymmetric b/tests/scripts/test058-syncrepl-asymmetric index 4670af6a61..aa0c9b5130 100755 --- a/tests/scripts/test058-syncrepl-asymmetric +++ b/tests/scripts/test058-syncrepl-asymmetric @@ -2,7 +2,7 @@ # $OpenLDAP$ ## This work is part of OpenLDAP Software . ## -## Copyright 1998-2010 The OpenLDAP Foundation. +## Copyright 1998-2012 The OpenLDAP Foundation. ## All rights reserved. ## ## Redistribution and use in source and binary forms, with or without @@ -116,6 +116,9 @@ if test "$BACKEND" = ldif ; then exit 0 fi +#echo "Test 058 is currently disabled" +#exit 0 + echo "running defines.sh" . $SRCDIR/scripts/defines.sh @@ -131,6 +134,8 @@ SS1_DIR=$TESTDIR/ss1 SS2_DIR=$TESTDIR/ss2 SSC_DIR=$TESTDIR/ssc +MNUM=1 + mkdir -p $TESTDIR for dir in $SMC_DIR $SM1_DIR $SM2_DIR $SS1_DIR $SS2_DIR $SSC_DIR; do @@ -373,7 +378,7 @@ EOF dn: cn=module,cn=config objectClass: olcModuleList cn: module -olcModulePath: ../../../servers/slapd/back-$BACKEND +olcModulePath: $TESTWD/../servers/slapd/back-$BACKEND olcModuleLoad: back_$BACKEND.la EOF RC=$? @@ -390,7 +395,7 @@ if [ "$SYNCPROV" = syncprovmod ]; then dn: cn=module,cn=config objectClass: olcModuleList cn: module -olcModulePath: ../../../servers/slapd/overlays +olcModulePath: $TESTWD/../servers/slapd/overlays olcModuleLoad: syncprov.la EOF @@ -484,7 +489,7 @@ if [ "$SYNCPROV" = syncprovmod ]; then dn: cn=module,cn=config objectClass: olcModuleList cn: module -olcModulePath: ../../../servers/slapd/overlays +olcModulePath: $TESTWD/../servers/slapd/overlays olcModuleLoad: syncprov.la EOF @@ -557,7 +562,7 @@ if [ "$SYNCPROV" = syncprovmod ]; then dn: cn=module,cn=config objectClass: olcModuleList cn: module -olcModulePath: ../../../servers/slapd/overlays +olcModulePath: $TESTWD/../servers/slapd/overlays olcModuleLoad: syncprov.la EOF @@ -976,6 +981,29 @@ if test $RC != 0 ; then exit $RC fi +# Test for ITS#6716, modify on central master to ensure that the CSN +# order is "sid2 < sid3 < sid1". When site1 master starts it is likely +# to sync with central master before it syncs with site1 master. When +# central master syncs with site1 master they will share the sid1 and +# sid3 CSNs, the additonal sid2 CSN hold by site1 master will be the +# oldest. Central master will not receive the changes made on site1 +# master unless it completely ignores the CSNs presented by central +# master. +echo "Using ldapmodify to modify central master..." +$LDAPMODIFY -D "$MANAGERDN" -H $URI1 -w $PASSWD <> $TESTOUT 2>&1 +dn: dc=example,dc=com +changetype: modify +add: description +description: Modify$MNUM + +EOF +RC=$? +if test $RC != 0 ; then + echo "ldapmodify failed ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit $RC +fi + if test -z "$SM1_PID" ; then echo "Restarting site1 master slapd on TCP/IP port $PORT2..." cd $SM1_DIR @@ -1024,6 +1052,44 @@ if test $RC != 0 ; then exit $RC fi +echo "Using ldapsearch to check that site1 master received central master update..." +RC=32 +for i in 1 2 3 4 5; do + RESULT=`$LDAPSEARCH -H $URI2 \ + -s base -b "$BASEDN" \ + "(description=Modify$MNUM)" 2>&1 | awk '/^dn:/ {print "OK"}'` + if test "x$RESULT$nullOK" = "xOK" ; then + RC=0 + break + fi + echo "Waiting $i seconds for syncrepl to receive changes..." + sleep $i +done +if test $RC != 0 ; then + echo "ldapsearch failed ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit $RC +fi + +echo "Using ldapsearch to check that site2 master received central master update..." +RC=32 +for i in 1 2 3 4 5; do + RESULT=`$LDAPSEARCH -H $URI3 \ + -s base -b "$BASEDN" \ + "(description=Modify$MNUM)" 2>&1 | awk '/^dn:/ {print "OK"}'` + if test "x$RESULT$nullOK" = "xOK" ; then + RC=0 + break + fi + echo "Waiting $i seconds for syncrepl to receive changes..." + sleep $i +done +if test $RC != 0 ; then + echo "ldapsearch failed ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit $RC +fi + # Test done, now some more intialization... echo "Adding syncrepl consumer on central search..." @@ -1516,8 +1582,6 @@ chmod +x $TESTDIR/checkcsn.sh echo "Checking contextCSN after initial replication..." . $TESTDIR/checkcsn.sh -MNUM=1 - # TEST: # Test that updates to the first backend on central master, which should # be replicated to all servers actually is so, and that the contextCSN is @@ -2259,7 +2323,7 @@ fi # TEST: # Run race tests when more than one backend is replicated from the same -# producer. This will usually fail long before 100 iterations unless +# provider. This will usually fail long before 100 iterations unless # syncrepl stores the contextCSN in the suffix of its own database, and # that syncprov follows these rules before updating its own CSN when it # detects updates from syncrepl: