Commit Graph

368 Commits

Author SHA1 Message Date
Jean-Sébastien Pédron d74c19bf9c Use `rand` directly in master because we require Erlang 18.3
References rabbitmq/rabbitmq-server#860.
[#122335241]
2016-06-29 13:19:33 +02:00
Jean-Sébastien Pédron f2e43e2214 Use the new `rand_compat` module to transition from `random` to `rand`
References #860.
[#122335241]
2016-06-29 13:18:03 +02:00
Jean-Sébastien Pédron f83f0a00e6 system_SUITE: Update after the rabbit_ct_* API refinements 2016-05-03 15:54:50 +02:00
Jean-Sébastien Pédron 85640a52d8 system_SUITE: Do not generate queue names with non-printable chars
... in the `lifecycle` testcase.

This fixes this testcase with the master branch where eg. newline
characters are stripped.
2016-04-22 09:46:59 +02:00
Jean-Sébastien Pédron f678abaeb1 system_SUITE: Use the new rabbit_ct_broker_helpers:get_node_config/3 2016-04-20 11:03:20 +02:00
Jean-Sébastien Pédron 98ad6e1868 Adapt system_SUITE.erl to the new rabbit_ct_broker_helpers 2016-04-18 16:18:32 +02:00
Michael Klishin 169a58d523 Merge branch 'stable' into rabbitmq-server-104 2016-04-17 19:12:20 +03:00
Jean-Sébastien Pédron 233b3507fb system_SUITE: Adapt to the new multi-nodes support 2016-04-13 18:52:18 +02:00
Daniil Fedotov e458cbf7aa tests config 2016-04-13 16:21:04 +01:00
Daniil Fedotov eb36ef5355 tests for named connection 2016-04-13 12:06:58 +01:00
Jean-Sébastien Pédron 2d97c82ea2 system_SUITE: Handle the creation of the unauthorized user
This was moved from rabbit_ct_helpers.
2016-04-06 12:55:50 +02:00
Jean-Sébastien Pédron e66e7d6844 Move rabbit_ct_helpers to rabbitmq-common
References #725.
Tracker: [#116526487]
2016-04-05 14:11:22 +02:00
Jean-Sébastien Pédron 54dea61f40 Test `rpc_client`: Add assertions to rpc_correlation_server/2
There are transient failures on Jenkins and Travis. Hopefully, it will
help debug them.
2016-04-04 14:43:21 +02:00
Jean-Sébastien Pédron a9265d48af Test `basic_qos`: Run non-parallel and log timing informations
This should fix failures we see with this test on Travis CI.
2016-04-04 12:00:44 +02:00
Jean-Sébastien Pédron 0ce5eb1bbb rabbit_ct_helpers: Use arbitrary node name and TCP ports
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.
2016-04-01 16:30:18 +02:00
Jean-Sébastien Pédron 42c11ec754 rabbit_ct_helpers: Use lists:keystore/4 to update Config
Before, we just added a new entry without caring of a possible existing
value.
2016-03-31 13:41:57 +02:00
Jean-Sébastien Pédron 2859a59b7f Switch testsuite to common_test
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.
2016-03-30 19:43:59 +02:00
Michael Klishin 6372c3bf90 Add a failing test for password and depth parameters 2016-02-25 17:13:34 +03:00
Michael Klishin 0f0ca46187 Unit tests for TLS parameters in URIs 2016-02-25 16:32:04 +03:00
Michael Klishin 397d3656b0 Update (c) info 2016-01-01 13:05:15 +03:00
Ayanda Dube 65b35b7bef Adds direct_no_vhost_test/0 and network_no_vhost_test/0 tests.
References #237
2015-11-06 17:17:34 +00:00
Ayanda Dube 9388789139 Adds calls for direct_no_vhost_test/0 and network_no_vhost_test/0.
References #237
2015-11-06 17:15:57 +00:00
Ayanda Dube 9b7c6c75a0 Updates error tag to 'not_allowed'.
References #237
2015-11-06 16:36:04 +00:00
Jean-Sébastien Pédron c6c4a8ccd9 Connect `make tests` 2015-11-02 18:34:55 +01:00
Jean-Sébastien Pédron c0b6a352ce Use phash2() and the new Time API as a random seed
References rabbitmq/rabbitmq-server#233.
2015-07-31 18:59:18 +02:00
Michael Klishin 5152a22d2a (c) year 2015-05-24 04:48:39 +03:00
Simon MacMullen 5925d48848 Detect connection failure when a direct connection is used.
(Patch from Christopher Faulet)
2014-10-20 16:22:14 +01:00
Simon MacMullen 6785f96cd2 Link a channel with its writer when a direct connection is used.
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)
2014-10-20 16:21:24 +01:00
Matthias Radestock 613d9b3bb6 wait longer for process death
...to, hopefully, reduce test failures in CI
2014-03-31 22:41:07 +01:00
Simon MacMullen 4edc0aab42 Update copyright for 2014 2014-03-17 17:25:21 +00:00
Simon MacMullen 46dbc20e0e Pick another example of a command that will fail... 2014-03-07 10:38:05 +00:00
Simon MacMullen d8baf24feb Don't name things after not-very-random strings and hope for no collisions, it wasn't working out. 2014-02-25 13:50:19 +00:00
Simon MacMullen d22cb650f1 We're seeing intermittent failures here with message_count = 0. My theory is that we might have collisions in the "randomly" named queues. So check queue length in a way that doesn't alter it. This won't solve the problem, but if the failures switch to failing with message_count = 2 then we'll know what's up. 2014-02-25 12:03:52 +00:00
Simon MacMullen 50ad99820f Allow username without password after all. 2014-02-11 10:50:35 +00:00
Simon MacMullen caf75295c7 Update test 2014-02-07 15:28:55 +00:00
Simon MacMullen f98bf495b3 stable to default 2013-11-14 16:39:13 +00:00
Simon MacMullen 0608df9bee The server is not guaranteed to have closed the channel before we try to close it. 2013-11-13 17:00:48 +00:00
Simon MacMullen f08f41ed35 Don't send invalid strings since we now ban that. 2013-11-12 12:37:19 +00:00
Simon MacMullen a7fd556bf9 Don't assume that calling basic.publish will explode, that only really worked by coincidence. 2013-10-04 14:21:36 +01:00
Emile Joubert 30dcbbaf50 Report authentication failures as returned by the broker 2013-09-24 11:58:25 +01:00
Emile Joubert 93c2d5058d Merged bug25677 into default 2013-08-07 16:54:42 +01:00
Simon MacMullen 729ed62425 Require default consumer for cancel nowait. 2013-08-05 14:24:19 +01:00
Michael Klishin 41ca77c749 Remove a confusing log line left from an old QoS test 2013-08-01 11:03:36 +04:00
Michael Klishin 97f9ea8a34 Untabify 2013-08-01 11:03:16 +04:00
Michael Klishin 1e646caae1 Merge default into bug25191 2013-08-01 10:54:11 +04:00
Emile Joubert 2a71b7cbf3 Merged stable into default 2013-07-31 13:57:31 +01:00
Emile Joubert 43a7db454d Merged bug25538 into stable 2013-07-31 13:13:11 +01:00
Emile Joubert 6136781aec Merged stable into default 2013-07-30 17:21:07 +01:00
Simon MacMullen ecfd6fb2c2 * Test consume / cancel / consume.
* Merge the two receives to get rid of a rather dubious "after 0".
2013-07-29 17:53:41 +01:00
Michael Klishin ee6be75ac7 Limit this connection.blocked test to network connections
Still exploring if it's a good idea to have two separate tests
or not.
2013-07-05 16:53:46 +04:00
Michael Klishin c0b8b71e86 Correct connection.blocked test to use set/clear alarm
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.
2013-07-05 16:21:28 +04:00
Simon MacMullen 3b431b82d9 s/VMware/GoPivotal/g 2013-07-01 10:49:12 +01:00
Simon MacMullen 1f2079a62a Remove ancient test that could not possibly pass (no longer using memsup or channel.flow). It wasn't hooked in anywhere, but is misleading. 2013-06-27 15:35:35 +01:00
Michael Klishin aefddc0b9c Introduce amqp_connection:register_blocked_handler
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.
2013-06-26 16:21:40 +04:00
Simon MacMullen a9102a7476 Cosmetic 2013-06-13 14:10:18 +01:00
Daniel White 50602d49d3 base64 encode correlation_id in rpc requests
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.
2013-03-13 02:53:53 +11:00
Emile Joubert b5309f8151 Reply-queues with slashes and changes to dynamic queues 2013-02-26 13:47:23 +00:00
Emile Joubert fee6b73ab5 Treat built-in exchanges like any other
and update tests
2013-02-25 16:53:50 +00:00
Emile Joubert bc9c2ba7ba Test for dynamic queues 2013-02-18 10:26:04 +00:00
Emile Joubert 0204397e8d Destination semantics for STOMP and AMQP 1.0 2013-02-15 16:09:36 +00:00
Simon MacMullen 94ade5d9dd stable to default 2013-01-24 13:15:52 +00:00
Emile Joubert 4e730491c7 Update copyright 2013 2013-01-23 11:40:49 +00:00
Matthias Radestock 18877f91c8 merge stable into default 2013-01-08 11:51:06 +00:00
Matthias Radestock 23f036d082 correctly enable test 2013-01-08 11:50:37 +00:00
Matthias Radestock 7fcb2ea1be actually enable the test 2013-01-08 11:39:30 +00:00
Matthias Radestock ff017197ca fail properly 2013-01-08 11:36:57 +00:00
Matthias Radestock e235a8d42a fix bug in test
it's a throw, not an exit
2013-01-07 18:08:40 +00:00
Emile Joubert eeaf125c38 Less severe failure when waiting on unselected channels 2013-01-07 17:03:35 +00:00
Emile Joubert 0095e042a3 Use less state 2012-12-20 16:16:32 +00:00
Emile Joubert 3d23af7af5 Prevent waiting for confirms unless selected 2012-12-20 15:00:24 +00:00
Simon MacMullen 455e8c0f9a It seems more obvious to treat the no password variant as the special case. 2012-09-20 17:00:55 +01:00
Emile Joubert 87994f521f Update tests 2012-09-18 11:18:01 +01:00
Simon MacMullen 33c01884cb Merge bug25057 2012-08-15 13:52:24 +01:00
Francesco Mazzoli 1c05823f35 add functions to unregister handlers
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.
2012-07-16 16:23:44 +01:00
Matthias Radestock 7749390ecf move internal definitions etc out of amqp_client.hrl
...in order to avoid application name space polution
2012-07-02 16:54:31 +01:00
Simon MacMullen fb57809497 And again, globally raise the timeouts. 2012-05-16 12:23:14 +01:00
Emile Joubert 69665f3ff6 Merged bug24624 into default 2012-02-06 16:12:43 +00:00
Simon MacMullen 692884fc78 Merge bug24500 2012-02-03 15:36:20 +00:00
Simon MacMullen 74ffe957cd Merge bug24606 2012-02-03 13:05:25 +00:00
Simon MacMullen c8f222c60e Merge bug24692. 2012-02-03 11:48:13 +00:00
Simon MacMullen 924ccc903d Move rabbit_misc:nodeparts/1 and rabbit_misc:makenode/1 into rabbit_nodes 2012-02-02 14:36:16 +00:00
Emile Joubert 44278dc2b8 Update copyright 2012 2012-02-02 13:04:28 +00:00
Simon MacMullen e0a21b2fa3 Unbreak the network client. Oops. Tests pass now :) 2012-01-25 16:00:19 +00:00
Alexandru Scvortov 85e8ec4951 deconvolute logic
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.
2012-01-24 17:50:16 +00:00
Alexandru Scvortov 976b651560 add timeout to wait_for_confirms[_or_die]
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.
2012-01-24 17:03:05 +00:00
Emile Joubert 88d184be09 Relax default timeout 2012-01-20 13:12:20 +00:00
Matthias Radestock 93c86f1958 make tests work on R15 2012-01-16 07:44:59 +00:00
Simon MacMullen 2763345bd0 Make wait_for_confirms not hang under the influnce of multiple=true. 2011-10-18 17:48:03 +01:00
Alexandru Scvortov 3e2419ab22 make tests a bit more comprehensive 2011-10-17 11:53:54 +01:00
Alexandru Scvortov 9d7c6fbbd3 add more checks to the tests
There was also a bug: "amqp://host" would parse to vhost "", instead of vhost
"/".
2011-10-17 11:40:23 +01:00
Alexandru Scvortov ee25d6a734 support mixed case schemes + more docs 2011-10-17 11:14:58 +01:00
Alexandru Scvortov 909e86d358 support R12B-5 and better docs 2011-10-10 15:04:00 +01:00
Alexandru Scvortov baf6480c62 rename url -> uri; do params_network conversion in amqp_uri 2011-09-27 17:35:40 +01:00
Alexandru Scvortov cc1c548251 refactor + handle entities + url tests 2011-09-26 16:52:57 +01:00
Matthias Radestock 1d78937835 use confirms to ensure messages ended up in queues...
so we don't rely on 'purge' not overaking 'publish'.
2011-08-18 18:27:43 +01:00
Matthias Radestock da87a41245 use 'purge' instead of passive 'declare' to determine msg count...
since as of bug 24194 a 'declare' may overtake a 'publish'
2011-08-18 18:13:10 +01:00
Matthew Sackman 61ec3a9e53 Rework return from new_connection so that we detect sooner if there's been a problem creating the connection 2011-08-09 12:42:04 +01:00
Alexandru Scvortov 1de9c86bb0 merge default into bug24018 2011-08-09 12:11:18 +01:00
Matthew Sackman fc7355471e Merging bug23838 to default 2011-08-08 14:23:57 +01:00
Alexandru Scvortov 58f30b55b7 ipv6 + ssl test 2011-07-29 18:26:52 +01:00