mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-08 16:04:47 -05:00
fix syncrepl when attr has no matching rule (ITS#6458)
This commit is contained in:
parent
8025becf91
commit
88ffa89ae3
1 changed files with 135 additions and 4 deletions
|
|
@ -16,6 +16,8 @@
|
|||
echo "running defines.sh"
|
||||
. $SRCDIR/scripts/defines.sh
|
||||
|
||||
OPATTRS="entryUUID creatorsName createTimestamp modifiersName modifyTimestamp"
|
||||
|
||||
if test $SYNCPROV = syncprovno; then
|
||||
echo "Syncrepl provider overlay not available, test skipped"
|
||||
exit 0
|
||||
|
|
@ -116,6 +118,42 @@ fi
|
|||
echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
|
||||
sleep $SLEEP1
|
||||
|
||||
echo "Using ldapsearch to read all the entries from the producer..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
|
||||
'(objectclass=*)' '*' $OPATTRS > $MASTEROUT 2>&1
|
||||
RC=$?
|
||||
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed at producer ($RC)!"
|
||||
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
||||
exit $RC
|
||||
fi
|
||||
|
||||
echo "Using ldapsearch to read all the entries from the consumer..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT4 \
|
||||
'(objectclass=*)' '*' $OPATTRS > $SLAVEOUT 2>&1
|
||||
RC=$?
|
||||
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed at consumer ($RC)!"
|
||||
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
||||
exit $RC
|
||||
fi
|
||||
|
||||
echo "Filtering producer results..."
|
||||
$LDIFFILTER < $MASTEROUT > $MASTERFLT
|
||||
echo "Filtering consumer results..."
|
||||
$LDIFFILTER < $SLAVEOUT > $SLAVEFLT
|
||||
|
||||
echo "Comparing retrieved entries from producer and consumer..."
|
||||
$CMP $MASTERFLT $SLAVEFLT > $CMPOUT
|
||||
|
||||
if test $? != 0 ; then
|
||||
echo "test failed - producer and consumer databases differ"
|
||||
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Stopping the provider, sleeping 10 seconds and restarting it..."
|
||||
kill -HUP "$PID"
|
||||
wait $PID
|
||||
|
|
@ -203,10 +241,32 @@ drink: Coffee
|
|||
homepostaladdress: 844 Brown St. Apt. 4 $ Ann Arbor, MI 48104
|
||||
description: Very odd
|
||||
facsimiletelephonenumber: +1 313 555 7557
|
||||
facsimiletelephonenumber: +1 313 555 9998
|
||||
facsimiletelephonenumber: +1 313 555 9999
|
||||
telephonenumber: +1 313 555 8343
|
||||
mail: gjensen@mailgw.example.com
|
||||
homephone: +1 313 555 8844
|
||||
|
||||
# modify attribute with no matching rule (ITS#6458)
|
||||
dn: cn=Gern Jensen, ou=Information Technology Division, ou=People, dc=example,dc=com
|
||||
changetype: modify
|
||||
replace: facsimiletelephonenumber
|
||||
facsimiletelephonenumber: +1 313 555 9998
|
||||
facsimiletelephonenumber: +1 313 555 9999
|
||||
|
||||
dn: cn=Gern Jensen, ou=Information Technology Division, ou=People, dc=example,dc=com
|
||||
changetype: modify
|
||||
replace: facsimiletelephonenumber
|
||||
facsimiletelephonenumber: +1 313 555 9998
|
||||
facsimiletelephonenumber: +1 313 555 9999
|
||||
facsimiletelephonenumber: +1 313 555 7557
|
||||
|
||||
dn: cn=Gern Jensen, ou=Information Technology Division, ou=People, dc=example,dc=com
|
||||
changetype: modify
|
||||
replace: facsimiletelephonenumber
|
||||
facsimiletelephonenumber: +1 313 555 9998
|
||||
facsimiletelephonenumber: +1 313 555 9999
|
||||
|
||||
dn: ou=Retired, ou=People, dc=example,dc=com
|
||||
changetype: add
|
||||
objectclass: organizationalUnit
|
||||
|
|
@ -267,6 +327,42 @@ fi
|
|||
echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
|
||||
sleep $SLEEP1
|
||||
|
||||
echo "Using ldapsearch to read all the entries from the producer..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
|
||||
'(objectclass=*)' '*' $OPATTRS > $MASTEROUT 2>&1
|
||||
RC=$?
|
||||
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed at producer ($RC)!"
|
||||
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
||||
exit $RC
|
||||
fi
|
||||
|
||||
echo "Using ldapsearch to read all the entries from the consumer..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT4 \
|
||||
'(objectclass=*)' '*' $OPATTRS > $SLAVEOUT 2>&1
|
||||
RC=$?
|
||||
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed at consumer ($RC)!"
|
||||
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
||||
exit $RC
|
||||
fi
|
||||
|
||||
echo "Filtering producer results..."
|
||||
$LDIFFILTER < $MASTEROUT > $MASTERFLT
|
||||
echo "Filtering consumer results..."
|
||||
$LDIFFILTER < $SLAVEOUT > $SLAVEFLT
|
||||
|
||||
echo "Comparing retrieved entries from producer and consumer..."
|
||||
$CMP $MASTERFLT $SLAVEFLT > $CMPOUT
|
||||
|
||||
if test $? != 0 ; then
|
||||
echo "test failed - producer and consumer databases differ"
|
||||
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Stopping consumer to test recovery..."
|
||||
kill -HUP $SLAVEPID
|
||||
wait $SLAVEPID
|
||||
|
|
@ -316,6 +412,42 @@ KILLPIDS="$PID $SLAVEPID"
|
|||
echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
|
||||
sleep $SLEEP1
|
||||
|
||||
echo "Using ldapsearch to read all the entries from the producer..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
|
||||
'(objectclass=*)' '*' $OPATTRS > $MASTEROUT 2>&1
|
||||
RC=$?
|
||||
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed at producer ($RC)!"
|
||||
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
||||
exit $RC
|
||||
fi
|
||||
|
||||
echo "Using ldapsearch to read all the entries from the consumer..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT4 \
|
||||
'(objectclass=*)' '*' $OPATTRS > $SLAVEOUT 2>&1
|
||||
RC=$?
|
||||
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed at consumer ($RC)!"
|
||||
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
||||
exit $RC
|
||||
fi
|
||||
|
||||
echo "Filtering producer results..."
|
||||
$LDIFFILTER < $MASTEROUT > $MASTERFLT
|
||||
echo "Filtering consumer results..."
|
||||
$LDIFFILTER < $SLAVEOUT > $SLAVEFLT
|
||||
|
||||
echo "Comparing retrieved entries from producer and consumer..."
|
||||
$CMP $MASTERFLT $SLAVEFLT > $CMPOUT
|
||||
|
||||
if test $? != 0 ; then
|
||||
echo "test failed - producer and consumer databases differ"
|
||||
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test ! $BACKLDAP = "ldapno" ; then
|
||||
echo "Try updating the consumer slapd..."
|
||||
$LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT4 -w $PASSWD > \
|
||||
|
|
@ -351,8 +483,6 @@ EOMODS
|
|||
sleep $SLEEP1
|
||||
fi
|
||||
|
||||
OPATTRS="entryUUID creatorsName createTimestamp modifiersName modifyTimestamp"
|
||||
|
||||
echo "Using ldapsearch to read all the entries from the producer..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
|
||||
'(objectclass=*)' '*' $OPATTRS > $MASTEROUT 2>&1
|
||||
|
|
@ -375,8 +505,6 @@ if test $RC != 0 ; then
|
|||
exit $RC
|
||||
fi
|
||||
|
||||
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
||||
|
||||
echo "Filtering producer results..."
|
||||
$LDIFFILTER < $MASTEROUT > $MASTERFLT
|
||||
echo "Filtering consumer results..."
|
||||
|
|
@ -387,9 +515,12 @@ $CMP $MASTERFLT $SLAVEFLT > $CMPOUT
|
|||
|
||||
if test $? != 0 ; then
|
||||
echo "test failed - producer and consumer databases differ"
|
||||
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
||||
exit 1
|
||||
fi
|
||||
|
||||
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
||||
|
||||
echo ">>>>> Test succeeded"
|
||||
|
||||
test $KILLSERVERS != no && wait
|
||||
|
|
|
|||
Loading…
Reference in a new issue