From: <svn...@op...> - 2009-03-30 18:27:50
|
Author: scriptor Date: Mon Mar 30 20:27:37 2009 New Revision: 5469 URL: http://www.opensync.org/changeset/5469 Log: Additional tests using osynctool instead of osyncplugin. This way libopensync exit errors get detected, as well. Which is not possible with osyncplugin. The LDAP configuration file used by the test scripts can now be configured in test.conf (variable $CFG). Note: The $AUTH variable is used by the libldap utilities only. It must correspond with the authentication settings in the LDAP configuration file (variable $CFG). Or, at least both authentication settings must lead to write access to the LDAP server (so two different methods are very well possible). Added: plugins/ldap-sync/tests/check_osyncplugin1 (contents, props changed) plugins/ldap-sync/tests/check_osynctool_add_file_and_sync (contents, props changed) plugins/ldap-sync/tests/check_osynctool_add_file_and_valgrind_and_sync (contents, props changed) plugins/ldap-sync/tests/check_osynctool_add_ldif_and_sync (contents, props changed) plugins/ldap-sync/tests/check_osynctool_add_ldif_and_valgrind_and_sync (contents, props changed) plugins/ldap-sync/tests/check_osynctool_common.inc (contents, props changed) plugins/ldap-sync/tests/check_osynctool_file1 (contents, props changed) plugins/ldap-sync/tests/file-sync.conf plugins/ldap-sync/tests/ldap-sync.conf plugins/ldap-sync/tests/note2.xml Modified: plugins/ldap-sync/tests/CMakeLists.txt plugins/ldap-sync/tests/check_slowsync plugins/ldap-sync/tests/check_sync plugins/ldap-sync/tests/note1.xml plugins/ldap-sync/tests/opensync.suppr plugins/ldap-sync/tests/remove_test_ldifs plugins/ldap-sync/tests/test.conf Modified: plugins/ldap-sync/tests/CMakeLists.txt ============================================================================== --- plugins/ldap-sync/tests/CMakeLists.txt Mon Mar 30 20:23:30 2009 (r5468) +++ plugins/ldap-sync/tests/CMakeLists.txt Mon Mar 30 20:27:37 2009 (r5469) @@ -138,6 +138,8 @@ ADD_TEST( stylesheet2.12 ${TESTDIR}/check_stylesheet2 ${XSLDIR}/xmlformat_note2ldap_note.xsl ${TESTDIR}/note1.xml) + ADD_TEST( stylesheet2.13 ${TESTDIR}/check_stylesheet2 ${XSLDIR}/xmlformat_note2ldap_note.xsl ${TESTDIR}/note2.xml) + ENDIF (XSLTPROC_EXECUTABLE) ENDIF (XMLLINT_EXECUTABLE) @@ -187,6 +189,8 @@ ADD_TEST( stylesheet4.7 ${TESTDIR}/check_stylesheet4 ${XSLDIR}/xmlformat_note2ldap_note.xsl ${XSLDIR}/ldap_note2xmlformat_note.xsl ${SCHEMADIR}/xmlformat-note.xsd ${XMLDIR}/note1.xml) + ADD_TEST( stylesheet4.8 ${TESTDIR}/check_stylesheet4 ${XSLDIR}/xmlformat_note2ldap_note.xsl ${XSLDIR}/ldap_note2xmlformat_note.xsl ${SCHEMADIR}/xmlformat-note.xsd ${XMLDIR}/note2.xml) + ENDIF (XSLTPROC_EXECUTABLE) ENDIF (XMLLINT_EXECUTABLE) @@ -224,7 +228,9 @@ ADD_TEST( stylesheet5.13 ${TESTDIR}/check_stylesheet5 ${XMLDIR}/note1.xml ${XSLDIR}/xmlformat_note2ldap_note.xsl ${XSLDIR}/ldap_note2xmlformat_note.xsl ) - # ADD_TEST( stylesheet5.14 ${TESTDIR}/check_stylesheet5 ${XMLDIR}/ldap_note1.xml ${XSLDIR}/ldap_note2xmlformat_note.xsl ${XSLDIR}/xmlformat_note2ldap_note.xsl ) + ADD_TEST( stylesheet5.14 ${TESTDIR}/check_stylesheet5 ${XMLDIR}/note2.xml ${XSLDIR}/xmlformat_note2ldap_note.xsl ${XSLDIR}/ldap_note2xmlformat_note.xsl ) + + # ADD_TEST( stylesheet5.15 ${TESTDIR}/check_stylesheet5 ${XMLDIR}/ldap_note1.xml ${XSLDIR}/ldap_note2xmlformat_note.xsl ${XSLDIR}/xmlformat_note2ldap_note.xsl ) ENDIF (XSLTPROC_EXECUTABLE) ENDIF (XMLLINT_EXECUTABLE) @@ -236,10 +242,10 @@ ########################################################## # Can the plugin be found, at all? # Using osyncplugin and osynctool from libopensync. -ADD_TEST( plugin1 ${TESTDIR}/check_plugin1 ) -ADD_TEST( plugin2 ${TESTDIR}/check_plugin2 ) -ADD_TEST( plugin3 ${TESTDIR}/check_plugin3 ) - +ADD_TEST( plugin1 ${TESTDIR}/check_osyncplugin1 ) +ADD_TEST( plugin2 ${TESTDIR}/check_osynctool1 ) +ADD_TEST( plugin3 ${TESTDIR}/check_osynctool2 ) +ADD_TEST( plugin4 ${TESTDIR}/check_osynctool_file1 ) ########################################################## @@ -410,7 +416,7 @@ ############################ -# Now with valgrind... +# Now osyncplugin with valgrind... IF (LDAPADD_EXECUTABLE) IF (LDAPMODIFY_EXECUTABLE) IF (LDAPDELETE_EXECUTABLE) @@ -436,5 +442,82 @@ + +########################################## +# Now we have a look at possible exit errors. +# We use osynctool, as osyncplugin does not seem to +# able to care about exit errors. +IF (LDAPADD_EXECUTABLE) + IF (LDAPMODIFY_EXECUTABLE) + IF (LDAPDELETE_EXECUTABLE) + + ADD_TEST( osynctool_add_contact1_ldif ${TESTDIR}/check_osynctool_add_ldif_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "contact" "${TESTDIR}/contact1.ldif" ) + + #ADD_TEST( osynctool_add_contact2_ldif ${TESTDIR}/check_osynctool_add_ldif_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "contact" "${TESTDIR}/contact2.ldif" ) + + ADD_TEST( osynctool_add_event_ldif ${TESTDIR}/check_osynctool_add_ldif_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "event" "${TESTDIR}/event1.ldif" ) + + #ADD_TEST( osynctool_add_todo_ldif ${TESTDIR}/check_osynctool_add_ldif_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "todo" "${TESTDIR}/todo1.ldif" ) + + ADD_TEST( osynctool_add_note_ldif ${TESTDIR}/check_osynctool_add_ldif_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "note" "${TESTDIR}/note1.ldif" ) + + + ADD_TEST( osynctool_add_contact1_xmlfile ${TESTDIR}/check_osynctool_add_file_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "contact" "${TESTDIR}/contact1.xml" ) + + #ADD_TEST( osynctool_add_contact2_xmlfile ${TESTDIR}/check_osynctool_add_file_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "contact" "${TESTDIR}/contact2.xml" ) + + #ADD_TEST( osynctool_add_event_xmlfile ${TESTDIR}/check_osynctool_add_file_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "event" "${TESTDIR}/event1.xml" ) + + #ADD_TEST( osynctool_add_todo_xmlfile ${TESTDIR}/check_osynctool_add_file_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "todo" "${TESTDIR}/todo1.xml" ) + + #ADD_TEST( osynctool_add_note_xmlfile ${TESTDIR}/check_osynctool_add_file_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "note" "${TESTDIR}/note1.xml" ) + + + ENDIF (LDAPDELETE_EXECUTABLE) + ENDIF (LDAPMODIFY_EXECUTABLE) +ENDIF (LDAPADD_EXECUTABLE) + + + + +############################ +# Now osynctool with valgrind... +IF (LDAPADD_EXECUTABLE) + IF (LDAPMODIFY_EXECUTABLE) + IF (LDAPDELETE_EXECUTABLE) + IF (VALGRIND_EXECUTABLE) + + #ADD_TEST( valgrind_osynctool_add_contact1_ldif ${TESTDIR}/check_osynctool_add_ldif_and_valgrind_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "contact" "${TESTDIR}/contact1.ldif" ) + + #ADD_TEST( valgrind_osynctool_add_contact2_ldif ${TESTDIR}/check_osynctool_add_ldif_and_valgrind_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "contact" "${TESTDIR}/contact2.ldif" ) + + #ADD_TEST( valgrind_osynctool_add_event_ldif ${TESTDIR}/check_osynctool_add_ldif_and_valgrind_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "event" "${TESTDIR}/event1.ldif" ) + + #ADD_TEST( valgrind_osynctool_add_todo_ldif ${TESTDIR}/check_osynctool_add_ldif_and_valgrind_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "todo" "${TESTDIR}/todo1.ldif" ) + + #ADD_TEST( valgrind_osynctool_add_note_ldif ${TESTDIR}/check_osynctool_add_ldif_and_valgrind_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "note" "${TESTDIR}/note1.ldif" ) + + + #ADD_TEST( valgrind_osynctool_add_contact1_xmlfile ${TESTDIR}/check_osynctool_add_file_and_valgrind_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "contact" "${TESTDIR}/contact1.xml" ) + + #ADD_TEST( valgrind_osynctool_add_contact2_xmlfile ${TESTDIR}/check_osynctool_add_file_and_valgrind_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "contact" "${TESTDIR}/contact2.xml" ) + + #ADD_TEST( valgrind_osynctool_add_event_xmlfile ${TESTDIR}/check_osynctool_add_file_and_valgrind_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "event" "${TESTDIR}/event1.xml" ) + + #ADD_TEST( valgrind_osynctool_add_todo_xmlfile ${TESTDIR}/check_osynctool_add_file_and_valgrind_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "todo" "${TESTDIR}/todo1.xml" ) + + #ADD_TEST( valgrind_osynctool_add_note_xmlfile ${TESTDIR}/check_osynctool_add_file_and_valgrind_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "note" "${TESTDIR}/note1.xml" ) + + + + + ENDIF (VALGRIND_EXECUTABLE) + ENDIF (LDAPDELETE_EXECUTABLE) + ENDIF (LDAPMODIFY_EXECUTABLE) +ENDIF (LDAPADD_EXECUTABLE) + + + + # vim:tw=0:nowrap Added: plugins/ldap-sync/tests/check_osyncplugin1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/check_osyncplugin1 Mon Mar 30 20:27:37 2009 (r5469) @@ -0,0 +1,46 @@ +#!/bin/bash + + +FILE=$0 +OSYNCPLUGIN=$(which osyncplugin 2>/dev/null) +if test ! -f "$OSYNCPLUGIN"; then + echo "$FILE:$LINENO: ERROR: osyncplugin could not be found. Exiting." + exit 1 +fi + +if test ! -x "$OSYNCPLUGIN"; then + echo "$FILE:$LINENO: ERROR: osyncplugin could be found, but it is not executable. Exiting." + exit 1 +fi + + +SOURCE_DIR=`dirname $FILE` +if test ! -d "$SOURCE_DIR"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR\" is not a directory. Exiting." + exit 1 +fi + +if test ! -r "$SOURCE_DIR/test.conf"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR/test.conf\" could not be read. Exiting." + exit 1 +fi + +source "$SOURCE_DIR/test.conf" + + + +if test -n "$TRACE_FILES"; then + echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + export OSYNC_TRACE="$TRACE_FILES" +fi + + + + + +$OSYNCPLUGIN --pluginlist | grep -q "ldap-sync" +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: ldap-sync was not included in pluginlist. Exiting." + exit 1 +fi Added: plugins/ldap-sync/tests/check_osynctool_add_file_and_sync ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/check_osynctool_add_file_and_sync Mon Mar 30 20:27:37 2009 (r5469) @@ -0,0 +1,105 @@ +#!/bin/bash + +set -x + +FILE=$0 +OSYNCTOOL=$(which osynctool 2>/dev/null) +if test ! -f "$OSYNCTOOL"; then + echo "$FILE:$LINENO: ERROR: osynctool could not be found. Exiting." + exit 1 +fi + +if test ! -x "$OSYNCTOOL"; then + echo "$FILE:$LINENO: ERROR: osynctool could be found, but it is not executable. Exiting." + exit 1 +fi + + + +PLUGINNAME="ldap-sync" +PLUGINPATH="$1/src" +CFG="$2/src/$PLUGINNAME" +OBJECTTYPE="$3" +XMLFILE="$4" + + +SOURCE_DIR=`dirname $FILE` +if test ! -d "$SOURCE_DIR"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR\" is not a directory. Exiting." + exit 1 +fi + +if test ! -r "$SOURCE_DIR/test.conf"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR/test.conf\" could not be read. Exiting." + exit 1 +fi + +if test ! -r "$SOURCE_DIR/check_osynctool_common.inc"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR/test.conf\" could not be read. Exiting." + exit 1 +fi + +source "$SOURCE_DIR/test.conf" +source "$SOURCE_DIR/check_osynctool_common.inc" + +echo "PLUGINPATH = \"$PLUGINPATH\"" +echo "CFG = \"$CFG\"" + + +if test -n "$TRACE_FILES"; then + echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + export OSYNC_TRACE="$TRACE_FILES" +fi + + +if test -z "$XMLFILE"; then + echo "$FILE:$LINENO: ERROR: \$XMLFILE is empty. Exiting." + exit 1 +fi + +if test ! -f "$XMLFILE"; then + echo "$FILE:$LINENO: ERROR: \"$XMLFILE\" could not be found. Exiting." + exit 1 +fi + +if test ! -r "$XMLFILE"; then + echo "$FILE:$LINENO: ERROR: \"$XMLFILE\" could be found, but it is not readable. Exiting." + exit 1 +fi + + +TMPDIR=`mktemp -d /tmp/ldap_sync_test.XXXXXX` || exit 1 +echo "TMPDIR = \"$TMPDIR\"" + + + + +# Set up test group +prologue; + +# Empty LDAP DIT +$SOURCE_DIR/remove_test_ldifs + +# Remove entry from directory used by file-sync +remove_file_by_objtype "$OBJECTTYPE" + +# Add *.ldif +add_file "$OBJECTTYPE" "$XMLFILE" +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: add_file() has failed." + exit 1; +fi + +# osynctool should synchronize only one particular object type: +enable_only "$OBJECTTYPE" + +# Trigger synchronization +slow_sync "$OBJECTTYPE" +rv=$? + +# Shut down test group +epilogue + + +exit $rv Added: plugins/ldap-sync/tests/check_osynctool_add_file_and_valgrind_and_sync ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/check_osynctool_add_file_and_valgrind_and_sync Mon Mar 30 20:27:37 2009 (r5469) @@ -0,0 +1,112 @@ +#!/bin/bash + +set -x + +FILE=$0 +OSYNCTOOL=$(which osynctool 2>/dev/null) +if test ! -f "$OSYNCTOOL"; then + echo "$FILE:$LINENO: ERROR: osynctool could not be found. Exiting." + exit 1 +fi + +if test ! -x "$OSYNCTOOL"; then + echo "$FILE:$LINENO: ERROR: osynctool could be found, but it is not executable. Exiting." + exit 1 +fi + + + +PLUGINNAME="ldap-sync" +PLUGINPATH="$1/src" +CFG="$2/src/$PLUGINNAME" +OBJECTTYPE="$3" +XMLFILE="$4" + + +SOURCE_DIR=`dirname $FILE` +if test ! -d "$SOURCE_DIR"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR\" is not a directory. Exiting." + exit 1 +fi + +if test ! -r "$SOURCE_DIR/test.conf"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR/test.conf\" could not be read. Exiting." + exit 1 +fi + +if test ! -r "$SOURCE_DIR/check_osynctool_common.inc"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR/test.conf\" could not be read. Exiting." + exit 1 +fi + +source "$SOURCE_DIR/test.conf" +source "$SOURCE_DIR/check_osynctool_common.inc" + +echo "PLUGINPATH = \"$PLUGINPATH\"" +echo "CFG = \"$CFG\"" + + +if test -n "$TRACE_FILES"; then + echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + export OSYNC_TRACE="$TRACE_FILES" +fi + + +if test -z "$XMLFILE"; then + echo "$FILE:$LINENO: ERROR: \$XMLFILE is empty. Exiting." + exit 1 +fi + +if test ! -f "$XMLFILE"; then + echo "$FILE:$LINENO: ERROR: \"$XMLFILE\" could not be found. Exiting." + exit 1 +fi + +if test ! -r "$XMLFILE"; then + echo "$FILE:$LINENO: ERROR: \"$XMLFILE\" could be found, but it is not readable. Exiting." + exit 1 +fi + + +if test -z "$VALGRIND"; then + echo "$FILE:$LINENO: ERROR: \$VALGRIND is empty. Exiting."; + exit 1; +fi + + + +TMPDIR=`mktemp -d /tmp/ldap_sync_test.XXXXXX` || exit 1 +echo "TMPDIR = \"$TMPDIR\"" + + + + +# Set up test group +prologue; + +# Empty LDAP DIT +$SOURCE_DIR/remove_test_ldifs + +# Remove entry from directory used by file-sync +remove_file_by_objtype "$OBJECTTYPE" + +# Add *.ldif +add_file "$OBJECTTYPE" "$XMLFILE" +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: add_file() has failed." + exit 1; +fi + +# osynctool should synchronize only one particular object type: +enable_only "$OBJECTTYPE" + +# Trigger synchronization +valgrind_slow_sync "$OBJECTTYPE" +rv=$? + +# Shut down test group +epilogue + + +exit $rv Added: plugins/ldap-sync/tests/check_osynctool_add_ldif_and_sync ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/check_osynctool_add_ldif_and_sync Mon Mar 30 20:27:37 2009 (r5469) @@ -0,0 +1,105 @@ +#!/bin/bash + +set -x + +FILE=$0 +OSYNCTOOL=$(which osynctool 2>/dev/null) +if test ! -f "$OSYNCTOOL"; then + echo "$FILE:$LINENO: ERROR: osynctool could not be found. Exiting." + exit 1 +fi + +if test ! -x "$OSYNCTOOL"; then + echo "$FILE:$LINENO: ERROR: osynctool could be found, but it is not executable. Exiting." + exit 1 +fi + + + +PLUGINNAME="ldap-sync" +PLUGINPATH="$1/src" +CFG="$2/src/$PLUGINNAME" +OBJECTTYPE="$3" +LDIF="$4" + + +SOURCE_DIR=`dirname $FILE` +if test ! -d "$SOURCE_DIR"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR\" is not a directory. Exiting." + exit 1 +fi + +if test ! -r "$SOURCE_DIR/test.conf"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR/test.conf\" could not be read. Exiting." + exit 1 +fi + +if test ! -r "$SOURCE_DIR/check_osynctool_common.inc"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR/test.conf\" could not be read. Exiting." + exit 1 +fi + +source "$SOURCE_DIR/test.conf" +source "$SOURCE_DIR/check_osynctool_common.inc" + +echo "PLUGINPATH = \"$PLUGINPATH\"" +echo "CFG = \"$CFG\"" + + +if test -n "$TRACE_FILES"; then + echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + export OSYNC_TRACE="$TRACE_FILES" +fi + +if test -z "$LDIF"; then + echo "$FILE:$LINENO: ERROR: \$LDIF is empty. Exiting." + exit 1 +fi + +if test ! -f "$LDIF"; then + echo "$FILE:$LINENO: ERROR: \"$LDIF\" could not be found. Exiting." + exit 1 +fi + +if test ! -r "$LDIF"; then + echo "$FILE:$LINENO: ERROR: \"$LDIF\" could be found, but it is not readable. Exiting." + exit 1 +fi + + + +TMPDIR=`mktemp -d /tmp/ldap_sync_test.XXXXXX` || exit 1 +echo "TMPDIR = \"$TMPDIR\"" + + + + +# Set up test group +prologue; + +# Empty LDAP DIT +$SOURCE_DIR/remove_test_ldifs + +# Remove entry from directory used by file-sync +remove_file_by_objtype "$OBJECTTYPE" + +# Add *.ldif +run_ldapadd "$LDIF" +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: run_ldapadd has failed." + exit 1; +fi + +# osynctool should synchronize only one particular object type: +enable_only "$OBJECTTYPE" + +# Trigger synchronization +slow_sync "$OBJECTTYPE" +rv=$? + +# Shut down test group +epilogue + + +exit $rv Added: plugins/ldap-sync/tests/check_osynctool_add_ldif_and_valgrind_and_sync ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/check_osynctool_add_ldif_and_valgrind_and_sync Mon Mar 30 20:27:37 2009 (r5469) @@ -0,0 +1,112 @@ +#!/bin/bash + +set -x + +FILE=$0 +OSYNCTOOL=$(which osynctool 2>/dev/null) +if test ! -f "$OSYNCTOOL"; then + echo "$FILE:$LINENO: ERROR: osynctool could not be found. Exiting." + exit 1 +fi + +if test ! -x "$OSYNCTOOL"; then + echo "$FILE:$LINENO: ERROR: osynctool could be found, but it is not executable. Exiting." + exit 1 +fi + + + +PLUGINNAME="ldap-sync" +PLUGINPATH="$1/src" +CFG="$2/src/$PLUGINNAME" +OBJECTTYPE="$3" +LDIF="$4" + + +SOURCE_DIR=`dirname $FILE` +if test ! -d "$SOURCE_DIR"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR\" is not a directory. Exiting." + exit 1 +fi + +if test ! -r "$SOURCE_DIR/test.conf"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR/test.conf\" could not be read. Exiting." + exit 1 +fi + +if test ! -r "$SOURCE_DIR/check_osynctool_common.inc"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR/test.conf\" could not be read. Exiting." + exit 1 +fi + +source "$SOURCE_DIR/test.conf" +source "$SOURCE_DIR/check_osynctool_common.inc" + +echo "PLUGINPATH = \"$PLUGINPATH\"" +echo "CFG = \"$CFG\"" + + +if test -n "$TRACE_FILES"; then + echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + export OSYNC_TRACE="$TRACE_FILES" +fi + +if test -z "$LDIF"; then + echo "$FILE:$LINENO: ERROR: \$LDIF is empty. Exiting." + exit 1 +fi + +if test ! -f "$LDIF"; then + echo "$FILE:$LINENO: ERROR: \"$LDIF\" could not be found. Exiting." + exit 1 +fi + +if test ! -r "$LDIF"; then + echo "$FILE:$LINENO: ERROR: \"$LDIF\" could be found, but it is not readable. Exiting." + exit 1 +fi + + +if test -z "$VALGRIND"; then + echo "$FILE:$LINENO: ERROR: \$VALGRIND is empty. Exiting."; + exit 1; +fi + + + + +TMPDIR=`mktemp -d /tmp/ldap_sync_test.XXXXXX` || exit 1 +echo "TMPDIR = \"$TMPDIR\"" + + + + +# Set up test group +prologue; + +# Empty LDAP DIT +$SOURCE_DIR/remove_test_ldifs + +# Remove entry from directory used by file-sync +remove_file_by_objtype "$OBJECTTYPE" + +# Add *.ldif +run_ldapadd "$LDIF" +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: run_ldapadd has failed." + exit 1; +fi + +# osynctool should synchronize only one particular object type: +enable_only "$OBJECTTYPE" + +# Trigger synchronization +valgrind_slow_sync "$OBJECTTYPE" +rv=$? + +# Shut down test group +epilogue + + +exit $rv Added: plugins/ldap-sync/tests/check_osynctool_common.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/check_osynctool_common.inc Mon Mar 30 20:27:37 2009 (r5469) @@ -0,0 +1,898 @@ +GROUPNAME="sync_test_group" + +check_plugin_available() +{ + plugin="$1" + + if test -z "$plugin"; then + echo "${FUNCNAME}(): ERROR: \$plugin is empty. Exiting." + exit 1; + fi + + if test -z "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL is empty. Exiting." + exit 1; + fi + + if test ! -f "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL does not exist. Exiting." + exit 1; + fi + + if test ! -x "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL does exist, but it is not executable. Exiting." + exit 1; + fi + + + $OSYNCTOOL --listplugins | grep -q "$plugin" + rv=$? + if test $rv -ne 0; then + echo "${FUNCNAME}(): ERROR: ldap-sync was not included in pluginlist. Exiting." + exit 1 + fi + +} + + + +check_ldap_formats() +{ + if test -z "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL is empty. Exiting." + exit 1; + fi + + if test ! -f "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL does not exist. Exiting." + exit 1; + fi + + if test ! -x "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL does exist, but it is not executable. Exiting." + exit 1; + fi + + + $OSYNCTOOL --listformats | grep -q "ldap-evolutionperson" + rv=$? + if test $rv -ne 0; then + echo "${FUNCNAME}(): ERROR: ldap-evolutionperson was not included in formatlist. Exiting." + exit 1 + fi + + $OSYNCTOOL --listformats | grep -q "ldap-inetorgperson" + rv=$? + if test $rv -ne 0; then + echo "${FUNCNAME}(): ERROR: ldap-inetorgperson was not included in formatlist. Exiting." + exit 1 + fi + + $OSYNCTOOL --listformats | grep -q "ldap-event" + rv=$? + if test $rv -ne 0; then + echo "${FUNCNAME}(): ERROR: ldap-event was not included in formatlist. Exiting." + exit 1 + fi + + $OSYNCTOOL --listformats | grep -q "ldap-todo" + rv=$? + if test $rv -ne 0; then + echo "${FUNCNAME}(): ERROR: ldap-todo was not included in formatlist. Exiting." + exit 1 + fi + + $OSYNCTOOL --listformats | grep -q "ldap-note" + rv=$? + if test $rv -ne 0; then + echo "${FUNCNAME}(): ERROR: ldap-note was not included in formatlist. Exiting." + exit 1 + fi +} + + + + + +check_xmlformats() +{ + if test -z "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL is empty. Exiting." + exit 1; + fi + + if test ! -f "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL does not exist. Exiting." + exit 1; + fi + + if test ! -x "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL does exist, but it is not executable. Exiting." + exit 1; + fi + + + $OSYNCTOOL --listformats | grep -q "xmlformat-contact$" + rv=$? + if test $rv -ne 0; then + echo "${FUNCNAME}(): ERROR: xmlformat-contact was not included in formatlist. Exiting." + exit 1 + fi + + $OSYNCTOOL --listformats | grep -q "xmlformat-event$" + rv=$? + if test $rv -ne 0; then + echo "${FUNCNAME}(): ERROR: xmlformat-event was not included in formatlist. Exiting." + exit 1 + fi + + $OSYNCTOOL --listformats | grep -q "xmlformat-todo$" + rv=$? + if test $rv -ne 0; then + echo "${FUNCNAME}(): ERROR: xmlformat-todo was not included in formatlist. Exiting." + exit 1 + fi + + $OSYNCTOOL --listformats | grep -q "xmlformat-note$" + rv=$? + if test $rv -ne 0; then + echo "${FUNCNAME}(): ERROR: xmlformat-note was not included in formatlist. Exiting." + exit 1 + fi +} + + + +configure_plugin() +{ + group="$1" + if test -z "$group"; then + echo "${FUNCNAME}(): ERROR: \$group is empty. Exiting."; + exit 1; + fi + + memberid="$2" + if test -z "$memberid"; then + echo "${FUNCNAME}(): ERROR: \$memberid is empty. Exiting."; + exit 1; + fi + + member_config_file="$3" + if test -z "$member_config_file"; then + echo "${FUNCNAME}(): ERROR: \$member_config_file is empty. Exiting."; + exit 1; + fi + + if test ! -f "$SOURCE_DIR/$member_config_file"; then + echo "${FUNCNAME}(): ERROR: $SOURCE_DIR/$member_config_file does not exist. Exiting."; + exit 1; + fi + + if test ! -r "$SOURCE_DIR/$member_config_file"; then + echo "${FUNCNAME}(): ERROR: $SOURCE_DIR/$member_config_file does exist, but it is not readable. Exiting."; + exit 1; + fi + + if test -z "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL is empty. Exiting." + exit 1; + fi + + if test ! -f "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL does not exist. Exiting." + exit 1; + fi + + if test ! -x "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL does exist, but it is not executable. Exiting." + exit 1; + fi + + if test -z "$TMPDIR"; then + echo "${FUNCNAME}(): ERROR: \$TMPDIR is empty. Exiting." + exit 1; + fi + + if test ! -d "$TMPDIR"; then + echo "${FUNCNAME}(): ERROR: \$TMPDIR is not a directory. Exiting." + exit 1; + fi + + + + # Thanks for this tip about fooling osynctool about the $EDITOR variable + # go to the author of the mozilla-sync plugin: Henrik Kaare Poulsen + # http://www.KaarPoSoft.dk/bluezync/ + # See mozilla-sync/trunk/tests/blackbox_test_common.shinc.inc + oldeditor="$EDITOR" + export EDITOR="cat >" + + + $OSYNCTOOL --configdir "$TMPDIR" --configure "$group" "$memberid" < "$SOURCE_DIR/$member_config_file" + + rv=$? + + export EDITOR="$oldeditor" + + + return $rv; +} + + + +setup_group() +{ + group="$1" + if test -z "$group"; then + echo "${FUNCNAME}(): ERROR: \$group is empty. Exiting."; + exit 1; + fi + + + if test -z "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL is empty. Exiting." + exit 1; + fi + + if test ! -f "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL does not exist. Exiting." + exit 1; + fi + + if test ! -x "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL does exist, but it is not executable. Exiting." + exit 1; + fi + + if test -z "$TMPDIR"; then + echo "${FUNCNAME}(): ERROR: \$TMPDIR is empty. Exiting." + exit 1; + fi + + if test ! -d "$TMPDIR"; then + echo "${FUNCNAME}(): ERROR: \$TMPDIR is not a directory. Exiting." + exit 1; + fi + + + + + $OSYNCTOOL --configdir "$TMPDIR" --addgroup "$group" + $OSYNCTOOL --configdir "$TMPDIR" --addmember "$group" "file-sync" + $OSYNCTOOL --configdir "$TMPDIR" --addmember "$group" "ldap-sync" + + + + configure_plugin "$group" "1" "file-sync.conf" + rv=$? + if test $rv -ne 0; then + echo "${FUNCNAME}(): ERROR: configure plugin \"$group\" \"1\" has failed. Exiting." + + $OSYNCTOOL --configdir "$TMPDIR" --delgroup "$group" + + exit $rv; + fi + + + + + configure_plugin "$group" "2" "ldap-sync.conf" + rv=$? + if test $rv -ne 0; then + echo "${FUNCNAME}(): ERROR: configure plugin \"$group\" \"1\" has failed. Exiting." + + $OSYNCTOOL --configdir "$TMPDIR" --delgroup "$group" + + exit $rv; + fi + + + # Let the configuration take into effect. + $OSYNCTOOL --configdir "$TMPDIR" --discover "$group" +} + + + +shutdown_group() +{ + group="$1" + if test -z "$group"; then + echo "${FUNCNAME}(): ERROR: \$group is empty. Exiting."; + exit 1; + fi + + + if test -z "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL is empty. Exiting." + exit 1; + fi + + if test ! -f "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL does not exist. Exiting." + exit 1; + fi + + if test ! -x "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL does exist, but it is not executable. Exiting." + exit 1; + fi + + if test -z "$TMPDIR"; then + echo "${FUNCNAME}(): ERROR: \$TMPDIR is empty. Exiting." + exit 1; + fi + + if test ! -d "$TMPDIR"; then + echo "${FUNCNAME}(): ERROR: \$TMPDIR is not a directory. Exiting." + exit 1; + fi + + + $OSYNCTOOL --configdir "$TMPDIR" --delmember "$group" 1 + $OSYNCTOOL --configdir "$TMPDIR" --delmember "$group" 2 + $OSYNCTOOL --configdir "$TMPDIR" --delgroup "$group" +} + + + +prologue() +{ + check_plugin_available "ldap-sync" + check_plugin_available "file-sync" + + check_ldap_formats; + check_xmlformats; + + setup_group "$GROUPNAME" +} + + + + +epilogue() +{ + shutdown_group "$GROUPNAME" + + if test -d "$TMPDIR"; then + rm -rf "$TMPDIR"; + fi +} + + + + +run_ldapadd() +{ + ldif="$1" + if test -z "$ldif"; then + echo "${FUNCNAME}(): ERROR: \$ldif is empty. Exiting." + exit 1; + fi + + if test ! -f "$ldif"; then + echo "${FUNCNAME}(): ERROR: $ldif does not exist. Exiting." + exit 1; + fi + + if test ! -r "$ldif"; then + echo "${FUNCNAME}(): ERROR: $ldif does exist, but it is not readable. Exiting." + exit 1; + fi + + + + LDAPADD=$(which ldapadd 2>/dev/null) + + if test ! -f "$LDAPADD"; then + echo "$FILE:$LINENO: ERROR: ldapadd could not be found. Exiting." + exit 1 + fi + + if test ! -x "$LDAPADD"; then + echo "$FILE:$LINENO: ERROR: ldapadd could be found, but is not executable. Exiting." + exit 1 + fi + + + + + + if test -z "$AUTH"; then + echo "${FUNCNAME}(): ERROR: \$AUTH is empty. Exiting." + exit 1; + fi + + if test -z "$LDAPADD"; then + echo "${FUNCNAME}(): ERROR: \$LDAPADD is empty. Exiting." + exit 1; + fi + + if test ! -f "$LDAPADD"; then + echo "${FUNCNAME}(): ERROR: $LDAPADD does not exist. Exiting." + exit 1; + fi + + if test ! -x "$LDAPADD"; then + echo "${FUNCNAME}(): ERROR: $LDAPADD does exist, but it is not ecutable. Exiting." + exit 1; + fi + + + + echo "Command: $LDAPADD $AUTH -a -f $ldif" + + $LDAPADD $AUTH -a -f $ldif + rv=$? + if test $rv -ne 0; then + echo "${FUNCNAME}(): ERROR: ldapadd has failed. Exiting." + exit $rv; + fi + + return $rv +} + + + +run_ldapmodify() +{ + entrymods="$1" + if test -z "$entrymods"; then + echo "${FUNCNAME}(): ERROR: \$entrymods is empty. Exiting." + exit 1; + fi + + if test ! -f "$entrymods"; then + echo "${FUNCNAME}(): ERROR: $entrymods does not exist. Exiting." + exit 1; + fi + + if test ! -r "$entrymods"; then + echo "${FUNCNAME}(): ERROR: $entrymods does exist, but it is not readable. Exiting." + exit 1; + fi + + + + if test -z "$AUTH"; then + echo "${FUNCNAME}(): ERROR: \$AUTH is empty. Exiting." + exit 1; + fi + + + LDAPMODIFY=$(which ldapmodify 2>/dev/null) + + + if test -z "$LDAPMODIFY"; then + echo "${FUNCNAME}(): ERROR: \$LDAPMODIFY is empty. Exiting." + exit 1; + fi + + if test ! -f "$LDAPMODIFY"; then + echo "${FUNCNAME}(): ERROR: $LDAPMODIFY does not exist. Exiting." + exit 1; + fi + + if test ! -x "$LDAPMODIFY"; then + echo "${FUNCNAME}(): ERROR: $LDAPMODIFY does exist, but it is not ecutable. Exiting." + exit 1; + fi + + + echo "Command: $LDAPMODIFY $AUTH -f $ENTRYMODS" + + $LDAPMODIFY $AUTH -f $ENTRYMODS + rv=$? + if test $rv -ne 0; then + echo "${FUNCNAME}(): ERROR: ldapmodify has failed. Exiting." + exit $rv; + fi + + return $rv; +} + + + +run_ldapdelete() +{ + ldif="$1" + if test -z "$ldif"; then + echo "${FUNCNAME}(): ERROR: \$ldif is empty. Exiting." + exit 1; + fi + + if test ! -f "$ldif"; then + echo "${FUNCNAME}(): ERROR: $ldif does not exist. Exiting." + exit 1; + fi + + if test ! -r "$ldif"; then + echo "${FUNCNAME}(): ERROR: $ldif does exist, but it is not readable. Exiting." + exit 1; + fi + + + + if test -z "$AUTH"; then + echo "${FUNCNAME}(): ERROR: \$AUTH is empty. Exiting." + exit 1; + fi + + + LDAPMODIFY=$(which ldapdelete 2>/dev/null) + + + if test -z "$LDAPDELETE"; then + echo "${FUNCNAME}(): ERROR: \$LDAPDELETE is empty. Exiting." + exit 1; + fi + + if test ! -f "$LDAPDELETE"; then + echo "${FUNCNAME}(): ERROR: $LDAPDELETE does not exist. Exiting." + exit 1; + fi + + if test ! -x "$LDAPDELETE"; then + echo "${FUNCNAME}(): ERROR: $LDAPDELETE does exist, but it is not ecutable. Exiting." + exit 1; + fi + + + + DN_FULL=$(head -n 1 $ldif) + if test -z "$DN_FULL"; then + echo "${FUNCNAME}(): ERROR: \$DN_FULL is empty. Exiting." + exit 1; + fi + + DN=${DN_FULL#dn:} + if test -z "$DN"; then + echo "${FUNCNAME}(): ERROR: \$DN is empty. Exiting." + exit 1; + fi + + echo "To be deleted: \"$DN\"" + echo "Command: $LDAPDELETE $AUTH -r $DN" + + $LDAPDELETE $AUTH -r $DN + rv=$? + if test $rv -ne 0; then + echo "${FUNCNAME}(): ERROR: ldapdelete has failed. Exiting." + exit $rv; + fi + + + return $rv; +} + + +remove_contact_files() +{ + if test -z "$CONTACT1_FILE"; then + echo "${FUNCNAME}(): ERROR: \$CONTACT1_FILE is empty. Ignoring." + elif test -f "$CONTACT1_FILE"; then + rm -f "$CONTACT1_FILE"; + fi + + + if test -z "$CONTACT2_FILE"; then + echo "${FUNCNAME}(): ERROR: \$CONTACT2_FILE is empty. Ignoring." + elif test -f "$CONTACT2_FILE"; then + rm -f "$CONTACT2_FILE"; + fi + + output=$(ls -al /tmp/file_contact) + echo -e "$output\n" +} + + +remove_event1_file() +{ + if test -z "$EVENT1_FILE"; then + echo "${FUNCNAME}(): ERROR: \$EVENT1_FILE is empty. Ignoring." + elif test -f "$EVENT1_FILE"; then + rm -f "$EVENT1_FILE"; + fi + + output=$(ls -al /tmp/file_event) + echo -e "$output\n" +} + + +remove_todo1_file() +{ + if test -z "$TODO1_FILE"; then + echo "${FUNCNAME}(): ERROR: \$TODO1_FILE is empty. Ignoring." + elif test -f "$TODO1_FILE"; then + rm -f "$TODO1_FILE"; + fi + + output=$(ls -al /tmp/file_todo) + echo -e "$output\n" +} + + +remove_note_files() +{ + if test -z "$NOTE1_FILE"; then + echo "${FUNCNAME}(): ERROR: \$NOTE1_FILE is empty. Ignoring." + elif test -f "$NOTE1_FILE"; then + rm -f "$NOTE1_FILE"; + fi + + if test -z "$NOTE2_FILE"; then + echo "${FUNCNAME}(): ERROR: \$NOTE2_FILE is empty. Ignoring." + elif test -f "$NOTE2_FILE"; then + rm -f "$NOTE2_FILE"; + fi + + output=$(ls -al /tmp/file_note) + echo -e "$output\n" +} + + +remove_file_by_objtype() +{ + objtype="$1" + + if test -z "$objtype"; then + echo "${FUNCNAME}(): ERROR: \$objtype is empty. Exiting."; + exit 1; + fi + + if test "$objtype" != "contact" -a "$objtype" != "event" -a "$objtype" != "todo" -a "$objtype" != "note"; then + echo "${FUNCNAME}(): ERROR: \"$objtype\" is wrong: \$objtype can only be either \"contact\" or \"event\" or \"todo\" or \"note\". Exiting." + exit 1; + fi + + + if test "$objtype" == "contact"; then + remove_contact_files + elif test "$objtype" == "event"; then + remove_event_file + elif test "$objtype" == "todo"; then + remove_todo_file + elif test "$objtype" == "note"; then + remove_note_files + fi +} + + + + + +remove_files() +{ + remove_contact_files + remove_note_files +} + + + +add_file() +{ + objtype="$1" + xmlfile="$2" + + + + if test -z "$objtype"; then + echo "$FILE:$LINENO: ERROR: \$objtype is empty. Exiting." + exit 1 + fi + + if test "$objtype" != "contact" -a "$objtype" != "event" -a "$objtype" != "todo" -a "$objtype" != "note"; then + echo "${FUNCNAME}(): ERROR: \"$objtype\" is wrong: \$objtype can only be either \"contact\" or \"event\" or \"todo\" or \"note\". Exiting." + exit 1; + fi + + if test -z "$xmlfile"; then + echo "$FILE:$LINENO: ERROR: \$xmlfile is empty. Exiting." + exit 1 + fi + + if test ! -f "$xmlfile"; then + echo "$FILE:$LINENO: ERROR: \"$xmlfile\" could not be found. Exiting." + exit 1 + fi + + if test ! -r "$xmlfile"; then + echo "$FILE:$LINENO: ERROR: \"$xmlfile\" could be found, but it is not readable. Exiting." + exit 1 + fi + + + +# if test "$objtype" == "contact"; then +# remove_contact_files +# elif test "$objtype" == "event"; then +# remove_event_file +# elif test "$objtype" == "todo"; then +# remove_todo_file +# elif test "$objtype" == "note"; then +# remove_note_files +# fi + + + if test "$objtype" == "contact"; then + cp -f "$xmlfile" $CONTACT1_FILE + + elif test "$objtype" == "event"; then + cp -f "$xmlfile" $EVENT1_FILE + + elif test "$objtype" == "todo"; then + cp -f "$xmlfile" $TODO1_FILE + + elif test "$objtype" == "note"; then + cp -f "$xmlfile" $NOTE1_FILE + + fi +} + + + + + +enable_only() +{ + objtype="$1" + + echo "${FUNCNAME}() has been called: objtype=\"$objtype\"." + + if test -z "$objtype"; then + echo "${FUNCNAME}(): ERROR: \$objtype is empty. Exiting."; + exit 1; + fi + + if test "$objtype" != "contact" -a "$objtype" != "event" -a "$objtype" != "todo" -a "$objtype" != "note"; then + echo "${FUNCNAME}(): ERROR: \"$objtype\" is wrong: \$objtype can only be either \"contact\" or \"event\" or \"todo\" or \"note\". Exiting." + exit 1; + fi + + + if test "$objtype" == "contact"; then + echo "${FUNCNAME}(): Enabling objtype \"contact\"." + $OSYNCTOOL --configdir "$TMPDIR" --enable-objtype "$GROUPNAME" "contact" + $OSYNCTOOL --configdir "$TMPDIR" --disable-objtype "$GROUPNAME" "event" + $OSYNCTOOL --configdir "$TMPDIR" --disable-objtype "$GROUPNAME" "todo" + $OSYNCTOOL --configdir "$TMPDIR" --disable-objtype "$GROUPNAME" "note" + elif test "$objtype" == "event"; then + echo "${FUNCNAME}(): Enabling objtype \"event\"." + $OSYNCTOOL --configdir "$TMPDIR" --disable-objtype "$GROUPNAME" "contact" + $OSYNCTOOL --configdir "$TMPDIR" --enable-objtype "$GROUPNAME" "event" + $OSYNCTOOL --configdir "$TMPDIR" --disable-objtype "$GROUPNAME" "todo" + $OSYNCTOOL --configdir "$TMPDIR" --disable-objtype "$GROUPNAME" "note" + elif test "$objtype" == "todo"; then + echo "${FUNCNAME}(): Enabling objtype \"todo\"." + $OSYNCTOOL --configdir "$TMPDIR" --disable-objtype "$GROUPNAME" "contact" + $OSYNCTOOL --configdir "$TMPDIR" --disable-objtype "$GROUPNAME" "event" + $OSYNCTOOL --configdir "$TMPDIR" --enable-objtype "$GROUPNAME" "todo" + $OSYNCTOOL --configdir "$TMPDIR" --disable-objtype "$GROUPNAME" "note" + elif test "$objtype" == "note"; then + echo "${FUNCNAME}(): Enabling objtype \"note\"." + $OSYNCTOOL --configdir "$TMPDIR" --disable-objtype "$GROUPNAME" "contact" + $OSYNCTOOL --configdir "$TMPDIR" --disable-objtype "$GROUPNAME" "event" + $OSYNCTOOL --configdir "$TMPDIR" --disable-objtype "$GROUPNAME" "todo" + $OSYNCTOOL --configdir "$TMPDIR" --enable-objtype "$GROUPNAME" "note" + fi +} + + + + + + + + + + + +slow_sync() +{ + group="$GROUPNAME" + objtype="$1" + + + if test -z "$group"; then + echo "${FUNCNAME}(): ERROR: \$group is empty. Exiting."; + exit 1; + fi + + + if test -z "$objtype"; then + echo "${FUNCNAME}(): ERROR: \$objtype is empty. Exiting."; + exit 1; + fi + + + if test -z "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL is empty. Exiting." + exit 1; + fi + + if test ! -f "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL does not exist. Exiting." + exit 1; + fi + + if test ! -x "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL does exist, but it is not executable. Exiting." + exit 1; + fi + + if test -z "$TMPDIR"; then + echo "${FUNCNAME}(): ERROR: \$TMPDIR is empty. Exiting." + exit 1; + fi + + if test ! -d "$TMPDIR"; then + echo "${FUNCNAME}(): ERROR: \$TMPDIR is not a directory. Exiting." + exit 1; + fi + + + $OSYNCTOOL --configdir "$TMPDIR" --sync "$group" --slow-sync "$objtype" --always-accept-forecast --conflict 2 + + +} + + + +valgrind_slow_sync() +{ + group="$GROUPNAME" + objtype="$1" + + + if test -z "$group"; then + echo "${FUNCNAME}(): ERROR: \$group is empty. Exiting."; + exit 1; + fi + + + if test -z "$objtype"; then + echo "${FUNCNAME}(): ERROR: \$objtype is empty. Exiting."; + exit 1; + fi + + + if test -z "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL is empty. Exiting." + exit 1; + fi + + if test ! -f "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL does not exist. Exiting." + exit 1; + fi + + if test ! -x "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL does exist, but it is not executable. Exiting." + exit 1; + fi + + if test -z "$TMPDIR"; then + echo "${FUNCNAME}(): ERROR: \$TMPDIR is empty. Exiting." + exit 1; + fi + + if test ! -d "$TMPDIR"; then + echo "${FUNCNAME}(): ERROR: \$TMPDIR is not a directory. Exiting." + exit 1; + fi + + if test -z "$VALGRIND"; then + echo "$FILE:$LINENO: ERROR: \$VALGRIND is empty. Exiting."; + exit 1; + fi + + + if test -n "$SUPPRESSION_FILE" -a -f "$SUPPRESSION_FILE" -a -r "$SUPPRESSION_FILE"; then + VALGRIND="$VALGRIND --suppressions=$SUPPRESSION_FILE" + fi + + + + $VALGRIND $OSYNCTOOL --configdir "$TMPDIR" --sync "$group" --slow-sync "$objtype" --always-accept-forecast --conflict 2 + + +} Added: plugins/ldap-sync/tests/check_osynctool_file1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/check_osynctool_file1 Mon Mar 30 20:27:37 2009 (r5469) @@ -0,0 +1,66 @@ +#!/bin/bash + + +FILE=$0 +OSYNCTOOL=$(which osynctool 2>/dev/null) +if test ! -f "$OSYNCTOOL"; then + echo "$FILE:$LINENO: ERROR: osynctool could not be found. Exiting." + exit 1 +fi + +if test ! -x "$OSYNCTOOL"; then + echo "$FILE:$LINENO: ERROR: osynctool could be found, but it is not executable. Exiting." + exit 1 +fi + + + +PLUGINNAME="ldap-sync" +PLUGINPATH="$1/src" +CFG="$2/src/$PLUGINNAME" + + +if test -n "$TRACE_FILES"; then + echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + export OSYNC_TRACE="$TRACE_FILES" +fi + + + +SOURCE_DIR=`dirname $FILE` +if test ! -d "$SOURCE_DIR"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR\" is not a directory. Exiting." + exit 1 +fi + +if test ! -r "$SOURCE_DIR/test.conf"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR/test.conf\" could not be read. Exiting." + exit 1 +fi + +if test ! -r "$SOURCE_DIR/check_osynctool_common.inc"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR/test.conf\" could not be read. Exiting." + exit 1 +fi + +source "$SOURCE_DIR/test.conf" +source "$SOURCE_DIR/check_osynctool_common.inc" + +echo "PLUGINPATH = \"$PLUGINPATH\"" +echo "CFG = \"$CFG\"" + + + +TMPDIR=`mktemp -d /tmp/ldap_sync_test.XXXXXX` || exit 1 +echo "TMPDIR = \"$TMPDIR\"" + + + + + +prologue; + +##### Here we could do something useful... + +epilogue + Modified: plugins/ldap-sync/tests/check_slowsync ============================================================================== --- plugins/ldap-sync/tests/check_slowsync Mon Mar 30 20:23:30 2009 (r5468) +++ plugins/ldap-sync/tests/check_slowsync Mon Mar 30 20:27:37 2009 (r5469) @@ -56,6 +56,10 @@ fi +if test -n "$TRACE_FILES"; then + echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + export OSYNC_TRACE="$TRACE_FILES" +fi Modified: plugins/ldap-sync/tests/check_sync ============================================================================== --- plugins/ldap-sync/tests/check_sync Mon Mar 30 20:23:30 2009 (r5468) +++ plugins/ldap-sync/tests/check_sync Mon Mar 30 20:27:37 2009 (r5469) @@ -57,6 +57,13 @@ +if test -n "$TRACE_FILES"; then + echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + export OSYNC_TRACE="$TRACE_FILES" +fi + + + echo "${PLUGINPATH} ${CFG}" Added: plugins/ldap-sync/tests/file-sync.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/file-sync.conf Mon Mar 30 20:27:37 2009 (r5469) @@ -0,0 +1,45 @@ +<?xml version="1.0"?> +<config version="1.0"> + <Resources> + <Resource> + <Enabled>1</Enabled> + <Formats> + <Format> + <Name>file</Name> + </Format> + </Formats> + <ObjType>contact</ObjType> + <Path>/tmp/file_contact</Path> + </Resource> + <Resource> + <Enabled>1</Enabled> + <Formats> + <Format> + <Name>file</Name> + </Format> + </Formats> + <ObjType>event</ObjType> + <Path>/tmp/file_event</Path> + </Resource> + <Resource> + <Enabled>1</Enabled> + <Formats> + <Format> + <Name>file</Name> + </Format> + </Formats> + <ObjType>todo</ObjType> + <Path>/tmp/file_todo</Path> + </Resource> + <Resource> + <Enabled>1</Enabled> + <Formats> + <Format> + <Name>file</Name> + </Format> + </Formats> + <ObjType>note</ObjType> + <Path>/tmp/file_note</Path> + </Resource> + </Resources> +</config> Added: plugins/ldap-sync/tests/ldap-sync.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/ldap-sync.conf Mon Mar 30 20:27:37 2009 (r5469) @@ -0,0 +1,191 @@ +<?xml version="1.0"?> +<config version="1.0"> + <AdvancedOptions> + <AdvancedOption> + <MaxOccurs>2147483647</MaxOccurs> + <Max>2147483647</Max> + <Name>binddn</Name> + <Type>string</Type> + <Value>cn=ldap_user,ou=people,dc=example,dc=com</Value> + </AdvancedOption> + <AdvancedOption> + <MaxOccurs>2147483647</MaxOccurs> + <Max>2147483647</Max> + <Name>authcid</Name> + <Type>string</Type> + <Value>ldap_user</Value> + </AdvancedOption> + <AdvancedOption> + <MaxOccurs>2147483647</MaxOccurs> + <Max>2147483647</Max> + <Name>password</Name> + <Type>string</Type> + <Value>secret</Value> + </AdvancedOption> + <AdvancedOption> + <MaxOccurs>2147483647</MaxOccurs> + <Max>2147483647</Max> + <Name>anonymous</Name> + <Type>string</Type> + <Value>0</Value> + </AdvancedOption> + <AdvancedOption> + <MaxOccurs>2147483647</MaxOccurs> + <Max>2147483647</Max> + <Name>authmech</Name> + <Type>string</Type> + <Value>GSSAPI</Value> + </AdvancedOption> + <AdvancedOption> + <MaxOccurs>2147483647</MaxOccurs> + <Max>2147483647</Max> + <Name>encryption</Name> + <Type>string</Type> + <Value>0</Value> + </AdvancedOption> + <AdvancedOption> + <MaxOccurs>2147483647</MaxOccurs> + <Max>2147483647</Max> + <Name>ldap_read</Name> + <Type>string</Type> + <Value>1</Value> + </AdvancedOption> + <AdvancedOption> + <MaxOccurs>2147483647</MaxOccurs> + <Max>2147483647</Max> + <Name>ldap_write</Name> + <Type>string</Type> + <Value>1</Value> + </AdvancedOption> + <AdvancedOption> + <MaxOccurs>2147483647</MaxOccurs> + <Max>2147483647</Max> + <Name>searchbase_contact</Name> + <Type>string</Type> + <Value>ou=addressbook,dc=example,dc=com</Value> + </AdvancedOption> + <AdvancedOption> + <MaxOccurs>2147483647</MaxOccurs> + <Max>2147483647</Max> + <Name>searchfilter_contact</Name> + <Type>string</Type> + <Value></Value> + </AdvancedOption> + <AdvancedOption> + <MaxOccurs>2147483647</MaxOccurs> + <Max>2147483647</Max> + <Name>storebase_contact</Name> + <Type>string</Type> + <Value></Value> + </AdvancedOption> + <AdvancedOption> + <MaxOccurs>2147483647</MaxOccurs> + <Max>2147483647</Max> + <Name>searchbase_event</Name> + <Type>string</Type> + <Value>ou=calendar,dc=example,dc=com</Value> + </AdvancedOption> + <AdvancedOption> + <MaxOccurs>2147483647</MaxOccurs> + <Max>2147483647</Max> + <Name>searchfilter_event</Name> + <Type>string</Type> + <Value></Value> + </AdvancedOption> + <AdvancedOption> + <MaxOccurs>2147483647</MaxOccurs> + <Max>2147483647</Max> + <Name>storebase_event</Name> + <Type>string</Type> + <Value></Value> + </AdvancedOption> + <AdvancedOption> + <MaxOccurs>2147483647</MaxOccurs> + <Max>2147483647</Max> + <Name>searchbase_todo</Name> + <Type>string</Type> + <Value>ou=todo,dc=example,dc=com</Value> + </AdvancedOption> + <AdvancedOption> + <MaxOccurs>2147483647</MaxOccurs> + <Max>2147483647</Max> + <Name>searchfilter_todo</Name> + <Type>string</Type> + <Value></Value> + </AdvancedOption> + <AdvancedOption> + <MaxOccurs>2147483647</MaxOccurs> + <Max>2147483647</Max> + <Name>storebase_todo</Name> + <Type>string</Type> + <Value></Value> + </AdvancedOption> + <AdvancedOption> + <MaxOccurs>2147483647</MaxOccurs> + <Max>2147483647</Max> + <Name>searchbase_note</Name> + <Type>string</Type> + <Value>o=notes,dc=example,dc=com</Value> + </AdvancedOption> + <AdvancedOption> + <MaxOccurs>2147483647</MaxOccurs> + <Max>2147483647</Max> + <Name>searchfilter_note</Name> + <Type>string</Type> + <Value></Value> + </AdvancedOption> + <AdvancedOption> + <MaxOccurs>2147483647</MaxOccurs> + <Max>2147483647</Max> + <Name>storebase_note</Name> + <Type>string</Type> + <Value></Value> + </AdvancedOption> + </AdvancedOptions> + <Connection> + <ActiveConnection>Network</ActiveConnection> + <Network> + <Address>localhost</Address> + <Port>389</Port> + <Protocol>ldap</Protocol> + </Network> + </Connection> + <Resources> + <Resource> + <Enabled>1</Enabled> + <Formats> + <Format> + <Name>ldap-inetorgperson</Name> + </Format> + </Formats> + <ObjType>contact</ObjType> + </Resource> + <Resource> + <Enabled>1</Enabled> + <Formats> + <Format> + <Name>ldap-event</Name> + </Format> + </Formats> + <ObjType>event</ObjType> + </Resource> + <Resource> + <Enabled>1</Enabled> + <Formats> + <Format> + <Name>ldap-todo</Name> + </Format> + </Formats> + <ObjType>todo</ObjType> + </Resource> + <Resource> + <Enabled>1</Enabled> + <Formats> + <Format> + <Name>ldap-note</Name> + </Format> + </Formats> + <ObjType>note</ObjType> + </Resource> + </Resources> +</config> Modified: plugins/ldap-sync/tests/note1.xml ============================================================================== --- plugins/ldap-sync/tests/note1.xml Mon Mar 30 20:23:30 2009 (r5468) +++ plugins/ldap-sync/tests/note1.xml Mon Mar 30 20:27:37 2009 (r5469) @@ -1,28 +1,25 @@ <?xml version="1.0"?> <note> - <Attach> - <Content>file:///home/user1/.evolution/memos/local/system/200...@ho...-file</Content> - </Attach> <Categories> - <Category>development</Category> + <Category>Waiting</Category> </Categories> <Class> <Content>CONFIDENTIAL</Content> </Class> <Created> - <Content>20090103T144254</Content> + <Content>20090317T211814</Content> </Created> <DateCalendarCreated> - <Content>20090103T144254Z</Content> + <Content>20090228T003924Z</Content> </DateCalendarCreated> <DateStarted Value="DATE"> - <Content>20090103</Content> + <Content>20090228</Content> </DateStarted> <Description> - <Content>This is my first memo in evolution. It is confidential. With an attachment of 9 bytes.</Content> + <Content>This is my first memo. </Content> </Description> <LastModified> - <Content>20090103T144755</Content> + <Content>20090317T211814</Content> </LastModified> <Method> <Content>PUBLISH</Content> @@ -34,10 +31,9 @@ <Content>1</Content> </Sequence> <Summary> - <Content>1st memo</Content> + <Content>First memo.</Content> </Summary> -<Uid> - <Content>200...@ho...</Content> + <Uid> + <Content>200...@jl...</Content> </Uid> -</note> - +</note> \ No newline at end of file Added: plugins/ldap-sync/tests/note2.xml ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/note2.xml Mon Mar 30 20:27:37 2009 (r5469) @@ -0,0 +1,43 @@ +<?xml version="1.0"?> +<note> + <Attach> + <Content>file:///home/user1/.evolution/memos/local/system/200...@ho...-file</Content> + </Attach> + <Categories> + <Category>development</Category> + </Categories> + <Class> + <Content>CONFIDENTIAL</Content> + </Class> + <Created> + <Content>20090103T144254</Content> + </Created> + <DateCalendarCreated> + <Content>20090103T144254Z</Content> + </DateCalendarCreated> + <DateStarted Value="DATE"> + <Content>20090103</Content> + </DateStarted> + <Description> + <Content>This is my first memo in evolution. It is confidential. With an attachment of 9 bytes.</Content> + </Description> + <LastModified> + <Content>20090103T144755</Content> + </LastModified> + <Method> + <Content>PUBLISH</Content> + </Method> + <ProductID> + <Content>-//Ximian//NONSGML Evolution Calendar//EN</Content> + </ProductID> + <Sequence> + <Content>1</Content> + </Sequence> + <Summary> + <Content>1st memo</Content> + </Summary> +<Uid> + <Content>200...@ho...</Content> + </Uid> +</note> + Modified: plugins/ldap-sync/tests/opensync.suppr ============================================================================== --- plugins/ldap-sync/tests/opensync.suppr Mon Mar 30 20:23:30 2009 (r5468) +++ plugins/ldap-sync/tests/opensync.suppr Mon Mar 30 20:27:37 2009 (r5469) @@ -4200,3 +4200,111 @@ obj:* } +{ + <insert a suppression name here> + Memcheck:Leak + fun:malloc + fun:xmlDictCreate + fun:xmlInitParserCtxt + fun:xmlNewParserCtxt + fun:xmlCreateMemoryParserCtxt + fun:xmlReadMemory + obj:* + obj:* + fun:osync_converter_detect + fun:osync_format_converter_path_vertice_validate_path_with_detector + fun:osync_format_converter_path_vertice_get_next_vertice_neighbour + fun:osync_format_env_find_path_fn + fun:osync_format_env_find_path_formats_with_detectors + fun:osync_entry_engine_convert + fun:osync_sink_engine_convert_to_dest + fun:osync_obj_engine_prepare_write + fun:osync_obj_engine_command + fun:osync_engine_event + fun:_osync_engine_generate_multiplied_event + fun:_osync_engine_generate_event + fun:_osync_engine_event_callback + fun:osync_obj_engine_event + fun:osync_obj_engine_command + fun:osync_engine_command +} + + + +{ + <insert a suppression name here> + Memcheck:Leak + fun:calloc + fun:_dl_new_object + fun:_dl_map_object_from_fd + fun:_dl_map_object + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open + fun:osync_module_load + fun:osync_format_env_load_modules + fun:osync_format_env_load_plugins + fun:main +} + + +{ + <insert a suppression name here> + Memcheck:Leak + fun:malloc + fun:g_try_malloc + fun:osync_try_malloc0 + fun:osync_objtype_sink_new + fun:osync_member_parse_objtype + fun:osync_member_load + fun:osync_group_load_members + fun:osync_group_load + fun:osync_group_env_load_groups + fun:main +} + + +{ + <insert a suppression name here> + Memcheck:Leak + fun:calloc + fun:_dl_check_map_versions + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open + fun:osync_module_load + fun:osync_format_env_load_modules + fun:osync_format_env_load_plugins + fun:main +} + + +{ + <insert a suppression name here> + Memcheck:Leak + fun:malloc + obj:/usr/lib/libxml2.so.2.7.2 + fun:xmlSchemaInitTypes + fun:xmlSchemaParse + fun:osync_xmlformat_schema_new_path + fun:osync_xmlformat_schema_new + obj:* + obj:* + fun:osync_objformat_initialize + fun:osync_format_env_objformat_initialize + fun:osync_format_env_load_plugins + fun:main +} + + + Modified: plugins/ldap-sync/tests/remove_test_ldifs ============================================================================== --- plugins/ldap-sync/tests/remove_test_ldifs Mon Mar 30 20:23:30 2009 (r5468) +++ plugins/ldap-sync/tests/remove_test_ldifs Mon Mar 30 20:27:37 2009 (r5469) @@ -2,12 +2,6 @@ FILE=$0 -contact1_dn='uid=pas-id-49C8DD6D00000035,ou=addressbook,dc=example,dc=com' -contact2_dn='uid=pas-id-49C6A95E00000026,ou=addressbook,dc=example,dc=com' -event1_dn='documentIdentifier=200...@ho...,ou=calendar,dc=example,dc=com' -todo1_dn='documentIdentifier=200...@ho...,ou=todo,dc=example,dc=com' -note1_dn='documentIdentifier=200...@ho...,o=notes,dc=example,dc=com' - SOURCE_DIR=`dirname $FILE` if test ! -d "$SOURCE_DIR"; then echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR\" is not a directory. Exiting." @@ -27,6 +21,41 @@ fi +if test -z "$CONTACT1_DN"; then + echo "$FILE:$LINENO: ERROR: \$CONTACT1 is empty. Exiting."; + exit 1 +fi + + +if test -z "$CONTACT2_DN"; then + echo "$FILE:$LINENO: ERROR: \$CONTACT2 is empty. Exiting."; + exit 1 +fi + + +if test -z "$EVENT1_DN"; then + echo "$FILE:$LINENO: ERROR: \$EVENT1 is empty. Exiting."; + exit 1 +fi + + +if test -z "$TODO1_DN"; then + echo "$FILE:$LINENO: ERROR: \$TODO1 is empty. Exiting."; + exit 1 +fi + + +if test -z "$NOTE1_DN"; then + echo "$FILE:$LINENO: ERROR: \$NOTE1 is empty. Exiting."; + exit 1 +fi + +if test -z "$NOTE2_DN"; then + echo "$FILE:$LINENO: ERROR: \$NOTE1 is empty. Exiting."; + exit 1 +fi + + LDAPSEARCH=$(which ldapsearch 2>/dev/null) if test ! -f "$LDAPSEARCH"; then @@ -87,13 +116,14 @@ } -clear_dn "$contact1_dn" +clear_dn "$CONTACT1_DN" -clear_dn "$contact2_dn" +clear_dn "$CONTACT2_DN" -clear_dn "$event1_dn" +clear_dn "$EVENT1_DN" -clear_dn "$todo1_dn" +clear_dn "$TODO1_DN" -clear_dn "$note1_dn" +clear_dn "$NOTE1_DN" +clear_dn "$NOTE2_DN" Modified: plugins/ldap-sync/tests/test.conf ============================================================================== --- plugins/ldap-sync/tests/test.conf Mon Mar 30 20:23:30 2009 (r5468) +++ plugins/ldap-sync/tests/test.conf Mon Mar 30 20:27:37 2009 (r5469) @@ -1,11 +1,43 @@ +############ # Here you could override the filename of the configuration file for the plugin. # But you do not need to configure it, at all, because by default # "src/ldap-sync" of the source directory is parsed: # CFG="/home/user1/.opensync/group2/2/ldap-sync.conf" + + +############ +# How do you intend to authenticate against the LDAP server: AUTH="-Y DIGEST-MD5 -U ldap_user -w secret -Q" #AUTH="-Y GSSAPI -Q" + + BASE_CONTACT="ou=addressbook,dc=example,dc=com" BASE_EVENT="ou=calendar,dc=example,dc=com" BASE_TODO="ou=todo,dc=example,dc=com" BASE_NOTE="o=notes,dc=example,dc=com" -VALGRIND="valgrind --db-attach=no --num-callers=30 --gen-suppressions=all --leak-check=full --show-reachable=yes --error-exitcode=1 --track-origins=yes" + + +CONTACT1_DN='uid=pas-id-49C8DD6D00000035,ou=addressbook,dc=example,dc=com' +CONTACT2_DN='uid=pas-id-49C6A95E00000026,ou=addressbook,dc=example,dc=com' +EVENT1_DN='documentIdentifier=200...@ho...,ou=calendar,dc=example,dc=com' +TODO1_DN='documentIdentifier=200...@ho...,ou=todo,dc=example,dc=com' +NOTE1_DN='documentIdentifier=200...@ho...,o=notes,dc=example,dc=com' +NOTE2_DN='documentIdentifier=200...@ho...,o=notes,dc=example,dc=com' + +CONTACT1_FILE='/tmp/file_contact/pas-id-49C8DD6D00000035' +CONTACT2_FILE='/tmp/file_contact/pas-id-49C6A95E00000026' +EVENT1_FILE='/tmp/file_event/20090320T204925Z-32394-500-1-247_host.example.com' +TODO1_FILE='/tmp/file_todo/20090325T135501Z-32394-500-1-302_host.example.com' +NOTE1_FILE='/tmp/file_note/20090228T003924Z-14681-500-1-43_host.example.com' +NOTE2_FILE='/tmp/file_note/20090103T144254Z-31888-500-1-0_host.example.com' + +########## Without leak checking: +VALGRIND="valgrind --db-attach=no --num-callers=30 --gen-suppressions=all --leak-check=no --show-reachable=yes --error-exitcode=1 --track-origins=yes" + +########## With leak checking: +#VALGRIND="valgrind --db-attach=no --num-callers=30 --gen-suppressions=all --leak-check=full --show-reachable=yes --error-exitcode=1 --track-origins=yes" + +########## If you want to have libopensync trace files, define this variable: +# If the variable is empty, tracing is disabled. +TRACE_FILES="/tmp/trace" +#TRACE_FILES="" |