Commit graph

3725 commits

Author SHA1 Message Date
Patrick Ohly
af43ac9d37 synccompare: normalize TRIGGER time ranges
60M is the same as 1H?! Ensure that each value is in the range of 0-59
resp. 0-23.
2011-08-12 10:29:45 +02:00
Patrick Ohly
2402ceb223 synccompare: added ActiveSync/Exchange
Suppress the following differences:
- SEQUENCE removed
- X-MEEGO-ACTIVESYNCD-MeetingStatus/NativeBodyType added
- ORGANIZER added to all events, ignored for events without ATTENDEEs
2011-08-12 10:27:31 +02:00
Patrick Ohly
64a16c12bd testing: optionally ignore leaks in forked processes
Improved valgrindcheck.sh so that if VALGRIND_LEAK_CHECK_ONLY_FIRST
is set, memory leaks in forked processes are filtered out of the
valgrind log file.

Also improved the detection whether an error was reported. This is
the case if and only if a suppression was created. This allows
running valgrind with normal output, no need for --quiet anymore.
2011-08-10 16:56:52 +02:00
Patrick Ohly
358e8fc03b Memotoo testing: updated eds_task test case for Memotoo
Time stamp for COMPLETED is converted to local time by Memotoo.
DTSTART and PERCENT-COMPLETE are lost.
2011-08-10 16:05:36 +02:00
Patrick Ohly
8f77a3ca4d Memotoo testing: ignore changes to RRULE in weekly recurrence
Memotoo replaces the UTC UNTIL time with floating time, just
as it changes the DTSTART/DTEND. Let's ignore that by using
test data with that UNTIL clause for Memotoo.
2011-08-10 15:28:33 +02:00
Patrick Ohly
4424c38548 source config: improved error message
An invalid syncFormat (like text/vcard for "Evolution Calendar")
can prevent instantiating the source. Therefore include that
value in the error message and clearly distinguish between
sync and database format.
2011-08-10 15:07:18 +02:00
Patrick Ohly
6ce041fba8 Sony Ericsson: use ISO-8859-1 for all devices (BMC #14414)
Sony Ericsson seems to use ISO-8859-1 for all their phones. This
causes two problems:
- mangled characters and/or
- crashes inside libecal/gdbus

It is uncertain whether all devices have this problem. A poll did not
yield any results
(http://syncevolution.org/blogs/pohly/2011/question-sony-ericsson-users-charset). So
let's change it for those who have reported problems.

To revert the change, copy
/usr/share/syncevolution/xml/remoterules/server/00_sony_ericsson.xml
into $HOME/.config/syncevolution-xml/remoterules/server (after
creating that directory) and remove the lines with ISO-8859-1.

This was originally reported for contacts, and now also for calendar
data. The calendar case was seen as a crash of the syncevo-dbus-server:

GLib-CRITICAL **: g_variant_new_string: assertion `g_utf8_validate (string, -1, NULL)' failed

Program received signal SIGSEGV, Segmentation fault.
g_variant_is_trusted (value=0x0)
     at /build/buildd/glib2.0-2.28.6/./glib/gvariant-core.c:600
        in /build/buildd/glib2.0-2.28.6/./glib/gvariant-core.c

Thread 1 (Thread 0xb7fce850 (LWP 3402)):
     at /build/buildd/glib2.0-2.28.6/./glib/gvariant-core.c:600
     at /build/buildd/glib2.0-2.28.6/./glib/gvariant.c:3081
     at /build/buildd/glib2.0-2.28.6/./glib/gvariant.c:4093
     app=0xbfffca4c) at /build/buildd/glib2.0-2.28.6/./glib/gvariant.c:4248
     at /build/buildd/glib2.0-2.28.6/./glib/gvariant.c:4188
     in_calobj=0x8435fe8 "BEGIN:VEVENT\r\nSUMMARY:THW Sim Pr\374fung\r\nDTSTART:20070420T230000Z\r\nDTEND:20070421T225900Z\r\nBEGIN:VALARM\r\nTRIGGER;VALUE=DURATION:PT45M\r\nACTION:DISPLAY\r\nEND:VALARM\r\nEND:VEVENT\r\n",
2011-08-10 13:01:47 +02:00
Patrick Ohly
c50b45865c CalDAV: transform UTC RECURRENCE-ID for Evolution (BMC #22594)
Evolution shows a meeting twice on the day of a modified recurrence,
if the meeting series was originally created and modified in Exchange,
then imported into Google Calendar.

The reason is that the RECURRENCE-ID in that case ends up being
in UTC, even if the parent event has a time zone. Evolution and/or
libical seem to have a bug here, IMHO they should recognize that the
RECURRENCE-ID time is the same.

SyncEvolution now works around this by transforming the UTC
RECURRENCE-ID time into the time zone of the DTSTART time of the
parent event. This is combined with removal of X-LIC-ERRORS into
a new fixIncomingCalendar() method which needs to be called
whenever a complete VCALENDAR is received from the CalDAV server
(adding data from a report, GET).

This transformation changes the "rid" part of the item IDs. It should
be okay in a two-way sync (remove one sub item, add another) and
a slow sync (libsynthesis recognizes the times as equal).
2011-08-10 12:43:44 +02:00
Patrick Ohly
7b73d0d94d libical: added more compatibility wrapper entries
Added some more functions needed to work with DTSTART and RECURRENCE-ID.
Removed icalproperty_vanew_lastmodified() because its entry was incomplete
and unused.
2011-08-10 12:41:31 +02:00
Patrick Ohly
81a50847ec D-Bus testing: ignore failures to kill processes which have quit
ShutdownProcess() has a race condition between calling popen.poll()
and os.kill(): the process might quit in the meantime. The check
also was missing for the initial kill().

Better check first and continue when kill() fails because the
process was not found.
2011-08-08 11:04:52 +02:00
Patrick Ohly
f0f2fe5325 WebDAV: added logging of deadline
Nightly testing did not resend a PUT when it could (should?)
have because the deadline was exceeded. Added logging to
track down what the chosen deadline is.
2011-08-08 10:36:18 +02:00
Patrick Ohly
7441eb1711 testing: improved Client::Source::*::testImport
Instead of aborting the test at the first item which
fails to import, collect the error messages (from the
exceptions), do the comparison of imported data
against the reference data and then either report
the import failures (if there were any) or the comparison
failure (if that broke).

The advantage is that a single run of the test shows
all problems that exist.
2011-08-07 16:41:43 +02:00
Patrick Ohly
18a28a965e testing: fixed running commands with empty args
An empty argument (like the server list in tests where no server
was involved) must be quoted, too, otherwise it gets dropped.
Broke parsing of some test results.
2011-08-07 14:05:47 +00:00
Patrick Ohly
200476de8c testing: handle sudo as part of shell prefix
When sudo is necessary to enter the target platform, environment
variables no longer can be sent via the environment because
sudo ignores those. They must be be put onto the command line
of sudo, which then puts them into then environment of the invoked
process (depends on SETENV: permission in /etc/sudoers!).

This commit reorders the command line so that sudo comes
first, followed by env variables.
2011-08-07 14:05:47 +00:00
Salvatore Iovene
7411f7e8e3 Fixes BMC#21311 - item operations: authentication problem for WebDAV when using keyring
Use checkPassword() before trying to --print-items. This will either
prompt for the password at command line, or ask it from the keyring
if --keyring is specified (or if using the dbus server).
2011-08-05 14:37:41 +02:00
Salvatore Iovene
10418e133a Cmdline.cpp: we don't need *both* gnome-keyring and kwallet to store the pwd. 2011-08-05 14:37:41 +02:00
Patrick Ohly
410ef51e1e D-Bus testing: catch hanging syncevo-dbus-server
Nightly testing got stuck in test-dbus.py when syncevo-dbus-server
somehow didn't shut down properly after a D-Bus test ran: test-dbus.py
must have been in subprocess.communicate() after sending a SIGTERM,
but syncevo-dbus-server did not shut down.

Now such a situation is detected by (semi-)busy polling for process
completion and sending a SIGKILL after 5 seconds. A timeout in
subprocess.communicate() would have been nicer, but doesn't seem to
be supported by Python.
2011-08-05 08:41:28 +02:00
Patrick Ohly
fef657a7da testing: syncing of parent/child items (for BMC #22329)
Client::Source::*::testLinkedItems* tested local storage operations
for events sharing the same UID. For syncing, only testItems had
a little bit like it. This commit adds more tests specifically
designed to exercise corner cases of syncing such linked items:
- sync parent, then sync with child and other event added on different
  sides (corner case in CalDAV change tracking, BMC #22329)
- sync child
- sync child, sync parent later
2011-08-05 08:38:32 +02:00
Patrick Ohly
3799ddf1d8 testing: added Client::Sync::testDeleteBothSides (for BMC #22327)
Trigger "item already deleted" in syncing, check that syncing
completes and leaves no items around.

Somehow the problem in BMC #22327 must have been different: when
running the test, the Synthesis engine recognizes that the item
was removed on both sides and logs:

So this test doesn't really cover BMC 22327. But it is worthwile
to run it anyway.
2011-08-05 08:38:24 +02:00
Patrick Ohly
70d7814904 EDS compatibility: accept libedataserver-1.2.so.14
EDS 2.32 comes with libedataserver-1.2.so.14 and works. No need
to warn about a potential compatibility issue.
2011-08-03 13:12:38 +02:00
Patrick Ohly
cb25e44871 CalDAV: continue despite Google Calendar access problems (see BMC #19484)
Google Calendar checks whether a CalDAV client is allowed to update
particular events. In combination with meeting invitations this has
led to know issues where desirable changes were rejected (see
http://code.google.com/p/google-caldav-issues/issues/detail?id=38).

Details are murky whether that bug is still open. I hit the "403 You
don't have access to change that event." problem both in updating
a meeting series and creating it.

This commit ensures that when updating fails, the errors is treated as
a temporary, per item error (417). The sync session then continues.
The overall result will be STATUS_PARTIAL_FAILURE = 22001 and the
next session will retry the same item. This is better than aborting
the session (situation without this patch) or ignoring the problem
(alternative solution).

The same error is not handled when creation fails. This might need
further investigations.
2011-08-03 13:09:30 +02:00
Patrick Ohly
ac8fdc42b4 CalDAV: fixed incorrect change tracking causing "event not found" (BMC #22329)
During an incremental sync, when an unmodified meeting series on the CalDAV
server had to be extended (= adding a detached recurrence), the operation failed
with "event not found".

The root cause was a bug in updateAllSubItems(): due to a copy-and-paste bug,
it cleared the cache instead of adding the modified items to it. Therefore
unmodified items, added to the cache earlier, where not found later on.

Normally they weren't needed. The exception is reading in preparation
for adding a detached recurrences.

Fixed by removing the m_cache.clear(). That is valid in this case even
if the operation is repeated, because adding already read items will
simply overwrite them.

Also added some debug logging which helped to track this down.
2011-08-03 12:30:32 +02:00
Patrick Ohly
37ab038840 CalDAV: handle delete<->delete conflict during local sync (BMC #22327)
If the same event was deleted both locally and in the CalDAV server, syncing
failed with "event not found".

It is normal that the Synthesis engine requests the removal of
non-existent items. CalDAVSource needs to handle that in
removeSubItem() and getSubDescription().
2011-08-03 12:14:58 +02:00
Patrick Ohly
8c7496d6b4 SubSyncSource: getSubDescription() and deleteSubItem() must handle non-existent items (part of BMC #22327)
As noticed with CalDAV syncing, these two functions must tolerate
being called for non-existent items or sub-items.
2011-08-03 12:09:14 +02:00
Patrick Ohly
44629fdd59 WebDAV: fixed item operations without configuration (BMC #22164)
Item operations like --print-items failed if the configuration didn't exist:
[ERROR] : virtual read-only configuration node, cannot write property webDAVCredentialsOkay = 1

This was caused by trying to write the webDAVCredentialsOkay property
into a temporary, read-only configuration. The fix is to check for
read-only configs before attempting to use the property.

Alternatively it would have been possible to catch exceptions, but it
is not obvious which errors can be ignored.
2011-08-01 13:07:22 +02:00
Patrick Ohly
648307a715 ConfigNode: added isReadOnly() (needed for BMC #22164)
Some users of ConfigNode (like the WebDAV backend) need to know
whether setting a optional property will succeed before attempting
it. When they know that it fails because the node is read-only, they
can skip setting it.

The alternative would be to throw a well-defined exception and catch
it, but that is not in line with the SyncEvolution design. Exceptions
should be for real, unexpected errors.
2011-08-01 13:04:10 +02:00
Patrick Ohly
b73fd3dfce auto sync: show all failed syncs except for temporary network errors (BMC #21888)
Notifications were meant to be shown for all errors except temporary
ones (http://bugzilla.moblin.org/web/bug_report_10000.html). This has
never been implemented correctly since the feature was introduced:
instead of hiding known temporary errors, all errors except 500 (fatal
error) were suppressed.

This commit switches to white listing the known errors which are
temporary and suppresses those. Right now that happens to be only one,
network problems.
2011-07-26 16:47:28 +02:00
Patrick Ohly
79b65dff05 vcard: adapted PHOTO data inlining to latest libsynthesis
The encoding of PHOTO data which uses plain text when possible is
now only done by libsynthesis if conversion="BLOB_AUTO" is chosen
explicitly.
2011-07-25 15:07:49 +02:00
Patrick Ohly
d6d6e8ca39 vcard: inline local photo data (BMC #19661)
Use the new READ() script method in libsynthesis to inline local photo
data right before sending to a remote peer.

Tests were added in combination with SyncEvolution server for inlining
a special well-known file (testcases/local.png) and failing to inline
(file doesn't exist). In the latter case the URI is sent unchanged.
2011-07-22 09:35:03 +02:00
Patrick Ohly
eeded54cf4 vCard: support VALUE parameter, fixed TYPE (part of BMC #19661)
The VALUE parameter was ignored completely and thus got lost in the
Synthesis engine. Added it as a string.

The TYPE parameter was an incomplete enum. Better allow arbitrary
strings.

Both parameters must be copied together with the PHOTO data they
belong to. In combination with merge="fillempty" this can be
problematic: if one of the parameters is empty, it may be overwritten
although the PHOTO data is not copied.

This problem is solved by ensuring that the internal field list never
has empty PHOTO_TYPE/VALUE fields. This is done by setting "binary"
resp. "unknown" when importing contact data from a peer or the local
Evolution backend and removing them again before sending to a peer or
storing.

The same change needs to be done with other backends. It is not made
mandatory because some backends (like file) might want to store these
values explicitly.

Because it is unknown which peers support VALUE=uri, only the
CLIENT_TEST_SERVER=syncevolution testItem testcases contain a contact
with such a PHOTO.
2011-07-21 16:09:49 +02:00
Patrick Ohly
7a1c5fbfca Memotoo testing: strengthen PHOTO comparison
The PHOTO property was removed completely for Memotoo because the
literal comparison used to fail due to transcoding the images. Now
synccompare keeps the PHOTO property and only removes the data itself.

This was done in order to test PHOTO;VALUE=uri. It turned out that
Memotoo does not support those.
2011-07-21 11:10:31 +02:00
Patrick Ohly
8cdc408258 D-Bus testing: improved auto sync tests
The auto sync tests failed when run in combination with other tests.
The root cause turned out to be side effects of these other tests,
but hardening the SessionChanged signal checking is useful anyway.
2011-07-20 23:04:47 +08:00
Patrick Ohly
f21b829607 D-Bus testing: removed side effect of TestDBusServerPresence tests
The TestDBusServerPresence tests have to invoke syncevo-dbus-server with
DBUS_TEST_CONNMAN set in the environment, to get it to use the mock
implementation on the session D-Bus.

They did this by modifying os.environment *permanently*. That had the
effect that all later tests also ended up using the mock ConnMan. This
made testing confusing because tests failed only when run in combination
with the presence tests (fixed previously by improving the mock ConnMan
implementation).

This commit addresses the root cause by putting the env variable only
temporarily into the environment of those tests which really need it.
2011-07-20 22:59:14 +08:00
Patrick Ohly
de9eb60ab2 D-Bus testing: avoid signal cross-talk between tests
When one test requested signals for D-Bus server 'org.syncevolution' and
then didn't consume them before completing, these signals were delivered
to the next test because the "dbus" instance is shared. When that
next test happens to listen for the same signals, it could get confused.

Happened with testAutoSync* because TestMultipleConfigs did not consume
all SessionChanged signals.

Instead of forcing all tests to consume all signals (might be too
restrictive and definitely was error-prone), ensure that each test
only processes the signals emitted by its own private syncevo-dbus-server
instance. This is achieved by requesting the signals for that server's
bus name instead of the generic 'org.syncevolution' name.
2011-07-20 22:53:32 +08:00
Patrick Ohly
b518a06777 D-Bus testing: improved logging
Ensure that all output is unbuffered by adding the -u command line
option.

Create separate D-Bus and syncevo-dbus-server log files
for each test, with the name derived from the current class and
method. str(self) gives that without depending on internals.

Add environment and arguments to syncevo-dbus-server log. Make
detection of "server is running" more resilient.
2011-07-20 22:44:36 +08:00
Patrick Ohly
cc593e5ed7 syncevo-dbus-server: online status wrong without Network Manager or ConnMan (BMC #21543)
When neither Network Manager nor ConnMan are running, network presence was "not
online". This prevented running automatic syncs. Primarily (exclusively?) affected
nightly testing in the minimal chroots.

The solution is to detect when both managers were not found on D-Bus and
then set the status to "online".
2011-07-20 22:40:32 +08:00
Patrick Ohly
e1e7ae5f8c README: crucial syncURL was missing
The instructions added for 1.1.99.5 lacked a syncURL=local://@webdav
in the new section for setting up WebDAV syncing.
2011-07-20 10:47:38 +02:00
Patrick Ohly
76986c3694 testing: fixed eds_memo update tests
Mangling the VJOURNAL test data by prepending "U " to the DESCRIPTION
caused problems because the first line has to match the SUMMARY (in
plain text, only the body is sent and SUMMARY is taken from the first
line).

This commit fixes these problems by also inserting the "U " into the
SUMMARY of memos.
2011-07-20 10:35:19 +02:00
Patrick Ohly
db671a6716 Google Calendar testing: ignore loss of alarm description
Google Calendar replaces explicit DESCRIPTIONs in a VALARM with
a generic "This is an event reminder" and adds it when there
is no DESCRIPTION.

Let's ignore that while testing by setting that Google default text in
the Google testItem test data.
2011-07-19 17:52:35 +02:00
Patrick Ohly
d39ba4adf0 Google Calendar testing: remove "meeting invitation" from sync tests
The Google server seems to think that it can take over meeting
acceptance/decline handling when new events are stored on the server.

For example, PARTSTAT=ACCEPTED gets replaced with PARTSTAT=NEEDS-ACTION.
It has also been observed that participants and organizer get overwritten.

This needs further investigation, see BMC #19484. In the meantime I am
removing the problematic test case to get the testItems test to pass.

Same as commit 789550 for testImport.
2011-07-19 17:43:13 +02:00
Patrick Ohly
b84a696956 Google Calendar testing: avoid test failure because of BYMONTHDAY=6
Google Calendar modifies the RRULE of a recurring event. The
transformation is semantically correct, but breaks the strict
comparison in the Client::Sync::eds_event::testItems test.

Fixed by making the same change in the reference test data for Google
Calendar.
2011-07-19 17:38:24 +02:00
Patrick Ohly
62be3b0c0a Google Calendar testing: avoid "custom time zone" test
Google Calendar recognizes the "custom US time zone" despite using
different names for TZID and TZNAME. Probably uses the offsets. When
it recognizes the zone, it replaces it with its own internal zone,
which breaks the test.

That's okay, so let's stop using this particular test event to get the
test to pass.
2011-07-19 17:29:59 +02:00
Patrick Ohly
de32cbdd1d Google Calendar testing: ignore UTC -> timezone conversion
Google Calendar converts UTC time stamps into the time zone of the
calendar as set when the event is stored in the calendar. This changes
the semantic of the event slight, in particular for recurring events,
but is acceptable and is done correctly for the event's point in time
by Google, so let's accept this change.

This commit adds the Europe/Berlin time zone to the test data used for
CLIENT_TEST_SERVER=googlecalendar Client::Sync::eds_event
so that the change above no longer occurs in the testing and thus doesn't
break the test.

Because a time zone is set explicitly and preserved by Google, the Google
Calendar time zone setting doesn't matter for testing.
2011-07-19 17:12:56 +02:00
Patrick Ohly
15a26af4eb client-test: fix testChanges for ActiveSync
The Client::Source::eas_event::testChanges test failed incorrectly
because an ActiveSyncSource was created before deleting the previous
one. That breaks change tracking because the previous instance must
flush its in-memory item list first.

Adding an explicit source.reset() fixes the problem.
2011-07-19 15:21:25 +02:00
Patrick Ohly
ba9d12b720 autotools: undo accidental change in commit for README
Commit 36af6f accidentally included a change to the main Makefile.
Undoing that.
2011-07-19 15:21:25 +02:00
Patrick Ohly
5e59ed6865 Google Contacts: ensure that first/middle/name are set when storing in EDS (BMC #20864)
Evolution and the MeeGo UX assume that first/middle/last name are set.
That is not the case when a contact is created in the Google Contacts
web interface. Such contacts are sent by Google without the N
property. That is surprising because Google supports the N property
(it is returned for contacts created via SyncML, and internally Google
distinguishes between the name components).

This commit adds a workaround for all peers (not just Google) which
ensures that first/middle/last name are set whenever possible. If FN
is set, it is split so that the first and last word are first/last
name, the rest is the middle name. As a special case a trailing comma
at the end of the first words is recognized as "Doe, John Middle"
format.

If the full name is empty, the first email address and (if that is also
empty) the first phone number are used as additional fallbacks for the
first name.
2011-07-19 15:21:25 +02:00
Gabriel Schulhof
1a5bb1af16 Merge branch 'master' of gitorious.org:meego-middleware/syncevolution 2011-07-19 11:17:16 +03:00
Patrick Ohly
36af6f1b31 README: added note about preventSlowSync in local sync
Because the client in the local sync starts the sync,
preventSlowSync=0 must be set in the target config to have an effect.
2011-07-18 18:01:35 +02:00
Patrick Ohly
de009100f5 bumped version to 1.1.99.5b 2011-07-18 02:58:11 +08:00
Patrick Ohly
cb4b7e92b4 --enable-eds-compatibility: added methods needed by WebDAV backend (BMC #21284)
This fixes the WebDAV backend in --enable-eds-compatibility mode by adding
the libical methods used by that backend.
2011-07-18 02:55:04 +08:00