Client::Source tests with different servers may need different test
data. "testconfig" allows choosing something other than eds_event/contact,
"testcases" (more likely to be useful) the testcases/* file.
For servers which support both CalDAV and CardDAV, carddav/testcases
and caldav/testcases can be used.
Setting CLIENT_TEST_FULL_TIMEZONES disables any kind of
normalization of VTIMEZONE definitions. This is useful
in situations when the content is expected to be identical
because it is generated by the same software.
Because the UI checked for the no-longer existing "type" property,
it didn't handle any sources at all. Replacing with the new
"backend" property name solves the problem.
The Perl version in Ubuntu Lucid had even more problems with
synccompare than other versions. Compiling the latest stable
Perl also didn't help (stack backtrace below).
This patch disables UTF-8 support in string operations. The user-visible
effect is that line length calculation is wrong when multi-byte
characters are involved. This is better than not getting any
output when the installed Perl is bad.
File input and stdout are still using UTF-8, so UTF-8 content
is passed through okay.
*** glibc detected *** /usr/local/bin/perl-synccompare: double free or corruption (!prev): 0x08203278 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(+0x6b591)[0xf7616591]
/lib/tls/i686/cmov/libc.so.6(+0x6cde8)[0xf7617de8]
/lib/tls/i686/cmov/libc.so.6(cfree+0x6d)[0xf761aecd]
/usr/local/bin/perl-synccompare(Perl_offer_nice_chunk+0x3d)[0x80d2b0d]
/usr/local/bin/perl-synccompare[0x80c426a]
/usr/local/bin/perl-synccompare(Perl_hv_common+0xafa)[0x80c628a]
/usr/local/bin/perl-synccompare(Perl_pp_helem+0x24a)[0x80d138a]
/usr/local/bin/perl-synccompare(Perl_runops_standard+0x13)[0x80c9623]
/usr/local/bin/perl-synccompare[0x80f74b0]
/usr/local/bin/perl-synccompare(Perl_pp_require+0x11da)[0x80f9c7a]
/usr/local/bin/perl-synccompare(Perl_runops_standard+0x13)[0x80c9623]
/usr/local/bin/perl-synccompare(Perl_call_sv+0x165)[0x8077705]
/usr/local/bin/perl-synccompare(Perl_swash_init+0x1d6)[0x8128686]
/usr/local/bin/perl-synccompare(Perl_to_utf8_case+0x213)[0x812a723]
/usr/local/bin/perl-synccompare(Perl_to_utf8_lower+0x37)[0x812a7f7]
/usr/local/bin/perl-synccompare[0x8121280]
/usr/local/bin/perl-synccompare(Perl_regexec_flags+0xb58)[0x8126b48]
/usr/local/bin/perl-synccompare(Perl_pp_subst+0x207)[0x80d1917]
/usr/local/bin/perl-synccompare(Perl_runops_standard+0x13)[0x80c9623]
/usr/local/bin/perl-synccompare(perl_run+0x2bd)[0x807823d]
/usr/local/bin/perl-synccompare(main+0x115)[0x8062c35]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6)[0xf75c1bd6]
/usr/local/bin/perl-synccompare[0x8062a81]
======= Memory map: ========
08048000-0815e000 r-xp 00000000 08:05 2007582 /home/nightly/perl-5.12.3-lucid-i386/bin/perl
This is done by inserting the test specific env variables after
the default value. Also reformatted the string and use saner
string formatting.
The Apple test uses that to increase its allowed runtime.
Passing the "valgrind[check.sh]" prefix through to resultchecker
causes unnecessary valgrind output in the runtest .out file because
some of the commands invoked by resultchecker are started under valgrind.
Strip valgrind from the shell prefix, leaving the rest (= schroot + dbus-session)
in place.
An empty "server" parameter still wasn't handled
correctly, leading to missing result emails.
Empty string must be treated like an empty list.
resultchecker.py incorrectly stored the result of
googlecalendar for google because it was only checking
the line prefix. Now the check ensures that the line
starts with a complete word matching the server name.
The stdout of synccompare was no longer redirected into
the .log file of the test it belonged to. Enabled that
again by redirecting both stderr and stdout.
The combination of all enabled sources was tested twice,
once in the order specified by CLIENT_TEST_SOURCES,
once reversed.
This used to make a difference with the Funambol SyncML
library, but not anymore with Synthesis. Disabled this
because of the increased time for testing. Can be
enabled again by setting CLIENT_TEST_REVERSE_SOURCES.
Boost's split iterator on Debian Testing returns an empty
string, which wasn't seen before. Caused an invalid
complaint about an unknown empty parameter in the sync URL.
Checking for empty string now.
Failed to build because getPeerMimeType() now uses
a std::string as return type. getMimeType[Version]()
are no longer needed for sources derived from SyncSource.
The distinction between vcard21 and vcard30 became mute in the Evolution
backend a while ago. Both tests ended up using the vCard 3.0 Evolution
tests data and the default uri for each server. This patch removes
the vCard 2.1 special case.
It also renames the tests and test data to reflect that they always
were Evolution specific. The new naming convention, also applied
to file, QtContacts, KCalExtended, XMLRPC, Maemo and Akonadi backends, is
now <backend>_contact/event/task/memo, with eds/file/qt/kcal/maemo/kde
as backend names.
The reasoning is:
- results in unique string (in particular no overlap with
backend type names), easier to search for
- underscore already used before (in contrast to hyphen)
- no plural-s to keep the name shorter
The Akonadi backend should be using its own test data instead of
the Evolution ones.
Running "syncevolution" without parameters ran into a null
pointer access in a Boost shared pointer, leading to an abort
of the program with a Boost exception.
Fix this by checking whether the backend really has a context
node. Long term we need a solution which provides the necessary
information even when running without a sync config.
The file:// prefix is no longer supported by EDS 2.32.
It also isn't supported by several other backends, for
example Akonadi. So let's use database names instead,
with a prefix defined via a new command line option.
These databases or directories (for the file backend)
must have been created in advance.
The script assumed that "schroot" was always used as "schroot -c <chroot>".
That broke when using "schroot -v -c <chroot>" for debugging.
This patch removes the assumption by inserting -i into the
schroot invocation and retrieving the name from the output.
When the preparation failed and no tests were run, no email
with the HTML test report was sent.
Fixing this at two places:
- resultchecker.py always needs a "server" argument,
even if it is empty
- the compare style sheet depends on a testing section,
so write at least an empty one
When adding Ubuntu Lucid to the nightly testing, it was observed
that on different platforms ical20.ics.nokia_7210c.tem.patch was
created differently, leading to a dirty source directory.
This patch avoids this by setting time stamps of the generated
file such that testcase2patch does not attempt to regenerate the
patch file unless the patched test cases are really getting edited
after creating them.
Also cleaned up logging of the operations a bit.
The recent change around WebDAVCredentialsOkay broke compilation
when WebDAV was disabled: the declaration and inclusion of
relevant header files also must be outside of the ifdef.
apple, googlecalendar and yahoo include now also Client::Sync
tests. For "apple", this is the full set of tests. For the
others, only testItems is run.
The "source-config" peer in the target context used to be required for
local sync. Now it is optional. The reasoning is:
- For WebDAV, copying username/password from the main config may
already be enough to find the server.
- For local file sources, no sync properties ared needed
at all.
In both cases, "source-config" is used if available. That can be useful
to set loglevel separately, for example.
For SyncEvolution<->SyncEvolution synchronization there should be
no need to set the uri property of each source explicitly, because
typically it is the same as the source name.
With this patch, the source name is used as fallback. Because some
code needs to check whether the URI is set, getURI() returns the
setting directly (as before) whereas getURINonEmpty() always returns a
non-empty result with the name as fallback.
Specifying an invalid template name continued with an empty template
if enough properties were specified. That's not correct and leads
to unexpected results:
- peerIsClient might have been part of the desired template.
- Set of sources to be created is defined by template.
Now an error is printed for this case.
Printing of templates was changed to use underscores instead of
spaces, but retrieving a template was not. Turned out that
it doesn't compare against the list that it builds up, but instead
does a matching against the fingerprint.
Now the fingerprint comparison treats spaces like underscores,
so that "SyncEvolution_Client" matches against the "SyncEvolution Client"
fingerprint. Better for backwards compatibility, too.
The device templates contained spaces ("Nokia N900", for example),
which was hard to use on the command line and in scripts. Now
an underscore is used instead of spaces.
This is a better fix for the webDAVCredentialsOkay property
registration: always do it, regardless whether the backend is enabled,
because then the config migration code will always know about it.
Also fixed automated testing to include that property.
Logging calls might end up calling functions which modify errno.
Seen once where logging reported a "pipe error" and the following
exception a "resource temporarily unavailable".
testOneWayFromClient was still failing in server mode because of a
similar issue as with slow sync as fallback for refresh-from-server:
the client can ask for a two-way sync and then withhold all of its own
changes to achieve the same effect.
Detect this based on the requested sync mode.
Only the "evolution" test allowed selecting which client-test
tests to run. Now this code is in SyncEvolutionTest class itself.
The parameter to it with the default test list was turned into
a simple string, to match the value of the --enable parameter.
This is needed for local CalDAV/CardDAV tests to succeed.
With http_proxy set, all traffic would be attempted via
these proxies, which doesn't work.
All tests which need proxies have to be configured such
that proxyHost/useProxy is set correctly in the server configs.
recv() may return -1 and EAGAIN/EWOULDBLOCK, according to the man
page. That was treated as a fatal error instead of retrying, which
was the original intention.
For writev() it is less clear whether EAGAIN/EWOULDBLOCK need to be
handled. Let's catch them anyway.
The following code crashed if m_length was read after executing
the release() calls:
realloc(buffer.m_message.release(), buffer.m_message->m_length)
That's because release() resets the m_message pointer. It seems that
clang orders execution like that whereas gcc doesn't.
Some of our extensions are optional, for example X-EVOLUTION-UI-SLOT
(because Nokia phones had problems with that). CalDAV/CardDAV servers
are meant to preserve all extensions, so let's send them everything we
have.
For calendar, this is not yet relevant in practice (rule doesn't do
anything).
Apple Calendar server + CardDAV really preserves the slot parameter.
Yahoo CardDAV does not, but at least accepts it.
Apple Calendar server does not seem to support unlimited
recurrences. It adds a UNTIL clause. Ignore that by removing
the test case from the Apple specific test data.
Due to a bug in libical, the Apple Calendar server's data
is nor parse correctly and ORGANIZER gets lost. This patch
temporarily removes the property from the test data to get
the testItem test to pass.
When deleting items on the server due to "refresh-from-client" sync,
we want to have these items counted in the statistics, just as on
a client in a "refresh-from-server".
The code doing this had to be updated to distinguish between client and
server mode.
The main bug fix is for partial writes: the base address wasn't getting
updated, so the same data would have been sent multiple times. Not sure
whether this really occurred in practice.
fcntl() was called for random file descriptors due to a buffer
overflow. If a valid file descriptor was hit, the real user of it
might have gotten confused.
writev() was passed unitialized memory. Okay in this case (hole in struct),
but ugly in valgrind and easily fixed with memset().
Creating test data in SyncTests::doVarSizes() took a long time
because it created a TestingSyncSource multiple times inside
a loop. Each destruction of that instance caused a 5 second delay,
necessary to ensure correct time-based change tracking.
Adding a second version of insertManyItems() which uses a single
instance of TestingSyncSource created by doVarSizes() itself
makes it possible to sleep only once.
This patch relies on libsynthesis reporting a stable sync mode
of each source in the PEV_ALERTED progress event. This was added
recently to libsynthesis in server mode.
This patch deals with a client that falls back to "delete data + slow
sync" as a way of doing a refresh-from-server (as Synthesis engine
itself does) at least in one case: server-alerted syncs know the originally
requested sync mode and assume that a slow sync is the intended mode,
which then gets translated back into refresh-from-server.
A session with such a sync initiated by a client is still recorded as
"slow sync".
An empty "database" property for a virtual source lead to a useless
error about instantiating a source with an empty name. Now the error
is reported for the virtual source and includes the "database" value.
A sanity check that the source really had exactly two sub-sources
was missing. Added.
The file backend refuses to create a source if backendFormat is unset.
This was reported as "<source>: backend 'file' not supported",
which was confusing because the backend was in fact supported.
Now the error message is "<source>: backend 'file' not supported or
not fully configured (format '<format>')".
Exceptions encountered in the child process were printed as [ERROR],
but not reported to the parent process and thus did not end up in the
final sync report.
Now they are, which makes finding the root cause of a failed local
sync a bit easier.
The error message "@<context>/<source>: source not configured" becames
confusing when <source> is empty. Now "missing URI for one of the
sources" is printed instead.
The command line instantiated sources with the name "list" (cut-and-paste
error?) instead of using the proper name. As a result, error messages
created by these sources didn't refer back to the configuration. Now
the real name is used.
The Akonadi source reused the EDS test names (vcard30, ical20, ...).
This has the effect that the configuration of these tests was
overwritten each time client-test was started. Each backend must
use its own names here.
For Akonadi, kde_events/tasks/memos were chosen. "calendar" was avoided
because some people include tasks in that category.