The Session::sync() prototype was changed without taking into
account that the method has to match the Session.Sync() signature.
Automaticly generated D-Bus bindings are a double-edged sword...
This was caught by the test-dbus.py TestDBusSync test. We really
need to run that more often and eventually nightly.
The new TestConnection suite covers some Connection API related
aspects:
- creating a connection and closing it
- sending an invalid message
- sending a valid message
Right now these tests assume that a "syncevolution_server" config
exists. They depend on getting one Abort signal per connection
to shut down each test.
The signal recording code from TestDBusSync was moved into DBusUtil
so that the different tests can share this utility code.
Some sleeps are necessary after sync sessions because SIGTERM might
get caught without properly shutting down synevo-dbus-server (MB#7555).
First, kill all running syncevo-dbus-server instances. Having
one running was one way how the tests could have failed because
it wasn't running with the right environment.
Second, use files for output instead of in-memory pipes. The latter
might have caused deadlocks when a process writes large amount of
data.
syncevo.log and dbus.log in the current directory are used. The
additional benefit is that these files can be read while the test
runs, for example when it is deadlocked for some other reason.
Third, when syncevo-dbus-server returns with a non-zero error code,
give dbus-monitor time to settle down before stopping it. Otherwise
the final D-Bus traffic might not get recorded.
The API spec now guarantees that the signal is only raised once for
each connection. This was unspecified earlier. This change was made
to simplify clients and make the server more deterministic.
A new test in the test-dbus.py will depend on this behavior.
In a transport which anyone can send messages to (like in a HTTP
server), a random session ID protects a bit against someone
inserting unwanted messages into a regular session.
This patch uses the usec part of gettimeofday() to initialize
the libc random number generator. Better (and more complex)
approaches are of course possible...
The reason for implementing this now is that automated testing via
test-dbus.py also had a problem with non-unique IDs: when the
server was restarted, separate runs ended up using the same
session ID because they were initialized with the current system time
in seconds. This confused signal listeners which checked the ID.
Running the script failed on Debian Lenny failed because Python
and python-gobject are too old. Python 2.6 was required because
of subprocess.terminate(), replaced with os.kill(). python-gobject
2.16 was needed for glib, which is used in some tests to run
the event loop for a short while. These tests now fail if glib
is not available, while the rest of the tests can be run normally.
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.
The "mustAuthenticate" parameter in the D-Bus Server.Connect()
call was ignored, valid credentials were always required unless
username and password in the server configuration were empty.
Now this parameter is passed through and used
- to configure the Synthesis engine correctly
- to suppress asking for our password if not needed
Note that we rely on a patch that turns <requiredauth>none</requiredauth>
into "accept invalid credentials". Without that patch, the client would
have to provide no credentials at all (which SyncEvolution doesn't support).
The "must authenticate" parameter for Server.Connect() had no
effect so far. Netherless, HTTP clients should have been required
to authenticate from the beginning.
Starting with this commit, SyncEvolution implements the
Synthesis session authentication and device administration
itself. The goal is to have better control over these steps
and become independent of the SDK_textdb which implemented
this before.
The SDK_textdb works, but it has several limitations, among
them the inability to choose a password. It is also called
"demo" in the source code, which raises some doubts about
its stability.
Because the Synthesis DB interface is now used both for database
access and for session handling, the Module_CreateContext() function
can not always select a source as context. When used as session
plugin, the global context pointer is NULL.
The Synthesis engine calls us at various points to save information.
Because it is not exactly clear how long we can buffer this
information in memory, it is always flushed to disk immediately.
The ! sign was used as escape character and thus has to be escaped
itself. In the less strict mode this wasn't done. Shouldn't affect
SyncEvolution 0.9.1 where the code was used in strict mode for
change tracking nodes, but broke the new nonce saving.
Part of the D-Bus API testing is checking of the GetConfigs()
call for templates. So when adding a new server template, that
test must also be updated.
Calculate progress information according to progress
event from synthesis library.
Considering the most common scenario and profiling data,
current implementation will partition a sync session into
3 *big* steps: SYNC_INIT, SYNC_DATA, SYNC_UNINIT
Typically each step contains one message send and receive,
thus occupies a specified proportion.
By default, 5 data items are supposed in calculating
proportions, which affect SYNC_DATA and SYNC_UNINIT.
The main idea of dynamically adjustment is that based on
the common scenario, if there are extra operations,
such as message send/receive or many data items,
adjust proportions by re-calculate operations of each
remaining step.
Typcially possible extra operations are more than one-time
message send/receive in a step and the number
of data items is not 5. Then we re-calculate proportions
for remaing steps according to future's operations
with the remaining proportion.
The recently introduced enableServerMode() and serverModeEnabled()
calls must be implemented by all sync sources not derived from
TrackingSyncSource. This patch adds the calls to the SQLiteContactSource,
using the default mechanism provided for it in SyncSourceAdmin.
The active sources must be set before calling sync(), doing it in
prepare() is too late. The right way to do it with the revised
API is via source filters: disable all sources with a filter that
applies to all sources, then enable the desired one(s) with the
right mode with a more specific filter.
The environment with XDG_ redirected into a local directory
also needs to be passed to gdb when debugging interactively.
Otherwise the tests would not run as without gdb.
Use 5 enum values to represent sync statuses,
SYNC_IDLE, SYNC_RUNNING, SYNC_ABORTING,
SYNC_SUSPENDING, SYNC_DONE
So we could use one enum variable instead of
previously 3 boolean values
Add test script in test/dbus-server-config.py to test
getConfigs, usage:
python dbus-server-config.py [servername] --getconfigs
[null or any characters]
Hook up checkForSuspend and checkForAbort in dbus server
and implement sleep function but not suspend and
abort when CTRL-C is entered for often sync dbus server
runs as a daemonease enter the commit message for your changes.
For status and progress, we need a timer to record when
the last signal was triggered.
Here implement a 'Timer' class and add 2 timers in session
to keep time track of emitting signals for status and progress
Previous impl removes necessary meta information, such
as global synthesis and source meta.
This patch is only to remove un-set sources and don't remove
meta information for global synthesis and sources which aren't be
removed
It seems the engine calls this for existing items and expects it
to succeed, in contrast to what sync_dbapi.h says. SDK_textdb
also doesn't seem to check for existance before writing, so do
the same.
Replaced the DEBUG_DB() macros from the SDK with our own
logging macros, so now the output really goes into our logfile.
DEBUG_DB() seemed to be disabled or inactive.
Also moved the logging around a bit so that the return code is logged.
testManyItems now checks that the statistics are correct. This
is based on the assumption that all active sources use the same
number of test items.
The new testManyDeletes triggers a problem with 222 loop detection:
when the message to the server contains many deletes, the server
may require so many reply messages, that the client has to send
5 Alert 222 messages in a row and incorrectly treats this as a loop
that has to be aborted.
Previously the error code of the underlying program was
returned if non-zero. 1 was returned when the program
succeeded and valgrind found a problem.
Now the script always checks for valgrind problems and
returns 100 when one is found.
This change was originally committed a while back to the
runtest.py used in the nightly testing. Now we are merging
it back to the public runtest.py.
This patch adds the "Resend" test to various _SKIP and
_FAILURES lists and adds CLIENT_TEST_RESEND_TIMEOUT and
CLIENT_TEST_INTERRUPT_AT.
The long and unreadable environment strings for client-test
are now in the Python code as multiple independent strings
which get concatenated by Python:
function("foo"
"bar")
checkinstall *does* work on a Debian system, even under fakeroot.
The trick is to make /usr/src/rpm/RPMS writable for normal users.
The Makefile then copies the resulting .rpm back to the current
working directory.
The "lpia" (Low Power Intel Architecture) .debs are our normal
x86 binaries packaged with a different architecture name. The check
whether runtests.py was building for x86 broke when moving to an
64 bit bost. It must be run inside the build environment.