From: <svn...@op...> - 2009-04-02 19:19:58
|
Author: scriptor Date: Thu Apr 2 21:19:40 2009 New Revision: 5516 URL: http://www.opensync.org/changeset/5516 Log: Limit the production of trace files to the actual synchronization, i.e. osynctool --sync ... So that we don't get 30 files or so, just because there was osynctool --configure..., --discover and --enable before. Modified: plugins/ldap-sync/tests/check_osynctool_common.inc Modified: plugins/ldap-sync/tests/check_osynctool_common.inc ============================================================================== --- plugins/ldap-sync/tests/check_osynctool_common.inc Thu Apr 2 00:00:34 2009 (r5515) +++ plugins/ldap-sync/tests/check_osynctool_common.inc Thu Apr 2 21:19:40 2009 (r5516) @@ -337,6 +337,14 @@ prologue() { + if test -n "$OSYNC_TRACE"; then + remember="$OSYNC_TRACE" + unset OSYNC_TRACE + else + remember="" + fi + + check_plugin_available "ldap-sync" check_plugin_available "file-sync" @@ -344,6 +352,11 @@ check_xmlformats; setup_group "$GROUPNAME" + + + if test -n "$remember"; then + export OSYNC_TRACE="$remember"; + fi } @@ -351,11 +364,22 @@ epilogue() { + if test -n "$OSYNC_TRACE"; then + remember="$OSYNC_TRACE" + unset OSYNC_TRACE + else + remember="" + fi + shutdown_group "$GROUPNAME" if test -d "$TMPDIR"; then rm -rf "$TMPDIR"; fi + + if test -n "$remember"; then + export OSYNC_TRACE="$remember"; + fi } @@ -570,13 +594,13 @@ if test -z "$CONTACT1_FILE"; then echo "${FUNCNAME}(): ERROR: \$CONTACT1_FILE is empty. Ignoring." elif test -f "$CONTACT1_FILE"; then - rm -f "$CONTACT1_FILE"; + 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"; + rm -f "${CONTACT2_FILE}*"; fi output=$(ls -al /tmp/file_contact) @@ -589,7 +613,7 @@ if test -z "$EVENT1_FILE"; then echo "${FUNCNAME}(): ERROR: \$EVENT1_FILE is empty. Ignoring." elif test -f "$EVENT1_FILE"; then - rm -f "$EVENT1_FILE"; + rm -f "${EVENT1_FILE}*"; fi output=$(ls -al /tmp/file_event) @@ -602,7 +626,7 @@ if test -z "$TODO1_FILE"; then echo "${FUNCNAME}(): ERROR: \$TODO1_FILE is empty. Ignoring." elif test -f "$TODO1_FILE"; then - rm -f "$TODO1_FILE"; + rm -f "${TODO1_FILE}*"; fi output=$(ls -al /tmp/file_todo) @@ -615,13 +639,13 @@ if test -z "$NOTE1_FILE"; then echo "${FUNCNAME}(): ERROR: \$NOTE1_FILE is empty. Ignoring." elif test -f "$NOTE1_FILE"; then - rm -f "$NOTE1_FILE"; + 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"; + rm -f "${NOTE2_FILE}*"; fi output=$(ls -al /tmp/file_note) @@ -921,16 +945,16 @@ if test "$objtype" == "contact"; then - rm -f "$CONTACT1_FILE" + remove_contact_files elif test "$objtype" == "event"; then - rm -f "$EVENT1_FILE" + remove_event1_file elif test "$objtype" == "todo"; then - rm -f "$TODO1_FILE" + remove_todo1_file elif test "$objtype" == "note"; then - rm -f "$NOTE1_FILE" + remove_note_files fi } @@ -956,6 +980,13 @@ exit 1; fi + if test -n "$OSYNC_TRACE"; then + remember="$OSYNC_TRACE" + unset OSYNC_TRACE + else + remember="" + fi + if test "$objtype" == "contact"; then echo "${FUNCNAME}(): Enabling objtype \"contact\"." @@ -982,6 +1013,10 @@ $OSYNCTOOL --configdir "$TMPDIR" --disable-objtype "$GROUPNAME" "todo" $OSYNCTOOL --configdir "$TMPDIR" --enable-objtype "$GROUPNAME" "note" fi + + if test -n "$remember"; then + export OSYNC_TRACE="$remember"; + fi } |