From 299d802d45e98a7a067daaa0a681de0279cd6936 Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Sun, 29 Nov 2009 19:05:26 +0000 Subject: [PATCH] ITS#5810 support back-null --- tests/scripts/relay | 3 +-- tests/scripts/test011-glue-slapadd | 2 ++ tests/scripts/test024-unique | 5 ++++ tests/scripts/test025-limits | 5 ++++ tests/scripts/test032-chain | 4 +-- tests/scripts/test033-glue-syncrepl | 7 +---- tests/scripts/test034-translucent | 4 +-- tests/scripts/test035-meta | 38 ++++++++++++++------------ tests/scripts/test040-subtree-rename | 7 ++--- tests/scripts/test043-delta-syncrepl | 5 ---- tests/scripts/test047-ldap | 40 ++++++++++++++++------------ 11 files changed, 64 insertions(+), 56 deletions(-) diff --git a/tests/scripts/relay b/tests/scripts/relay index 4530f486de..bf88c15167 100755 --- a/tests/scripts/relay +++ b/tests/scripts/relay @@ -386,11 +386,10 @@ $LDAPCOMPARE -h $LOCALHOST -p $PORT1 \ "cn=Added User,ou=Alumni Association,ou=People,$BASEDN" \ "seeAlso:cn=All Staff,ou=Groups,$BASEDN" >> $TESTOUT 2>&1 RC=$? -if test $RC != 6 ; then +if test $RC != 6 && test $RC,$BACKEND != 5,null ; then echo "Compare failed ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS exit $RC fi test $KILLSERVERS != no && kill -HUP $KILLPIDS - diff --git a/tests/scripts/test011-glue-slapadd b/tests/scripts/test011-glue-slapadd index 8f47acaa9a..5385edb9b2 100755 --- a/tests/scripts/test011-glue-slapadd +++ b/tests/scripts/test011-glue-slapadd @@ -70,6 +70,7 @@ if test $? != 0 ; then exit 1 fi +if test $BACKEND != null ; then echo "Testing sizelimit..." $LDAPSEARCH -b "$BASEDN" -h $LOCALHOST -p $PORT1 -s one -z 2 > $SEARCHOUT 2>&1 RC=$? @@ -86,6 +87,7 @@ if test $RC = 0 ; then test $KILLSERVERS != no && kill -HUP $KILLPIDS exit 1 fi +fi test $KILLSERVERS != no && kill -HUP $KILLPIDS diff --git a/tests/scripts/test024-unique b/tests/scripts/test024-unique index 34ed826035..286677f85a 100755 --- a/tests/scripts/test024-unique +++ b/tests/scripts/test024-unique @@ -21,6 +21,11 @@ if test $UNIQUE = uniqueno; then exit 0 fi +if test $BACKEND = null; then + echo "Test does not support $BACKEND backend, test skipped" + exit 0 +fi + mkdir -p $TESTDIR $DBDIR1 $SLAPPASSWD -g -n >$CONFIGPWF diff --git a/tests/scripts/test025-limits b/tests/scripts/test025-limits index 9c97245032..91520fd378 100755 --- a/tests/scripts/test025-limits +++ b/tests/scripts/test025-limits @@ -29,6 +29,11 @@ if test $RC != 0 ; then exit $RC fi +if test $BACKEND = null; then + echo "Limits irrelevant to $BACKEND backend, test skipped" + exit 0 +fi + echo "Running slapindex to index slapd database..." . $CONFFILTER $BACKEND $MONITORDB < $LIMITSCONF > $CONF1 $SLAPINDEX -f $CONF1 diff --git a/tests/scripts/test032-chain b/tests/scripts/test032-chain index 66e91baa4b..1e55453fa4 100755 --- a/tests/scripts/test032-chain +++ b/tests/scripts/test032-chain @@ -158,7 +158,7 @@ for P in $PORT1 $PORT2 ; do > $TESTOUT 2>&1 RC=$? - if test $RC != 6 ; then + if test $RC != 6 && test $RC,$BACKEND != 5,null ; then echo "ldapcompare failed ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS exit $RC @@ -170,7 +170,7 @@ for P in $PORT1 $PORT2 ; do > $TESTOUT 2>&1 RC=$? - if test $RC != 6 ; then + if test $RC != 6 && test $RC,$BACKEND != 5,null ; then echo "ldapcompare failed ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS exit $RC diff --git a/tests/scripts/test033-glue-syncrepl b/tests/scripts/test033-glue-syncrepl index 85a9066133..b319c8c5b2 100755 --- a/tests/scripts/test033-glue-syncrepl +++ b/tests/scripts/test033-glue-syncrepl @@ -13,11 +13,6 @@ ## top-level directory of the distribution or, alternatively, at ## . -case $BACKEND in bdb | hdb | ldif) : ;; *) - echo "Test does not support $BACKEND backend, test skipped" - exit 0 -esac - echo "running defines.sh" . $SRCDIR/scripts/defines.sh @@ -178,7 +173,7 @@ sleep 1 $LDAPSEARCH -H $URI2 -b "$BABSDN" > $TESTOUT 2>&1 RC=$? -if test $RC = 0 ; then +if test $RC = 0 && test $BACKEND != null ; then echo "ldapsearch should have failed ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS exit -1 diff --git a/tests/scripts/test034-translucent b/tests/scripts/test034-translucent index 2c302e768f..f04808d903 100755 --- a/tests/scripts/test034-translucent +++ b/tests/scripts/test034-translucent @@ -185,7 +185,7 @@ $LDAPADD -v -v -v -D "$TRANSLUCENTROOT" -H $URI2 \ -w $PASSWD < $LDIFTRANSLUCENTADD > $TESTOUT 2>&1 RC=$? -if test $RC != 32 ; then +if test $RC != 32 && test $RC,$BACKEND != 0,null ; then echo "ldapadd failed ($RC), expected NO SUCH OBJECT!" grep "$FAILURE" $TESTOUT test $KILLSERVERS != no && kill -HUP $KILLPIDS @@ -198,7 +198,7 @@ $LDAPMODRDN -D "$TRANSLUCENTROOT" -H $URI2 -w $PASSWD > \ $TESTOUT 2>&1 'uid=fred,ou=users,o=translucent' 'uid=someguy' RC=$? -if test $RC != 32 ; then +if test $RC != 32 && test $RC,$BACKEND != 0,null ; then echo "ldapmodrdn failed ($RC), expected NO SUCH OBJECT!" grep "$FAILURE" $TESTOUT test $KILLSERVERS != no && kill -HUP $KILLPIDS diff --git a/tests/scripts/test035-meta b/tests/scripts/test035-meta index 1dce47a547..d2ba331be5 100755 --- a/tests/scripts/test035-meta +++ b/tests/scripts/test035-meta @@ -485,14 +485,14 @@ $LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 \ -b "$BASEDN" "(objectClass=*)" 1.1 \ >> $TESTOUT 2>&1 RC=$? -case $RC in - 0) +case $RC,$BACKEND in + 4,* | 0,null) + ;; + 0,*) echo "Search should have failed ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS exit -1 ;; - 4) - ;; *) echo "Search failed ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS @@ -509,14 +509,14 @@ $LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 \ -b "$BASEDN" -z 2 "(objectClass=*)" 1.1 \ >> $TESTOUT 2>&1 RC=$? -case $RC in - 0) +case $RC,$BACKEND in + 4,* | 0,null) + ;; + 0,*) echo "Search should have failed ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS exit -1 ;; - 4) - ;; *) echo "Search failed ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS @@ -667,13 +667,15 @@ RC=$? # test $KILLSERVERS != no && kill -HUP $KILLPIDS # exit $RC #fi -case $RC in - 0) +case $RC,$BACKEND in + 0,null) + ;; + 0,*) echo "WhoAmI should have failed ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS exit -1 ;; - 51) + 51,*) echo "### Hit LDAP_BUSY problem; you may want to re-run the test" ;; *) @@ -690,13 +692,15 @@ RC=$? # test $KILLSERVERS != no && kill -HUP $KILLPIDS # exit $RC #fi -case $RC in - 0) +case $RC,$BACKEND in + 0,null) + ;; + 0,*) echo "WhoAmI should have failed ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS exit -1 ;; - 51) + 51,*) echo "### Hit LDAP_BUSY problem; you may want to re-run the test" ;; *) @@ -713,10 +717,10 @@ RC=$? # test $KILLSERVERS != no && kill -HUP $KILLPIDS # exit -1 #fi -case $RC in - 6) +case $RC,$BACKEND in + 6,* | 5,null) ;; - 51) + 51,*) echo "### Hit LDAP_BUSY problem; you may want to re-run the test" ;; *) diff --git a/tests/scripts/test040-subtree-rename b/tests/scripts/test040-subtree-rename index 831c1e4c37..7528730b1e 100755 --- a/tests/scripts/test040-subtree-rename +++ b/tests/scripts/test040-subtree-rename @@ -16,13 +16,10 @@ echo "running defines.sh" . $SRCDIR/scripts/defines.sh -case $BACKEND in -hdb | ldif) - ;; -*) +if test $BACKEND = bdb ; then echo "subtree rename not supported by back-$BACKEND" exit 0 -esac +fi mkdir -p $TESTDIR $DBDIR1 diff --git a/tests/scripts/test043-delta-syncrepl b/tests/scripts/test043-delta-syncrepl index 3510952a82..c24e276307 100755 --- a/tests/scripts/test043-delta-syncrepl +++ b/tests/scripts/test043-delta-syncrepl @@ -13,11 +13,6 @@ ## top-level directory of the distribution or, alternatively, at ## . -if test "$BACKEND" != "bdb" && test "$BACKEND" != "hdb" ; then - echo "Test does not support $BACKEND" - exit 0 -fi - echo "running defines.sh" . $SRCDIR/scripts/defines.sh diff --git a/tests/scripts/test047-ldap b/tests/scripts/test047-ldap index 66322df549..492ec9cbc3 100755 --- a/tests/scripts/test047-ldap +++ b/tests/scripts/test047-ldap @@ -485,14 +485,14 @@ $LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 \ -b "$BASEDN" "(objectClass=*)" 1.1 \ >> $TESTOUT 2>&1 RC=$? -case $RC in - 0) +case $RC,$BACKEND in + 4,* | 0,null) + ;; + 0,*) echo "Search should have failed ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS exit -1 ;; - 4) - ;; *) echo "Search failed ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS @@ -509,14 +509,14 @@ $LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 \ -b "$BASEDN" -z 2 "(objectClass=*)" 1.1 \ >> $TESTOUT 2>&1 RC=$? -case $RC in - 0) +case $RC,$BACKEND in + 4,* | 0,null) + ;; + 0,*) echo "Search should have failed ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS exit -1 ;; - 4) - ;; *) echo "Search failed ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS @@ -680,13 +680,15 @@ RC=$? # test $KILLSERVERS != no && kill -HUP $KILLPIDS # exit $RC #fi -case $RC in - 0) +case $RC,$BACKEND in + 0,null) + ;; + 0,*) echo "WhoAmI should have failed ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS exit -1 ;; - 51) + 51,*) echo "### Hit LDAP_BUSY problem; you may want to re-run the test" ;; *) @@ -703,13 +705,15 @@ RC=$? # test $KILLSERVERS != no && kill -HUP $KILLPIDS # exit $RC #fi -case $RC in - 0) +case $RC,$BACKEND in + 0,null) + ;; + 0,*) echo "WhoAmI should have failed ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS exit -1 ;; - 51) + 51,*) echo "### Hit LDAP_BUSY problem; you may want to re-run the test" ;; *) @@ -726,10 +730,12 @@ RC=$? # test $KILLSERVERS != no && kill -HUP $KILLPIDS # exit -1 #fi -case $RC in - 6) +case $RC,$BACKEND in + 5,null) ;; - 51) + 6,*) + ;; + 51,*) echo "### Hit LDAP_BUSY problem; you may want to re-run the test" ;; *) -- 2.39.5