From: <svn...@op...> - 2009-10-08 11:54:13
|
Author: henrik Date: Thu Oct 8 13:54:00 2009 New Revision: 5865 URL: http://www.opensync.org/changeset/5865 Log: Add possibility to automatically create OSYNC_TRACES by settin environment variable MAKE_OSYNC_TRACE Modified: plugins/mozilla-sync/trunk/tests/blackbox_test_common.shinc.in Modified: plugins/mozilla-sync/trunk/tests/blackbox_test_common.shinc.in ============================================================================== --- plugins/mozilla-sync/trunk/tests/blackbox_test_common.shinc.in Thu Oct 8 13:53:03 2009 (r5864) +++ plugins/mozilla-sync/trunk/tests/blackbox_test_common.shinc.in Thu Oct 8 13:54:00 2009 (r5865) @@ -36,6 +36,11 @@ # e.g export KEEP_TEMP_FILES=1 KEEP_TEMP_FILES=${KEEP_TEMP_FILES:-""} +# Set $MAKE_OSYNC_TRACE before runng the test +# e.g. export MAKE_OSYNC_TRACE=1 +# to get OpenSync trace files for osynctool +MAKE_OSYNC_TRACE=${MAKE_OSYNC_TRACE:-""} + # Array in which we keep file- and directory-names to be removed # when the test exits declare -a PATHS_TO_CLEAN @@ -255,6 +260,14 @@ # ---------------------------------------------------------------------- msync_sync () { GROUP_NAME="$1" + if [ -n "${MAKE_OSYNC_TRACE}" ]; then + export OSYNC_NOPRIVACY=1 + local DIR=`mktemp -dt "OSYNC_TRACE_${GROUP_NAME}.XXXXXX"` || + error_exit "Could not create temporary directory for [${GROUP_NAME}]" 1 + export OSYNC_TRACE="${DIR}" + myecho "Tracing into ${DIR}" + fi + msync --sync "${GROUP_NAME}" --always-accept-forecast --conflict i || error_exit "Synchronization failed for [${STEP}]" $? } |