Changing the CPPUnit defines broke linking of syncevolution in Moblin
(--enable-integration-tests): test.cpp then depends on CPPUnit libs
and was linked into syncevolution and syncevo-dbus-server, causing link
failures.
Made inclusion of test.cpp conditional on actually having unit tests
inside the library. Only then do syncevolution and syncevo-dbus-server
have to link against CPPUnit.
Use gnome-keyring to store and retrieve passwords in dbus server
by default when dbus server is compiled with gnome-keyring library.
For storing passwords, if failed in gnome-keyring, an error will
be thrown, which aborts flushing properties.
For retrieving passwords, firstly find them in the gnome-keyring.
If it is not found, dbus server then send InfoRequest signal to
dbus clients to ask for passwords. See MB#6376.
The EDS backend was asking for glib support even when it was not
active. In combination with not linking against the right libs
in that case there was a link failure because g_thread_init()
and g_type_init() were not found.
When the EDS backend was active, this wasn't a problem because
the necessary libs were linked indirectly.
This patch reduces the number of libs that are checked and used
when not enabling the EDS backend. This is done by resetting
the ECAL/EBOOK flags when inactive and only asking for glib
when active.
It also fixes the checking and linking against gobject and gthread
in the case that glib support is requested.
Broke while adding support for shared configs. We didn't have a test
for it, therefore this went unnoticed. I have added a test for it
(CmdlineTest::printFileTemplates) and fixed the issue (using the wrong
file layout for templates).
The test depends on having access to installed templates in a known
location, which previously was a problem due to the hard-coded
TEMPLATE_DIR. Now SyncContext::createServerTemplate() checks an env
variable (SYNCEVOLUTION_TEMPLATE_DIR) which is set by most of the
command line tests to prevent reading from there unintentionally and
once to "./templates" to ensure reading from there.
The previous location was /usr/etc/syncevolution. It should have been
/etc/syncevolution in our debs, with proper declaration as system
config files. The intention was that system admins can add or modify
templates.
Not particularly likely, so now template files are only searched in
/usr/share/syncevolution/templates (or whatever was chosen with
configure --datadir).
Also added a README to that directory, warning that copying these
files will lead to incomplete configs. Each main config.ini carries
a similar comment, for those who miss the README.
syncevo-dbus-server invokes SoupTransportAgent directly and
thus must have access to the libsoup header files. This broke
in the --enable-shared case. It probably worked before in
static mode because then we ended up with different include
flags.
Due to a typo in the src/syncevolution -> src/syncevo transition,
unit tests inside libsyncevolution.a were not included in the
client-test executable. The check of libsyncevolution.a searched
for the library in synccevo instead of syncevo.
Also merged updated dependency list from master branch.
Due to a typo in the src/syncevolution -> src/syncevo transition,
unit tests inside libsyncevolution.a were not included in the
client-test executable. The check of libsyncevolution.a searched
for the library in synccevo instead of syncevo.
This uses the new combined client/server Synthesis engine. When
building shared modules, the engine is opened dynamically only
while needed, thus reducing overall memory consumption.
The HTTP server is implemented in Python, using the the 'twisted'
server framework because it can use the same glib event loop as the
D-Bus binding. This allows us to keep the same event loop running
forever and react to both kinds of events.
The server takes a base url (including host name and port)
and a default configuration as name. The host name is currently
ignored. It could be used to bind to a specific interface.
The path is what a client has to use as part of his sync URL
to synchronize against the default configuration. In addition
the client can add another path to select that as his server
configuration.
For example, if the script is called with
http://localhost:9000/syncevolution default
then syncURL = http://localhost:9000/syncevolution will synchronize
against the configuration called "default". With syncURL =
http://localhost:9000/syncevolution/my_server, it will
synchronize against "my_server".
This is basically a rewrite from scratch, targeting the revised D-Bus
API. The core infrastructure for handling client requests is in place,
including the work queue for sessions and unexpected disconnects.
Many of the related D-Bus methods (Server.Connect(),
Server.StartSession(), Connection.Close(), Session.Close()) are
implemented.
Rudimentary testing is done with the test/dbus-server-connect.py
script.
The library is compiled and installed as a syncevolution utility
library (in other words, as lib/syncevolution/libgdbus), so that
it never conflicts with a copy of the code in another project.
Install head files to a standard path, the remaining dependencies are
synthesis and boost
client-test is portable when ENABLE_MODULES is defined, no longer link to
backends libraries.
Add --enable-developer-mode, in which mode the backend scan path will be
under current build directory for development purposes.
--keyring|-k
Save or retrieve passwords from the GNOME keyring when modifying the
configuration or running a synchronization. Note that using this option
applies to *all* passwords in a configuration, so setting a single
password as follows moves the other passwords into the keyring, if
they were not stored there already:
--keyring --configure --sync-property proxyPassword=foo
When passwords were stored in the keyring, their value is set to "-"
in the configuration. This means that when running a synchronization
without the --keyring argument, the password has to be entered
interactively.
The implementation introduces new virtual methods for password handling
to properties and iterates over all properties to activate that
special behavior.
Another change is no longer to use cached strings in the SyncEvolutionConfig
to store retrieved passwords. Instead, they are saved as the filter in
the config node. This could help their users to get them but not flush
to files. The main purpose of this change is to make it flexible
to meet the requirements of dynamically added passwords in the backend.
Several files created as part of the GUI build were not
properly removed during "make clean". Found with distcheck
when using DISTCHECK_CONFIGURE_FLAGS=--enable-gui
distcheck also complained about an untranslated .xml file
that it found after building the GUI. The .xml is
generated from .glade, which is translated, so the .xml
file can be ignored via POTFILES.skip.
The only way that I found not to execute a test was not to register
it in CPPUnit. FilterTest() does this by replacing a valid test
or test group with a dummy one, SkipTest, which just prints the
test name and that it is skipped.
Registering tests has to be intercepted at multiple levels:
- CPPUNIT_TEST in test suites
- ADD_TEST in ClientTest
- addTest in ClientTest
Not currently intercepted are complete test suites (CPPUNIT_TEST_SUITE).
The main purpose of this patch is to avoid running the time consuming
suspend and interrupt tests, but this feature might also be useful for
other tests, which is why it was implemented in a more general way.
Catch fatal signals (SIGSEGV, SIGABRT, SIGBUS) and in the signal
handler, flush and process output.
Flushing is done each time redirection is removed and thus
also catches output that is pending in either C or C++ output
streams during a normal application shutdown.
The abort-redirect test program covers such a scenario. It does
a double free, which depending on libc causes a segfault or
error message. The source is in "test" (like the rest of the
test programs) while the binary is built with "make abort-redirect"
in "src". It would be nicer if the test folder was a subdirectory of
src and wouldn't require its own Makefile, but that's a different issues...
Note that glib's double free report is written to the console
regardless whether stdout/stderr redirection is enabled. It seems
that glibc does not use FDs 1 or 2 for that, redirecting them in
the shell has no effect either. Catching the signal and flushing
is useful nevertheless.
First, fabricate a dummy unified diff header to keep "patch" happy.
It worked before, but printed a warning.
Second, make testcase2patch depend on generating the patched files
first. Avoids potential problems in parallel build.
This patch fully automates all work when running make inside the
src directory. It achieves that by not letting make check dependencies.
Instead shell commands check what needs to be updated. By using
touch with the patched file as reference, the regenerated patch
is never newer than it, thus cycles of repeatedly writing files
is avoided.
One drawback is that client-test is needlessly rebuilt, because
it now depends on a phony target. This is not optimal, but better
than not rebuilding files that have to be rebuild, as before.
We were using the same set of test cases for different server, this
is a bit limited; now importItem will first check a server specific
test case file and will fallback to the general case file if failed.
The makefile is also changed.
Makefile had Perl elsif instead of bash elif (didn't matter,
elif branch wasn't needed). syncevolution.xml
was replaced syncclient_sample_config.xml (fatal error).
src/gtk-ui had BUILT_SOURCE files which "make dist" tried
to generate even if the necessary tools where not available.
The generated files also must not be listed as
normal source of the binary, for the same reason.
The GTK+/Moblin UI now only uses gnome-keyring.
D-Bus service supports it but it is not required.
I think I will remove the authentication over dbus altogether,
it's just a bad idea. Then choices would be:
* authentication saved in config files, not changeable via dbus
* authentication via supported keyring methods
(currently gnome-keyring)
Building the backend shared objects failed with --enable-shared because
then the *Register.cpp files have to be compiled into them. This used to
fail due to a missing -I path for test.h. When compiling the files for
the main executables it worked (the case without --enable-shared) because
those executables had the right search path.
After fixing that, it was necessary to add the *Register.cpp files
to client-test (and only that) because only that way are the tests in them
really enabled.
To avoid the resulting link errors, client-test (and again, only that)
links to the backend shared objects directly. The main executables don't
do that because then they work even if a backend cannot be loaded dynamically
due to missing dependencies (as on older Maemo without libecal). For testing
these hard dependencies are acceptable.
syncevo-dbus -> src/dbus
interfaces -> src/dbus/interfaces
Files generated from D-Bus interfaces are only built once, in src/dbus/interfaces.
This is changes makes the code layout a bit nicer and, more importantly,
fixes build dependencies when Synthesis is compiled in src.
Now everything that is needed by a certain directory is in that directory
or a sub directory.
The server config.ini files and icon.[svg|png] in src/default will be installed
in /etc/default/syncevolution. All configurations found there extend and/or
override the builtin templates. The advantage is that file-based templates
can have icons and that templates can be added/modified without recompiling
SyncEvolution.
This meta information is now part of EvolutionSyncConfig:
- getWebURL() returns a URL with further information; this
replaces the hard-coded URL string that was previously
returned as comment for templates in the ServerList
- getIconURI() currently returns absolute file paths to
an icon file (example: icon.png for ScheduleWorld). The
content and exact URI may vary, depending on how system
administrators or distributions configure SyncEvolution.
If possible, callers should be able to handle http://
and other URI access methods.
Removed a spurious package check for synthesis which was reintroduced
during the recent code cleanup and merging.
Fixed compilation with --enable-unit-tests and/or --enable-integration-tests.
CPPUnit header files were not included properly.
When at least one of these enable options is used, client-test is built
as part of the normal "make all" and installed in bindir as part of
"make install". The test files go into the docdir.
When --with-synthesis-src is used, then the Synthesis source code is compiled
automatically and included in a .tar.gz.
Added some missing EXTRA_DIST files.
The logdir is now overridden so that all files (client.log, message
dumps, Synthesis logs) are written in a subdirectory names after
the current test. A <test>.log file captures all output written
outside of the sync itself.
SynthesisDBPlugin provides all C calls potentially used by
the Synthesis engine. It needs to be linked into the executable
or libsyncevolution.so so that the SyncEvolution_* calls
are visible to libsynthesis. They will get called when "SyncEvolution"
is specified as plugin name, using dlsym(RTLD_DEFAULT).
The "-uSyncEvolution_Module_Version -Wl,--export-dynamic" flags
are a bit platform specific; a configure check would be useful,
with compilation as a normal plugin as default.
syncevolution.xml is compiled into libsyncevolution. The <datastore>
entries are created for all active sync sources and replace
the <datastore/> place holder in the default configuration.
The configuration can be overridden by placing a syncevolution.xml
file in the current directory, with or without <datastore>
specifications. <datastore/> is replaced as usual.
<dbtypeid> values are generated as hash from the sync source name.
Collisions are not handled yet.