Commit Graph

582 Commits

Author SHA1 Message Date
Diana Corbacho 12f91458f0 Add test for handling invalid frames 2017-01-25 16:21:59 +00:00
Arnaud Cogoluègnes 96aaf35900 Add topic authorisation for consumption
Part of rabbitmq/rabbitmq-server#1085
2017-01-23 12:10:23 +01:00
Arnaud Cogoluègnes 85636953a4 Use check_topic_access on publishing
check_resource_access used to be called with
the MQTT topic as resource name and kind = topic.
It makes more sense now to call check_topic_access
with the exchange as resource name, kind = topic,
and routing key in the context.

References rabbitmq/rabbitmq-server#505
2016-12-29 16:34:19 +01:00
Michael Klishin 500b66087a Merge branch 'stable' 2016-12-20 01:39:05 +03:00
Michael Klishin 6d94828a8d Revert "Give global policies more time to propagate"
This reverts commit 4e3849b0c3.
2016-12-20 01:35:41 +03:00
Michael Klishin 8a23720840 Merge branch 'stable' 2016-12-20 01:17:45 +03:00
Michael Klishin 4e3849b0c3 Give global policies more time to propagate
Sigh, CI.
2016-12-20 01:13:01 +03:00
Michael Klishin cfcde1d143 Merge branch 'stable' 2016-12-20 00:50:04 +03:00
Arnaud Cogoluègnes 87628f9f51 Use binary for port-to-vhost mapping key
Behaves better as a JSON document key than an integer.

Fixes #111
2016-12-19 17:36:18 +01:00
Arnaud Cogoluègnes b8344cdc27 Map client connection vhost to a port
Fixes #111
2016-12-19 15:00:43 +01:00
Arnaud Cogoluègnes d1c2474a89 Merge branch 'stable' 2016-12-16 10:59:10 +01:00
Michael Klishin 2d3c004efb Merge branch 'stable' into rabbitmq-mqtt-73 2016-12-15 17:46:24 +03:00
Arnaud Cogoluègnes 8749233066 Merge branch 'stable' 2016-12-15 15:42:36 +01:00
Arnaud Cogoluègnes 7424551de0 Fix race condition in test 2016-12-15 15:38:42 +01:00
Arnaud Cogoluègnes 6d53781e64 Merge branch 'stable' 2016-12-15 14:23:55 +01:00
Arnaud Cogoluègnes 335997d140 Use clean sessions in last will retained test 2016-12-15 14:23:23 +01:00
Arnaud Cogoluègnes e37b8135b1 Merge branch 'stable'
Conflicts:
	test/java_SUITE_data/src/test/java/com/rabbitmq/mqtt/test/MqttTest.java
2016-12-15 12:50:16 +01:00
Arnaud Cogoluègnes 20d35a1482 Use awaitility for Java tests 2016-12-15 12:46:14 +01:00
Arnaud Cogoluègnes 2a9a6cb261 Add test case for cert user/vhost mapping
Fixes #73
2016-12-13 17:31:34 +01:00
Arnaud Cogoluègnes 7e03af30fd Introduce mqtt_default_vhosts global parameter
Fixes #73
2016-12-13 14:46:15 +01:00
Arnaud Cogoluègnes d424894dc6 Test connection fails when vhost not allowed for cert user 2016-12-12 10:17:29 +01:00
Arnaud Cogoluègnes 8f9e8489c2 Optionally map user certificate to virtual host
Use a global runtime parameter to map the DN of the certificate
to a virtual host.

