Furthermore, if the node fails to start, try again with another name and
set of TCP ports until we find a setup which boots fine.
This allows to run the testsuite while there is another unrelated
RabbitMQ node already running. Moreover, this avoids unrelated AMQP
clients to mess with the testsuite node.
All tests were moved from `test_util.erl` and `negative_test_util.erl`
to `unit_SUITE.erl` and `system_SUITE.erl`.
`unit_SUITE.erl` has only unit tests and doesn't need a running broker.
`system_SUITE.erl` has system integration tests and takes care of
starting and setting up a broker itself.
`make tests` automatically runs common_test tests. All our specific
Makefile targets are not used anymore. The new testsuite just needs
targets to start/stop a node and set/clear resource alarms.
In `system_SUITE.erl`, almost all tests are executed with direct and
network connections. Therefore, they are listed in two groups:
o direct_connection_tests
o network_connection_tests
To run the whole testsuite:
make tests
To run only one group:
make ct-system t=network_connection_tests
To run one test in a group:
make ct-system t=network_connection_tests:basic_consume
We also use common_test to handle the tests which are repeated 100
times.
The started node stores all its data in a subdirectory of the `logs`
directory and not in `/tmp`. This allows to keep the database and log
files for each run of the testsuite.
erlang.mk is updated at the same time: we don't need to disable any
Erlang.mk plugins anymore.
Many helper functions will be moved to rabbitmq-common or rabbitmq-test,
once we are happy with them, so they can be used in other testsuites.
V2: Move helper functions to rabbit_ct_helpers.erl.
V3: Get rid of last eunit bits.
V4: Improve executed command quoting.
V5: Use rabbitmq-common to create TLS certificates and drop dependency
to rabbitmq-test.
Fixes#39.
When a network connection is used, the channel and its associated writer are
linked because they are supervised by the same supervisor. So if the writer
dies, the channel dies too, because of the one_for_all strategie of the
supervisor.
For a direct connection, a channel and its writer have not the same
supervisor. So, an explicit link should be done between them. But,
since the commit dcefcf12fdd6, this link is not done anymore (In fact,
the writer is linked with the amqp_channel_sup_sup process).
(Patch from Christopher Faulet)
It was originally based on an old channel.flow test that
did not run and wouldn't work on RabbitMQ versions after 2.0.
This implementation sets and clears alarms the same way
server tests in the Java client do.
Makes make test_network pass.
For handling of connection.blocked and connection.unblocked
methods. Mimics the channel.flow handling API.
Incomplete, does not yet pass the tests. Pushed
for review.
This prevents the rpc client from sending an invalid correlation_id
when the counter reaches 128. The 0.9.1 AMQP spec defines the
property as a "short string" which requires it to be valid UTF-8.
The encoded identifier is also used as the dictionary key for the
continunation to avoid decoding the correlation id when handling the
response.
I have added tests for the return handler only since it is the easiest
to check. the confirm handler would be easy as well if it wasn't for
`setup_publish', which does not let you republish messages to the
exchange - I can add them if you think we need them. I would have to
set up some more code for the flow one as well.
The first problem pointed out in the previous commit no longer applies.
The only change in semantics is that wait_for_confirms_or_die will wait for
all acks and nacks before exit(nacks_received). It shouldn't matter much.
This also fixes two bugs:
1) Handling nacks never worked. It would do a gen_server:call inside a
gen_server:call and would just lockup. We circumvent the problem now, by
calling handle_close/4 instead of close/3;
2) In channels_manager, after the first erronous frame, the state would be
replaced by 'ok'. That's fixed now.