From f0dac825977fa4f0f161810a811970c657fc9de9 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sat, 5 Nov 2005 14:45:38 +0000 Subject: [PATCH] allow per-target retry in searches (ITS#4150) --- tests/data/meta.out | 10 ++++++++++ tests/data/slapd-meta2.conf | 2 ++ tests/scripts/test035-meta | 34 +++++++++++++++++++++++++++++++++- 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/tests/data/meta.out b/tests/data/meta.out index 817440d020..97b9ed4f06 100644 --- a/tests/data/meta.out +++ b/tests/data/meta.out @@ -1411,3 +1411,13 @@ member: cn=Another Added Group,ou=Groups,o=Example,c=US # refldap://localhost:9016/cn=Somewhere,ou=Meta,dc=example,dc=com??sub +# searching filter="(member=cn=Another Added Group,ou=Groups,o=Example,c=US)" +# attrs="member" +# base="o=Example,c=US" +# with a timed out connection... +dn: cn=Another Added Group,ou=Groups,o=Example,c=US +member: cn=Added Group,ou=Groups,o=Example,c=US +member: cn=Another Added Group,ou=Groups,o=Example,c=US + +# refldap://localhost:9016/cn=Somewhere,ou=Meta,dc=example,dc=com??sub + diff --git a/tests/data/slapd-meta2.conf b/tests/data/slapd-meta2.conf index 2af5277231..5c018073aa 100644 --- a/tests/data/slapd-meta2.conf +++ b/tests/data/slapd-meta2.conf @@ -35,6 +35,8 @@ argsfile @TESTDIR@/slapd.2.args #rwmmod#modulepath ../servers/slapd/overlays/ #rwmmod#moduleload rwm.la +idletimeout 5 + ####################################################################### # database definitions ####################################################################### diff --git a/tests/scripts/test035-meta b/tests/scripts/test035-meta index 895644f873..6a2c2d2b2a 100755 --- a/tests/scripts/test035-meta +++ b/tests/scripts/test035-meta @@ -412,6 +412,38 @@ case $RC in ;; esac +echo "Waiting 10 seconds for cached connections to timeout..." +sleep 10 + +echo "Searching with a timed out connection..." +echo "# searching filter=\"$FILTER\"" >> $SEARCHOUT +echo "# attrs=\"member\"" >> $SEARCHOUT +echo "# base=\"$BASEDN\"" >> $SEARCHOUT +echo "# with a timed out connection..." >> $SEARCHOUT +$LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 -D "cn=Manager,$BASEDN" -w $PASSWD \ + -b "$BASEDN" "$FILTER" member \ + >> $SEARCHOUT 2>&1 +RC=$? +#if test $RC != 0 ; then +# echo "Search failed ($RC)!" +# test $KILLSERVERS != no && kill -HUP $KILLPIDS +# exit $RC +#fi +case $RC in + 0) + ;; + 51) + echo "### Hit LDAP_BUSY problem; you may want to re-run the test" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit 0 + ;; + *) + echo "Search failed ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit $RC + ;; +esac + echo "Filtering ldapsearch results..." . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT echo "Filtering original ldif used to create database..." @@ -576,7 +608,7 @@ RC=$? #if test $RC != 6 ; then # echo "Compare failed ($RC)!" # test $KILLSERVERS != no && kill -HUP $KILLPIDS -# exit $RC +# exit -1 #fi case $RC in 6) -- 2.39.5