From: <svn...@op...> - 2009-07-27 17:28:09
|
Author: scriptor Date: Mon Jul 27 19:27:54 2009 New Revision: 5705 URL: http://www.opensync.org/changeset/5705 Log: I have fixed the wrong exit values in check_ldap_base_entries_objtype and check_ldap_read_entryCSN. Modified: plugins/ldap-sync/tests/check_ldap_base_entries_objtype plugins/ldap-sync/tests/check_ldap_read_entryCSN Modified: plugins/ldap-sync/tests/check_ldap_base_entries_objtype ============================================================================== --- plugins/ldap-sync/tests/check_ldap_base_entries_objtype Mon Jul 27 19:22:31 2009 (r5704) +++ plugins/ldap-sync/tests/check_ldap_base_entries_objtype Mon Jul 27 19:27:54 2009 (r5705) @@ -51,7 +51,7 @@ echo -e "$FILE:$LINENO: ERROR: ldapsearch could not find \"$BASE_CONTACT\". Exiting." echo "Command was:" echo "$LDAPSEARCH $AUTH -LLL -s base -b $BASE_CONTACT" - exit + exit 1 fi @@ -59,7 +59,7 @@ rv=$? if test $rv -ne 0; then echo -e "$FILE:$LINENO: ERROR: ldapsearch could not find \"$BASE_EVENT\". Exiting." - exit + exit 1 fi @@ -67,7 +67,7 @@ rv=$? if test $rv -ne 0; then echo -e "$FILE:$LINENO: ERROR: ldapsearch could not find \"$BASE_TODO\". Exiting." - exit + exit 1 fi @@ -75,7 +75,7 @@ rv=$? if test $rv -ne 0; then echo -e "$FILE:$LINENO: ERROR: ldapsearch could not find \"$BASE_NOTE\". Exiting." - exit + exit 1 fi Modified: plugins/ldap-sync/tests/check_ldap_read_entryCSN ============================================================================== --- plugins/ldap-sync/tests/check_ldap_read_entryCSN Mon Jul 27 19:22:31 2009 (r5704) +++ plugins/ldap-sync/tests/check_ldap_read_entryCSN Mon Jul 27 19:27:54 2009 (r5705) @@ -48,40 +48,73 @@ echo "AUTH = \"$AUTH\"" + + + + +############### contact ################### output=`$LDAPSEARCH $AUTH -LLL -s base -b $BASE_CONTACT entryCSN` rv=$? if test $rv -ne 0; then echo -e "$FILE:$LINENO: ERROR: ldapsearch could not search \"$BASE_CONTACT\" for entryCSN. Exiting." echo "Command was:" echo "$LDAPSEARCH $AUTH -LLL -s base -b $BASE_CONTACT entryCSN" - exit + exit 1; fi echo $output | grep -q "entryCSN" rv=$? if test $rv -ne 0; then - echo -e "$FILE:$LINENO: ERROR: ldapsearch could not find entryCSN with \"$BASE_CONTACT\". Exiting." - exit -fi + echo -e "$FILE:$LINENO: INFO: ldapsearch could not find entryCSN with \"$BASE_CONTACT\". Falling back to modifyTimestamp." + output=`$LDAPSEARCH $AUTH -LLL -s base -b $BASE_CONTACT modifyTimestamp` + rv=$? + if test $rv -ne 0; then + echo -e "$FILE:$LINENO: ERROR: ldapsearch could not search \"$BASE_CONTACT\" for modifyTimestamp. Exiting." + echo "Command was:" + echo "$LDAPSEARCH $AUTH -LLL -s base -b $BASE_CONTACT modifyTimestamp" + exit 1; + fi + echo $output | grep -q "modifyTimestamp" + rv=$? + if test $rv -ne 0; then + echo -e "$FILE:$LINENO: ERROR: ldapsearch could not even find modifyTimestamp with \"$BASE_CONTACT\". Exiting." + exit 1; + fi +fi +############### event ################### output=$($LDAPSEARCH $AUTH -LLL -s base -b $BASE_EVENT entryCSN) rv=$? if test $rv -ne 0; then echo -e "$FILE:$LINENO: ERROR: ldapsearch could not search \"$BASE_EVENT\" for entryCSN. Exiting." - exit + exit 1; fi echo $output | grep -q "entryCSN" rv=$? if test $rv -ne 0; then - echo -e "$FILE:$LINENO: ERROR: ldapsearch could not find entryCSN with \"$BASE_EVENT\". Exiting." - exit -fi + echo -e "$FILE:$LINENO: INFO: ldapsearch could not find entryCSN with \"$BASE_EVENT\". Falling back to modifyTimestamp." + output=`$LDAPSEARCH $AUTH -LLL -s base -b $BASE_EVENT modifyTimestamp` + rv=$? + if test $rv -ne 0; then + echo -e "$FILE:$LINENO: ERROR: ldapsearch could not search \"$BASE_EVENT\" for modifyTimestamp. Exiting." + echo "Command was:" + echo "$LDAPSEARCH $AUTH -LLL -s base -b $BASE_EVENT modifyTimestamp" + exit 1; + fi + echo $output | grep -q "modifyTimestamp" + rv=$? + if test $rv -ne 0; then + echo -e "$FILE:$LINENO: ERROR: ldapsearch could not even find modifyTimestamp with \"$BASE_EVENT\". Exiting." + exit 1; + fi + +fi @@ -90,40 +123,66 @@ +############### todo ################### output=$($LDAPSEARCH $AUTH -LLL -s base -b $BASE_TODO entryCSN) rv=$? if test $rv -ne 0; then echo -e "$FILE:$LINENO: ERROR: ldapsearch could not search \"$BASE_TODO\" for entryCSN. Exiting." - exit + exit 1 fi echo $output | grep -q "entryCSN" rv=$? if test $rv -ne 0; then - echo -e "$FILE:$LINENO: ERROR: ldapsearch could not find entryCSN with \"$BASE_TODO\". Exiting." - exit -fi - - - - + echo -e "$FILE:$LINENO: INFO: ldapsearch could not find entryCSN with \"$BASE_TODO\". Falling back to modifyTimestamp." + output=`$LDAPSEARCH $AUTH -LLL -s base -b $BASE_TODO modifyTimestamp` + rv=$? + if test $rv -ne 0; then + echo -e "$FILE:$LINENO: ERROR: ldapsearch could not search \"$BASE_TODO\" for modifyTimestamp. Exiting." + echo "Command was:" + echo "$LDAPSEARCH $AUTH -LLL -s base -b $BASE_TODO modifyTimestamp" + exit 1; + fi + echo $output | grep -q "modifyTimestamp" + rv=$? + if test $rv -ne 0; then + echo -e "$FILE:$LINENO: ERROR: ldapsearch could not even find modifyTimestamp with \"$BASE_TODO\". Exiting." + exit 1; + fi +fi +############### note ################### output=$($LDAPSEARCH $AUTH -LLL -s base -b $BASE_NOTE entryCSN) rv=$? if test $rv -ne 0; then echo -e "$FILE:$LINENO: ERROR: ldapsearch could not search \"$BASE_NOTE\" for entryCSN. Exiting." - exit + exit 1 fi echo $output | grep -q "entryCSN" rv=$? if test $rv -ne 0; then - echo -e "$FILE:$LINENO: ERROR: ldapsearch could not find entryCSN with \"$BASE_NOTE\". Exiting." - exit + echo -e "$FILE:$LINENO: INFO: ldapsearch could not find entryCSN with \"$BASE_NOTE\". Falling back to modifyTimestamp." + output=`$LDAPSEARCH $AUTH -LLL -s base -b $BASE_NOTE modifyTimestamp` + rv=$? + if test $rv -ne 0; then + echo -e "$FILE:$LINENO: ERROR: ldapsearch could not search \"$BASE_NOTE\" for modifyTimestamp. Exiting." + echo "Command was:" + echo "$LDAPSEARCH $AUTH -LLL -s base -b $BASE_NOTE modifyTimestamp" + exit 1; + fi + + echo $output | grep -q "modifyTimestamp" + rv=$? + if test $rv -ne 0; then + echo -e "$FILE:$LINENO: ERROR: ldapsearch could not even find modifyTimestamp with \"$BASE_NOTE\". Exiting." + exit 1; + fi + fi |