Michal Sojka [Mon, 18 Apr 2011 22:27:25 +0000 (00:27 +0200)]
Prepare for compiling FORB "components" for RTEMS
On Linux, FORB modules are normal shared libraries. The RTEMS support
for shared libraries does not seem to be mature so we use static libraries
for the components. These will have to be linked manually to the final
application.
The FORB components should use FORB_MAIN macro to define their main
function (previously called forb_main).
In this commit I only convert dummy resource to this new syntax. The rest
is leaved for Petr :-)
It will be necessary to implement an equivalent of forbrun for RTEMS. My
idea is to introduce a special ELF section with pointers to FORB_MAIN
functions and these functions will be called at the end of forb_init().
Michal Sojka [Sat, 12 Mar 2011 14:40:43 +0000 (15:40 +0100)]
wvtestrun produces nicer and more readable output
Now, when stdout is a TTY, the results are aligned to the same column
and are preceeded by colorized leaders ("........") to easily find the
text matching to the result.
Michal Sojka [Thu, 24 Feb 2011 15:24:16 +0000 (16:24 +0100)]
forb: Add forb_executor_synchronize()
This is used to wait for executors to finish processing ongoing requests
during FORB termination. This ensures that all peer sockets are closed
and wvtest does not complain about open file descriptors at the end of
tests.
Michal Sojka [Thu, 24 Feb 2011 11:36:14 +0000 (12:36 +0100)]
wvtest/sh: Do not exit shell script unless $WVTEST_DIE_FAST is set
If the shell script performs setup and cleanup for the test, it is
important to cleanup even when the test fails. So by default, we do not
exit, but only return the exit code of failed command.
Michal Sojka [Thu, 24 Feb 2011 11:31:54 +0000 (12:31 +0100)]
frsh: Do not include test functions
The output of test is easier to read when the name of the test script is
displayed in the test output. Therefore, we copy the setup/exit code
that is common to the all tests to the tests themselves.
Michal Sojka [Sun, 20 Feb 2011 09:42:58 +0000 (10:42 +0100)]
forb: Fix synchronization error in forbrun
forbrun starts servers synchronously, i.e. the next server is started
only after the previous one is fully initialized (see
forb_signal_server_ready()). This synchronization was broken because
forb_signal_server_ready() was incorrectly called in
forb_execute_object() called from forb_execution_thread() called from
forb_init(). This caused that the semaphore for the synchronization had
the value of one (instead of zero) when forb_init() finished.
Therefore, the first waiting for the semaphore returned immediately
without actually waiting for the server.
This is now fixed by introduction of default_executor which is declared
in struct forb. This executor is initialized "manually", without
forb_execute_object(), so that the forb_signal_server_ready() is not
called.
In future, we might want use the default executor for executing requests
to other objects, which do not require a separate thread.
Michal Sojka [Sun, 20 Feb 2011 08:31:58 +0000 (09:31 +0100)]
wvtest: WVFAIL(cond) returns cond
Previously WVFAIL returned !cond. In my optinion it was confusing
because the statements
if (cond) print_error();
and
if (WVFAIL(cond)) print_error();
behaved differently. Now, they are functionally equivalent. In the
implementation we use C extensions typeof() and "statement expression"
to avoid duplication of side-effects caused by cond evaluation.
Michal Sojka [Sat, 19 Feb 2011 22:57:48 +0000 (23:57 +0100)]
forb: Fix deadlock in executor
The first iteration of executor loop waited for the request without
actually checking that there is no request in the queue. Therefore,
when the client sent the request before the executor called
fosa_cond_wait() for the first time, the executor blocked indefinitely.
Michal Sojka [Sat, 19 Feb 2011 13:42:16 +0000 (14:42 +0100)]
forb: Do not compile inet_broadcast if it is not used
When inet is the default protocol, broadcasts are not used (because they
are not reliable). Previously, if inet was the default, we didn't bind the
socket to multicast address and thus we were not able to receive the
broadcasts. This situation was confusing and therefore it is better omit
the implementation of inet_broadcast entirely to make this clear that it
is not used.
Michal Sojka [Fri, 18 Feb 2011 23:42:20 +0000 (00:42 +0100)]
forbrun: Enable uLUt-based logging
It had no sense to disable it -- it works fine for FORB logging. If it
is needed to change log levels of server, this could be implemented in
forb_main() of the particular server.
Michal Sojka [Fri, 18 Feb 2011 23:19:46 +0000 (00:19 +0100)]
forbrun: Comment out not passing test
This test does not pass because the registered references are not
distributed to other servers. This will be hopefully implemented later
through some kind of name server.
Michal Sojka [Tue, 15 Feb 2011 16:12:15 +0000 (17:12 +0100)]
forb: First implementation of forbrun
Not tested! forbrun should executed FORB servers implemented as shared
libraries. Its aim is to allow execution of multiple independent servers
in a single process. This is done in preparation of porting FRSH/FORB to
RTEMS (and other single-address space executives).
Michal Sojka [Tue, 8 Feb 2011 17:01:37 +0000 (18:01 +0100)]
forb: Add test for various invocation methods
This tests the following:
1) remote invocation (currently broken)
2) local invocation from application to the executor
3) local invocation from an executor to another one
4) direct invocation from an executor to the same one