X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=tests%2Fscripts%2Ftest047-ldap;h=ea4827c4d000a51ec4cd422b57ee2ea238f7553f;hb=fc1396fa2e94ee2e752fd7c3ea5bb22f6592398a;hp=82c02fb700e393ac2d268fc013c370457356e218;hpb=fd0176e49ca34b571c257ad7f404007f4f097eba;p=openldap diff --git a/tests/scripts/test047-ldap b/tests/scripts/test047-ldap index 82c02fb700..ea4827c4d0 100755 --- a/tests/scripts/test047-ldap +++ b/tests/scripts/test047-ldap @@ -2,7 +2,7 @@ # $OpenLDAP$ ## This work is part of OpenLDAP Software . ## -## Copyright 1998-2006 The OpenLDAP Foundation. +## Copyright 1998-2012 The OpenLDAP Foundation. ## All rights reserved. ## ## Redistribution and use in source and binary forms, with or without @@ -23,12 +23,17 @@ if test $BACKLDAP = ldapno ; then exit 0 fi +if test $RWM = rwmno ; then + echo "rwm (rewrite/remap) overlay not available, test skipped" + exit 0 +fi + rm -rf $TESTDIR mkdir -p $TESTDIR $DBDIR1 $DBDIR2 echo "Starting slapd on TCP/IP port $PORT1..." -. $CONFFILTER $BACKEND $MONITORDB < $CONF > $CONF1 +. $CONFFILTER $BACKEND $MONITORDB < $METACONF1 > $CONF1 $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 & PID=$! if test $WAIT != 0 ; then @@ -480,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 @@ -504,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 @@ -520,9 +525,9 @@ case $RC in esac echo "Filtering ldapsearch results..." -. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT +$LDIFFILTER < $SEARCHOUT > $SEARCHFLT echo "Filtering original ldif used to create database..." -. $LDIFFILTER < $METAOUT > $LDIFFLT +$LDIFFILTER < $METAOUT > $LDIFFLT echo "Comparing filter output..." $CMP $SEARCHFLT $LDIFFLT > $CMPOUT @@ -675,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" ;; *) @@ -698,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" ;; *) @@ -721,16 +730,18 @@ 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" ;; *) echo "Compare failed ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS - exit $RC + exit 1 ;; esac