Fixes #73
2016-12-09 16:48:47 +01:00
Jean-Sébastien Pédron b87baed8bb Do not use -include_lib() with own headers
This fixes the build outside of an Umbrella-like setup, ie. when
dependencies of this plugin are put into the `deps` subdirectory.
2016-12-08 18:07:13 +01:00
Jean-Sébastien Pédron 8216cb12f1 Merge branch 'stable' 2016-12-07 15:48:04 +01:00
Michael Klishin b3f2bcfaed Merge branch 'stable' into rabbitmq-mqtt-100 2016-12-06 18:54:29 +03:00
Arnaud Cogoluègnes b1627afe81 Gracefully close connections to non-existent virtual hosts
Return CONNACK 4 code when the virtual host doesn't exist.
The MQTT description for this return code states "The data in
the user name or password is malformed", which not exactly
accurate but better than a pending or abruptly closed connection.
The server logs also a more meaningful message.

Fixes #100
2016-12-06 16:09:50 +01:00
Michael Klishin dca3081a5d Merge pull request #107 from rabbitmq/rabbitmq-cli-121
A CLI command to list mqtt connections
2016-12-06 18:07:25 +03:00
Michael Klishin 4a6a231484 Cosmetics 2016-12-06 18:06:44 +03:00
Michael Klishin a077b95f86 Merge branch 'stable' 2016-12-06 17:56:21 +03:00
Daniil Fedotov f411a74e10 Test list_mqtt_connections command 2016-12-06 14:24:45 +00:00
Arnaud Cogoluègnes 388d949645 Support Erlang string vhosts in retainer supervisor
Fixes #86
2016-12-06 11:03:02 +01:00
Michael Klishin bc8e2541bd Merge branch 'stable' 2016-12-05 14:27:40 +03:00
Arnaud Cogoluègnes a7a0174a41 Retain last will message
Fixes #74
2016-12-05 11:05:30 +01:00
Daniil Fedotov 7cd6fdec7e Merge branch 'stable' 2016-09-28 11:39:54 +01:00
Daniil Fedotov c610ca1c0e Do not log java test output 2016-09-28 11:39:44 +01:00
Arnaud Cogoluègnes e0aac5b183 Merge branch 'stable' 2016-09-27 15:34:09 +02:00
Arnaud Cogoluègnes 46d0977209 Use quiet mode for Maven 2016-09-27 15:33:31 +02:00
Arnaud Cogoluègnes 7f43ea05d8 Merge branch 'stable' 2016-09-27 13:56:16 +02:00
Arnaud Cogoluègnes 2d442353ee Refactor Java tests
Use JUnit4-style tests, increase max-in-flight messages to make
tests more resilient, synchronize test variables.
2016-09-27 13:32:40 +02:00
Arnaud Cogoluègnes c076259000 Specify file format for client certificate
Use PKCS12 to load the KeyStore object, not JKS. Java 8
manages to load the certificate anyway, but not Java 6, nor Java  7.
2016-09-27 10:30:44 +02:00
Daniil Fedotov 9eab2c7704 Report java test result in test log 2016-09-26 13:45:05 +01:00
Daniil Fedotov abe00f3d1a Cleanup comments 2016-09-23 18:06:05 +01:00
Daniil Fedotov 507ef875ea test dir cleanup 2016-09-23 17:19:03 +01:00
Daniil Fedotov 493805fd95 Run tests via maven 2016-09-23 16:42:21 +01:00
Michael Klishin c510fef54a Merge branch 'stable' 2016-09-02 02:07:46 +03:00
Michael Klishin d318ca2fa3 Rename 2016-09-02 01:54:57 +03:00
Michael Klishin ee213084f8 Wording, naming 2016-09-02 01:33:34 +03:00
Daniil Fedotov e8ca3ac8ff test comments 2016-09-01 17:21:02 +01:00
Daniil Fedotov 4b688b9e63 Make MQTT authentication correspond with docs. Added tests 2016-09-01 16:54:51 +01:00
Daniil Fedotov e348357392 Test empty password login 2016-09-01 10:43:14 +01:00
Jean-Sébastien Pédron 59523f1832 java_SUITE: Fetch dependencies using Maven
Thus, we do not use to clone and build org.eclipse.paho.client.mqttv3,
nor we depend on a local clone of rabbitmq-java-client.

