Commit graph

3696 commits

Author SHA1 Message Date
Patrick Ohly
e6de1f7704 WebDAV: add "testconfig/testcases" parameters to CLIENT_TEST_WEBDAV
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.
2011-05-10 15:57:29 +02:00
Patrick Ohly
c09fb739d3 ConfigProps: added get() method with default value passed as parameter
This is useful when reading a property value must succeed, regardless
whether it is set.
2011-05-06 16:15:19 +02:00
Patrick Ohly
c9f2889007 synccompare: optionally check for exact time zone definitions
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.
2011-05-05 15:34:07 +02:00
Patrick Ohly
7433b445a6 GTK sync-ui: selection of individual sources was broken (BMC #17113)
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.
2011-05-05 15:34:06 +02:00
Patrick Ohly
a383f99b7a synccompare: avoid segfault in Perl interpreter by limiting UTF-8 support
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
2011-05-05 20:16:45 +08:00
Patrick Ohly
9dfc18356d nightly testing: allow tests to override CLIENT_TEST_ALARM
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.
2011-05-05 20:16:45 +08:00
Patrick Ohly
adf061f4db nightly testing: avoid using valgrind in resultchecker
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.
2011-05-05 20:16:45 +08:00
Patrick Ohly
a3b4e0769d nightly testing: handle runs without tests, part II
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.
2011-05-05 20:16:10 +08:00
Patrick Ohly
0038d0fd85 nightly testing: ignore minor leak in libecal 2.32
Updating to libecal 2.32 from Debian Testing showed
a new, small leak in libecal. Ignore it.
2011-05-05 20:16:10 +08:00
Patrick Ohly
fed4e6b3b9 client-test: redirect synccompare output
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.
2011-05-05 20:16:10 +08:00
Patrick Ohly
d78ade7930 client-test: disabled reversed combination of sources
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.
2011-05-05 20:16:10 +08:00
Patrick Ohly
0647dcfefd WebDAV + Debian Testing: fixed invalid syncURL error message
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.
2011-05-05 20:16:10 +08:00
Patrick Ohly
cbc02d2fc8 SQLite backend: adapted to SyncSource API changes
Failed to build because getPeerMimeType() now uses
a std::string as return type. getMimeType[Version]()
are no longer needed for sources derived from SyncSource.
2011-05-05 20:16:10 +08:00
Patrick Ohly
b6861ed768 nightly testing: renamed ical20/itodo20/vcard30/text, removed vcard21 from Evolution backend (BMC #14972)
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.
2011-05-05 20:15:55 +08:00
Patrick Ohly
8bab6ce419 WebDAV: avoid null pointer error when listing databases
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.
2011-04-30 13:32:56 +02:00
Patrick Ohly
f29b87283f nightly testing: fixed typo in Google CalDAV testing
The sync testing is done against ical20, not vcard30.
2011-04-30 19:32:26 +08:00
Patrick Ohly
7422a1e2a1 nightly testing: avoid CLIENT_TEST_EVOLUTION_PREFIX=file://
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.
2011-04-30 19:32:26 +08:00
Patrick Ohly
93c3bb5ea2 resultchecker.py: don't make assumptions about "schroot"
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.
2011-04-30 19:32:26 +08:00
Patrick Ohly
be66091476 nightly testing: handle runs without tests
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
2011-04-30 19:32:26 +08:00
Patrick Ohly
4bd8f98026 nightly testing: avoid updating test case patch files if unchanged
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.
2011-04-30 19:16:01 +08:00
Patrick Ohly
dabfe833df WebDAV: fixed compile error when it was disabled
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.
2011-04-21 21:50:25 +02:00
Patrick Ohly
9e56f68b10 bumped version to 1.1.99.4 2011-04-21 12:48:55 +02:00
Patrick Ohly
18d4d22723 nightly testing: fixed splitting of enabled tests
Must use regex, string.split() does not split at character
set.
2011-04-21 18:34:40 +08:00
Patrick Ohly
86ace96ec1 nightly testing: added sync testing with CalDAV/CardDAV
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.
2011-04-21 18:34:40 +08:00
Patrick Ohly
cf3ab837c2 local sync: "source-config" optional
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.
2011-04-21 12:36:12 +02:00
Patrick Ohly
436c23f827 config: "uri" now has source name as fallback
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.
2011-04-21 12:20:00 +02:00
Patrick Ohly
d2e70d93e5 command line: an invalid --template parameter did not always trigger an error
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.
2011-04-20 22:11:36 +02:00
Patrick Ohly
66a770c4bc command line: accept template name with underscores
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.
2011-04-20 18:50:25 +02:00
Patrick Ohly
98c98fa29a command line: avoid spaces in the handles of template names
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.
2011-04-20 18:15:07 +02:00
Patrick Ohly
118662a301 WebDAV: always register our special property
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.
2011-04-20 18:13:16 +02:00
Patrick Ohly
6147f6f718 local sync: make a copy of errno before calling something which might overwrite it
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".
2011-04-20 16:47:24 +02:00
Patrick Ohly
2587fe9382 server sync session: detect final sync mode, part II (BMC #2786)
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.
2011-04-20 16:47:24 +02:00
Patrick Ohly
feec9fffc5 nightly testing: support --enable foo=<tests> for all tests
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.
2011-04-20 20:47:57 +08:00
Patrick Ohly
10656b6484 nightly testing: unset http_proxy for client-test runs
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.
2011-04-20 20:47:57 +08:00
Patrick Ohly
c7a730ac08 local sync: fixed non-blocking recv()
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.
2011-04-20 14:23:59 +02:00
Patrick Ohly
e3ccba5d1c local sync: fixed potential NULL pointer read
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.
2011-04-20 14:20:46 +02:00
Patrick Ohly
162568b064 WebDAV: send all optional extensions to CalDAV/CardDAV servers
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.
2011-04-20 12:50:02 +02:00
Patrick Ohly
944321542e CalDAV: ignore Apple Calendar server "unlimited recurrence" issue
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.
2011-04-20 11:18:21 +02:00
Patrick Ohly
13b03180f6 CalDAV: temporarily ignore lost ORGANIZER (BMC #16452)
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.
2011-04-20 11:16:09 +02:00
Patrick Ohly
f3fcd98fae device sync: added debug messages to SAN sending
Neither the SAN message nor creating it left any traces in the log
file. That made it a bit hard to track what was sent. Added some debug
logging.
2011-04-20 10:34:42 +02:00
Patrick Ohly
4ca0883b66 server sync session: add locally deleted items in "refresh-from-client" (BMC #2786)
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.
2011-04-20 10:33:53 +02:00
Patrick Ohly
467fdf70c8 local sync: fixed several potential bugs in transport
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().
2011-04-20 10:26:33 +02:00
Patrick Ohly
ee802e699e client-test: sped up testLargeObject/testMaxMsg
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.
2011-04-20 10:21:04 +02:00
Patrick Ohly
aebba85c31 server sync session: detect final sync mode (BMC #2786)
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".
2011-04-19 16:56:35 +02:00
Patrick Ohly
c1a2d81e91 virtual source: added better config checking and error reporting
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.
2011-04-19 13:58:04 +02:00
Patrick Ohly
0574084362 SyncSource: better error message for incomplete config
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>')".
2011-04-19 13:56:02 +02:00
Patrick Ohly
22e5783822 local sync: exceptions thrown in child process were not reported
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.
2011-04-19 13:54:09 +02:00
Patrick Ohly
cac3ebfd9b local sync: better error message when URI is empty
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.
2011-04-19 13:48:51 +02:00
Patrick Ohly
87b4a063a3 command line: better error message when checking sources, avoid "list"
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.
2011-04-19 13:48:13 +02:00
Patrick Ohly
a269278e08 Akonadi: must not reuse EDS test names
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.
2011-04-19 13:43:40 +02:00