X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=tests%2Fscripts%2Ftest044-dynlist;h=e1a5487f3b97770458fc6e15c391b0dfa9764188;hb=e849a6ebb8e2db71e4d32c5138abe6616d5fe693;hp=faf24eeee803ac8e382ffaf497ea9de764c3121f;hpb=26d802ee538319051b11633e6059047338b43d03;p=openldap diff --git a/tests/scripts/test044-dynlist b/tests/scripts/test044-dynlist index faf24eeee8..e1a5487f3b 100755 --- a/tests/scripts/test044-dynlist +++ b/tests/scripts/test044-dynlist @@ -1,7 +1,7 @@ #! /bin/sh ## This work is part of OpenLDAP Software . ## -## Copyright 1998-2005 The OpenLDAP Foundation. +## Copyright 1998-2006 The OpenLDAP Foundation. ## All rights reserved. ## ## Redistribution and use in source and binary forms, with or without @@ -31,8 +31,10 @@ if test $RC != 0 ; then exit $RC fi -echo "Running slapindex to index slapd database..." . $CONFFILTER $BACKEND $MONITORDB < $DYNLISTCONF > $CONF1 +echo "dynlist-attrset groupOfURLs memberURL" >> $CONF1 + +echo "Running slapindex to index slapd database..." $SLAPINDEX -f $CONF1 RC=$? if test $RC != 0 ; then @@ -151,8 +153,36 @@ case $RC in 0) echo "ldapcompare returned success ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit -1 + ;; +*) + echo "ldapcompare failed ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS exit $RC ;; +esac +echo "" >> $SEARCHOUT + +echo "Testing list compare (should return FALSE)..." +echo "# Testing list compare (should return FALSE)..." >> $SEARCHOUT +$LDAPCOMPARE -h $LOCALHOST -p $PORT1 \ + "cn=Dynamic List,$LISTDN" "cn:FALSE" \ + >> $SEARCHOUT 2>&1 +RC=$? +case $RC in +5) + echo "ldapcompare returned FALSE ($RC)" + ;; +6) + echo "ldapcompare returned TRUE ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit $RC + ;; +0) + echo "ldapcompare returned success ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit -1 + ;; *) echo "ldapcompare failed ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS @@ -161,6 +191,37 @@ case $RC in esac echo "" >> $SEARCHOUT +echo "Testing list compare (should return UNDEFINED)..." +echo "# Testing list compare (should return UNDEFINED)..." >> $SEARCHOUT +$LDAPCOMPARE -h $LOCALHOST -p $PORT1 \ + "cn=Dynamic List,$LISTDN" "dc:UNDEFINED" \ + >> $SEARCHOUT 2>&1 +RC=$? +case $RC in +5) + echo "ldapcompare returned FALSE ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit $RC + ;; +6) + echo "ldapcompare returned TRUE ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit $RC + ;; +16|32) + echo "ldapcompare returned UNDEFINED ($RC)" + ;; +0) + echo "ldapcompare returned success ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit -1 + ;; +*) + echo "ldapcompare failed ($RC)" + ;; +esac +echo "" >> $SEARCHOUT + echo "Testing list compare with manageDSAit..." echo "# Testing list compare with manageDSAit..." >> $SEARCHOUT $LDAPCOMPARE -h $LOCALHOST -p $PORT1 -MM \ @@ -179,7 +240,7 @@ case $RC in 0) echo "ldapcompare returned success ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS - exit $RC + exit -1 ;; *) echo "ldapcompare failed ($RC)!" @@ -194,7 +255,8 @@ kill -HUP $KILLPIDS wait $KILLPIDS echo "Reconfiguring slapd..." -echo "dynlist-member-ad member" >> $CONF1 +. $CONFFILTER $BACKEND $MONITORDB < $DYNLISTCONF > $CONF1 +echo "dynlist-attrset groupOfURLs memberURL member" >> $CONF1 echo "==========================================================" >> $LOG1 @@ -303,8 +365,36 @@ case $RC in 0) echo "ldapcompare returned success ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit -1 + ;; +*) + echo "ldapcompare failed ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS exit $RC ;; +esac +echo "" >> $SEARCHOUT + +echo "Testing list compare (should return FALSE)..." +echo "# Testing list compare (should return FALSE)..." >> $SEARCHOUT +$LDAPCOMPARE -h $LOCALHOST -p $PORT1 \ + "cn=Dynamic List of Members,$LISTDN" "member:cn=Foo Bar" \ + >> $SEARCHOUT 2>&1 +RC=$? +case $RC in +5) + echo "ldapcompare returned FALSE ($RC)" + ;; +6) + echo "ldapcompare returned TRUE ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit $RC + ;; +0) + echo "ldapcompare returned success ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit -1 + ;; *) echo "ldapcompare failed ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS @@ -331,7 +421,7 @@ case $RC in 0) echo "ldapcompare returned success ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS - exit $RC + exit -1 ;; *) echo "ldapcompare failed ($RC)!" @@ -358,4 +448,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0