While here, move all java_SUITE-specific files to `java_SUITE_data`.
2016-08-31 13:54:28 +02:00
Jean-Sébastien Pédron 08c29be1cf java_SUITE: Fetch dependencies using Maven
Thus, we do not use to clone and build org.eclipse.paho.client.mqttv3,
nor we depend on a local clone of rabbitmq-java-client.

While here, move all java_SUITE-specific files to `java_SUITE_data`.
2016-08-31 10:15:21 +02:00
Michael Klishin 969f3e966f Merge branch 'stable' 2016-07-12 08:25:40 -07:00
kjnilsson b76cfbe5dc Move to common test
travis config
2016-07-12 12:46:11 +01:00
Michael Klishin 6c16d80527 Merge branch 'stable' 2016-04-25 08:31:30 -07:00
Michael Klishin 2c8eec7dc1 Update Paho Java git repo location 2016-04-25 08:22:13 -07:00
Daniil Fedotov 5c98b84a56 Merge branch 'stable' 2016-04-22 13:32:57 +01:00
Daniil Fedotov 2d2b8f96d8 Tests message redelivery when resuming session 2016-04-22 12:25:30 +01:00
Michael Klishin a72c9e14d2 Merge branch 'stable' 2016-03-05 11:27:29 +03:00
Michael Klishin 44389f778b In fact, even more 2016-03-05 11:21:00 +03:00
Michael Klishin 72bfeef88b Wait a bit more 2016-03-05 11:20:54 +03:00
Michael Klishin 9b7c29841b Cosmetics 2016-03-05 11:09:38 +03:00
Michael Klishin 706d82dafb Explain 2016-03-05 11:09:26 +03:00
Michael Klishin 4c5aecf0f0 skip_publishes => expect_publishes 2016-03-05 11:04:56 +03:00
Michael Klishin 1078f5787f Trailing ws 2016-03-05 11:01:20 +03:00
Daniil Fedotov 98cf125e39 Defer last receive after blocking 2016-03-04 20:33:01 +00:00
Michael Klishin c619f638ee Merge branch 'stable' 2016-03-03 14:38:16 +03:00
Daniil Fedotov 6b5de44f9c Tests for mqtt blocking 2016-03-02 16:57:48 +00:00
Daniil Fedotov d1685b08fd More tests to check QoS2 is not ignored 2016-01-27 12:05:08 +00:00
Daniil Fedotov 64f5911ec2 Downgrade publishes if QoS = 2 to QoS = 1 2016-01-12 18:02:37 +00:00
Michael Klishin 9ba1da7434 Update (c) info 2016-01-01 12:59:18 +03:00
Michael Klishin 51e887e52e Update test expectation 2015-12-18 16:32:26 +03:00
Michael Klishin 624a7741cf Merge branch 'colons-in-username' of https://github.com/lshift/rabbitmq-mqtt into lshift-colons-in-username 2015-11-28 20:42:22 +03:00
Loïc Hoguin 597eecdaf8 Remove unneeded TCP options from config in .app.src files 2015-11-26 14:01:42 +01:00
ash 001f4a1a01 add option to ignore colons in usernames 2015-11-19 11:36:24 +00:00
Jean-Sébastien Pédron 3441383d18 make tests: Pass certificates path down to test/Makefile
This allows ant to detect the certificates and enable the SSL tests.
2015-11-05 17:50:58 +01:00
Jean-Sébastien Pédron 9626e1fbe0 Merge branch 'master' into erlang.mk 2015-10-23 12:13:24 +02:00
Michael Klishin c15812ac44 merge stable into master 2015-10-21 20:18:33 +03:00
Jean-Sébastien Pédron e2d80945cf setup-rabbit-test.sh: Take rabbitmqctl location from environment 2015-10-21 14:30:37 +02:00
Jean-Sébastien Pédron 08b5c3a009 test/build.xml: Take Java client location from environment 2015-10-21 14:30:03 +02:00
Jean-Sébastien Pédron 9d5037344d Initial move to erlang.mk 2015-10-19 12:28:46 +02:00
Michael Klishin 1096f3182d Merge branch 'stable' 2015-09-22 12:38:31 +03:00
Michael Klishin 85f9f2df5b Two more warnings 2015-09-22 02:31:15 -07:00
Michael Klishin 3981be3e3d Squash a few warnings in tests 2015-09-22 02:26:22 -07:00
Giuseppe Privitera 340bb5d70b refactored tests to use rabbitmq_mqtt:env/1 2015-09-17 23:27:13 +01:00
Giuseppe Privitera 9039d7398b added .app file with some configuration used by tests 2015-09-17 23:26:05 +01:00
Giuseppe Privitera 1544360485 removed unused test 2015-09-17 23:23:49 +01:00
Giuseppe Privitera 0213ec24e9 use assertEqual instead of pattern matching 2015-09-17 15:40:10 +01:00
Giuseppe Privitera 578ac7169b coerce default_user & default_pass 2015-09-17 14:50:17 +01:00
Giuseppe Privitera 2b58ca1247 added unit tests 2015-09-17 14:26:22 +01:00
Michael Klishin 8712428268 Merge branch 'stable' 2015-05-24 04:55:07 +03:00
Michael Klishin 692c6a7060 (c) year 2015-05-24 04:54:58 +03:00
Michael Klishin b52aed4a69 Merge branch 'stable' 2015-05-14 17:19:24 +03:00
Michael Klishin d89eed50e9 Adapt to Java client API change in stable 2015-05-14 14:59:50 +03:00
Jean-Sébastien Pédron dad4ea314a Merge branch 'stable' 2015-05-07 13:02:46 +02:00
Jean-Sébastien Pédron aa6872bb5c test/Makefile: Use $MAKE instead of hard-coding "make"
This one was harmless but let's do this for consistency's sake.

References #23.
2015-05-07 13:01:13 +02:00
Jean-Sébastien Pédron 9e9c2dec8c Merge branch 'stable' 2015-05-06 19:13:42 +02:00
Jean-Sébastien Pédron 386bba589e Use $MAKE instead of hard-coding "make"
$MAKE is passed down by Umbrella's do-package.mk. This fixes the
testsuite on systems where "make" is not GNU make.

Fixes #23.
2015-05-06 19:09:27 +02:00
Michael Klishin e099bf21c0 Tests for retained messages 2015-04-26 04:51:30 +03:00
Simon MacMullen 379ecfd911 Simplify. Enforce always running SSL tests. Don't create global variables in the Makefile namespace. 2014-11-28 14:39:39 +00:00
Michael Klishin 073cc57dcb Don't require peer cert 2014-11-25 23:51:30 +03:00
Michael Klishin 0dc8b8e22d Require TLS certificate in TLS authentication tests
Otherwise we get platform-specific failures and even generic client exceptions.
This case is potentially valid but is likely to be really rare (if you use TLS,
you probably also authenticate, using credentials or the certificate).

In the original patch this scenario was expected to fail. We now go back
to square 1.
2014-11-25 23:44:42 +03:00
Michael Klishin b1147f355c Pick most recent TLS version available 2014-11-25 23:20:38 +03:00
Michael Klishin d68f2b063e Use TLS v1.1 because v1.2 is not available on CI machines 2014-11-25 21:46:23 +03:00
Michael Klishin df5eb6aa57 Certificate authencation needs to be enabled explicitly, as with STOMP
Using the same ssl_cert_login app key.
2014-11-24 21:22:09 +03:00
Michael Klishin 0e298907aa Make it clear that this test does not expect an authentication failure 2014-11-24 21:21:20 +03:00
Michael Klishin 089ef7e86f Rename TLS test package 2014-11-24 17:01:10 +03:00
Michael Klishin 6eca0b71f8 Only ignore test/build/ but not test/build.xml and test/build.properties 2014-11-24 13:13:27 +03:00
Michael Klishin cee8eb2fd8 Client MQTT authentication using x509 certificates
Original patch by Eric Rauer.
2014-11-21 14:54:33 +00:00
Matthias Radestock bc1cdd77d5 merge stable into default 2014-03-31 13:29:39 +01:00
Matthias Radestock 299bcc1d5b eliminate race in testConnectFirst test
the test was highly timing sensitive; it published 1000 messages and
expected one of those publishes to fail due to the socket getting
closed by the server when encountering the first publish. So if the
client was quick enough / the server slow enough, all the publishes
would go through before the server processed the first one and closed
the socket. Cue test failure.

The new test sends an mqtt 'ping' and waits for a response. Not only
is this non-racy and doesn't require any magic timouts, it also is a
better exercise of the server logic: A 'publish' on a connection which
hasn't seen a 'connect' will fail anyway, even w/o the server code in
place that detects the missing 'connect', since processing a 'publish'
requires an amqp client connection, which in turn is only established
on 'connect'. By contrast, a 'ping' does not require an amqp client
connection. Hence removing the "make sure we have seen a 'connect'"
logic now results in a 'ping' response being sent, which makes the
test fail, as expected.
2014-03-31 13:26:58 +01:00
Simon MacMullen 4e07b1d640 Update copyright for 2014 2014-03-17 17:25:23 +00:00
Simon MacMullen 2206e2ae64 Allow running tests on a Mac 2014-02-03 17:51:02 +00:00
Simon MacMullen 9bde9ce822 Revert part of f438760bff27 since the exception is now an IOException. 2013-10-03 11:34:09 +01:00
Emile Joubert 69b255af77 Propagate Erlang client API change 2013-09-24 11:24:21 +01:00
Emile Joubert 50f162ea0d Swap connect and setting callback 2013-07-31 15:28:22 +01:00
Emile Joubert 23a100db9a Merged stable into default 2013-07-31 13:57:31 +01:00
Emile Joubert 48fbca2834 Automatically subscribe when connecting 2013-07-26 17:43:25 +01:00
Simon MacMullen bb95f34e47 s/VMware/GoPivotal/g 2013-07-01 10:49:14 +01:00
Simon MacMullen 73d32f6c6b Specify the version of the paho MQTT client to use, and some API tweaks to use the latest version. Why not just use the version that used to work? Well, it required some non-standard ant stuff to build. 2013-04-15 16:38:10 +01:00
Emile Joubert f973d137c3 Update copyright 2013 2013-01-23 13:06:40 +00:00
Emile Joubert ad7d5bdbf0 Turn off file-based client persistence in tests 2012-11-13 11:30:17 +00:00
Emile Joubert 44d9fa8b17 Tests require Java AMQP 2012-11-12 13:35:35 +00:00
Emile Joubert 7a10b4a7ec Interoperability fixes 2012-11-05 20:30:45 +00:00
Emile Joubert b88a0e3373 Increase test delay 2012-09-25 09:52:41 +01:00
Emile Joubert 11c2e485ec Prefer https to git protocol for firewall reasons 2012-09-17 15:37:02 +01:00
Emile Joubert 03dc8b5849 Make tests run from umbrella and pass more reliably 2012-09-17 14:57:31 +01:00
Emile Joubert a53c389211 Remove implicit rules for compiling java 2012-08-10 10:16:15 +01:00
Emile Joubert c904f78b2e Run tests from Makefile 2012-08-09 18:55:45 +01:00
Emile Joubert d3f4a2dc24 Updates 2012-08-05 23:52:54 +01:00
Emile Joubert ec215b34bd Clean sessions, and anonymous connections 2012-07-16 14:57:31 +01:00
Emile Joubert f79bf51275 Tests 2012-07-05 18:08:23 +01:00