Commit Graph

737 Commits

Author SHA1 Message Date
Shawn 2306789755 Remove bin_key_map/1 (#2393)
* Remove bin_key_map/1

* Fix Travis-CI failure
2019-04-03 19:41:21 +08:00
Feng Lee 60c2b8bc08 Add more functions to read fields of 'message' record
- Add id/1, topic/1, from/1, payload/1 and timestamp/1 functions
- Improve the test cases
2019-04-02 15:15:13 +08:00
Gilbert Wong 7baa317d55 Delete useless assert to pass ci 2019-03-28 13:48:06 +08:00
Feng Lee dba16aeea5 Add 'remove_header/2', 'get_headers/1' functions
- Adopt new 'export' style
- Add 'remove_header/2', 'get_headers/1' functions
- Remove 'remove_topic_alias/1' function
2019-03-22 11:31:26 +08:00
JianBo He 8a73c62f66 Fix followed packet parse failure (#2333)
To fix issue#2303(https://github.com/emqx/emqx/issues/2303)
It will report the following error, when a connection sends a TCP frame contained many of MQTT packet and followed a split MQTT packet.
2019-03-20 10:14:52 +08:00
Gilbert Wong d020ac0390 Delay receive waiting time 2019-03-18 14:20:52 +08:00
YoukiLin 88c32b2c41 Fix emqx_rpc badargs bug 2019-03-16 21:27:41 +08:00
Shawn 02fe8560e2
Improve emqx_hooks and credentials (#2309)
* Improve emqx_hooks and credentials

1. Modify the return modes of emqx hooks.

Change the return value of hook functions to:
- ok: stop the hook chain and return ok
- {error, Reason}: stop the hook chain and return error
- continue: continue the hook chain

And the return value of emqx_hooks:run/2 is changed to:
- ok
- {error, Reason}

And the return value of emqx_hooks:run/3:
- {ok, Acc}
- {error, Reason, Acc}

2. Treat password as a member of credentials.

Password should be wrapped in the `credentials` data-structure, as the
username/password pair together consists of an authentication method.
There can be some methods using some other credential data (e.g.
a JWT token), and these credential data should also be wrapped in the
the `credentials` data-structure.

An event `client.authenticate` is triggered when an user logs in:
```erlang
emqx_hooks:run('client.authenticate', [], Credentials)
```

A `default callback` that deny/allow any user (according to the
`allow_anonymous` config) should be appended to the end of the
callback chain.

The `credentails` is passed through all of the callbacks, and
can be changed over in this process.

* Refactor emqx hooks return mode

* Remove password from PState
2019-03-16 10:43:53 +08:00
Feng Lee 56718e35cb Add emqx_topic:tokens/1 function (#2305)
* Add emqx_topic:tokens/1 function
2019-03-13 23:31:44 +08:00
Shawn 111b66121c
Support TLS/DTLS PSK (#2297)
* Improve filter functions for emqx-hook

* Add PSK hook

* Reset hook args for filter functions
2019-03-13 22:24:19 +08:00
spring2maz 48450d1d37 Move request response out of emqx client (#2293)
* Delete response_topic_prefix

The Response-Infomation in CONNACK was misinterpreated, it should
not be a broker's global config, instead, it should be per-client
or even per-session prefix/suffix mechanism

* Delete request-response code from emqx_client

* Add request-response test code

* meck as default dependency --- temp workaround for dep-vsn-check
2019-03-13 11:27:25 +08:00
Gilbert Wong 27a7105fac Fix emqx_alarm_handler_SUITE
Prior to this change, emqx_alarm_handler_SUITE read emqx.conf rather
gen.emqx.conf which would trigger unexpected errors

This change fix this issue.
2019-03-13 10:52:15 +08:00
周子博 6816c1ac3e Delete needless test case in emqx_protocol_SUITE 2019-03-12 10:17:22 +08:00
spring2maz 1e27098e8c Drain msg queue for deterministic test 2019-03-05 04:28:01 +01:00
spring2maz a056a4cbde Eliminate {error, inflight_full} from publish call to emqx_client
Prior to this change, if a emqx_client:publish/? caller sends in
QoS=1/2 messages too fast, emqx_client may return
`{error, inflight_full}` which could put put the caller to an
awkward situation: there seem to be no ohter option except for
putting self to a sleep-n-retry infinite loop.

In this change, a new gen_statm state 'inflight_full' is introduced
as a sub-state of 'connected'. When emqx_client is in 'inflight_full'
state, it postpone all publish calls (for QoS=1/2) until inflight
window size shrinks.
2019-03-05 03:47:33 +01:00
turtled 22aa7d4668 Rm acl_deny_action_ct test case 2019-02-28 22:19:19 +08:00
tigercl da755b88c7 Add monitors and alarm handler (#2266)
* Add monitors and alarm handler
2019-02-28 18:25:17 +08:00
Gilbert c26d13b057 Fix test case (#2275)
* Fix t_rpc test
2019-02-28 18:07:16 +08:00
turtled c8e2840126 Merge fix conflicts 2019-02-28 17:02:39 +08:00
linjun 814fd3fc9e Fix test case 2019-02-28 16:36:47 +08:00
Gilbert Wong 7efd7b3ec0 Rename portal to bridge 2019-02-28 15:31:54 +08:00
Gilbert 771f8c052a
Merge branch 'develop' into introduce-new-bridge-impl 2019-02-28 15:14:40 +08:00
Feng Lee e3bc8e4f0a Support batch delivery
- Upgrade the emqx_session module to support batch delivery
- Update emqx_protocol:deliver/2 to support batch delivery
- Update some test cases
2019-02-28 15:09:13 +08:00
Feng Lee 08204fc7a8 Improve the emqx_connection module using gen_statem behaviour (#2235) 2019-02-28 15:08:29 +08:00
linjun 37c7e684b0 Adjusting code 2019-02-28 14:32:13 +08:00
linjun 16165ce935 Use conn_mod instead of socktype 2019-02-28 11:32:05 +08:00
Gilbert Wong 911a813891 Fix copyright and unify log method 2019-02-28 11:18:12 +08:00
spring2maz 9dbc34c376 Ack replayq and allow retry in tests 2019-02-28 11:17:27 +08:00
Gilbert Wong ec37225333 Add emqx_portal interfaces 2019-02-28 11:17:27 +08:00
Gilbert Wong 921a45a505 Fix emqx_portal_mqtt_tests start function 2019-02-28 11:17:27 +08:00
spring2maz d4495fd8e7 Add manual start API 2019-02-28 11:17:27 +08:00
Gilbert 796fc3b1ba Fix app config generation (#2245) 2019-02-28 11:17:27 +08:00
spring2maz 1626cade28 Deleted batch publish support in emqx_portal_client
eqmx_portal_mqtt has to do single message publish calls for now
Also fix a bug in emqx_portal_mqtt ack collector
2019-02-28 11:17:27 +08:00
spring2maz 086a1d56b9 Drop unused config schema
bridge.$name.transport was added before we decided to derive
transport portocol based on the 'address' config.
i.e. when it's a remote erlang node, use gen_rpc
otherwise (must be IP or hostnmae), we should estabilish mqtt connection
2019-02-28 11:17:27 +08:00
spring2maz efc9e34033 Make use of BUMP_PACKET_ID the only way to generate packet IDs 2019-02-28 11:17:27 +08:00
spring2maz 786a6eb696 Add APIs for subscription add / delete 2019-02-28 11:17:27 +08:00
spring2maz 599f5c8d4f Add API emqx_portal:ensure_forward_absent 2019-02-28 11:17:27 +08:00
spring2maz 2903a810ce Add emqx_portal:ensure_foreard_present API 2019-02-28 11:17:27 +08:00
spring2maz 9e78c18681 Add get_forwards and get_subscriptions protal APIs 2019-02-28 11:17:27 +08:00
spring2maz 67376727c9 Add batch send support for emqx_client:publish/2
also cover emqx_portal_mqtt with CT
2019-02-28 11:17:27 +08:00
spring2maz b9e8bde3b0 Add first CT test for emqx_portal based on rpc 2019-02-28 11:17:27 +08:00
spring2maz 6d51d78dfc Add portal transport over emqx_client. 2019-02-28 11:17:27 +08:00
spring2maz fbe67e6784 Introduce new bridge impl 2019-02-28 11:17:27 +08:00
linjun 1fe7431370 Adjusting test case 2019-02-27 16:33:49 +08:00
linjun e16f2fe1fd Increasing coverage for emqx_message 2019-02-22 17:11:02 +08:00
张奇怪 44d3eff094 Auto-pull-request-by-2019-02-19 (#2232)
* Update Copyright to 2019 (#2191)

* Disable bridges by default (#2189)

* Fix warning logger args emqx#2195

* Ambiguity elimination (#2217)

* Fix emqx_ws_connection: prevent crashes on pong (#2210)

* Issue#2184 (#2194)

* Delete dep-vsn-check

* Format app.src
2019-02-19 14:00:34 +08:00
turtled 31e95b56c4 Update Copyright to 2019 2019-01-29 10:43:25 +08:00
turtleDeng 00863acea3
Merge emqx30 (#2181)
* Change the reason code in will topic acl check (#2168)

* Fix bridge bug (#2160)

* Limit bridge QoS less than 1

* Improve shared sub dispatch implementation. (#2144)

* Upgrade ekka, esockd libraries

* Improve the 'try_open_session' function

* Reload config (#2180)
2019-01-25 13:01:48 +08:00
Shawn b8929a46c1 Fix the EXIT outputs in Travis CI (#2154)
* Fix the Exit in testcases

* Fix Exit in emqx_mod_sup_SUITE

* Update testcases for log_tracer

* Fix Exit in emqx_protocol_SUITE

* Add will_acl_check

* Fix more Exits
2019-01-17 17:14:51 +08:00
tigercl bc31faac6b Fix will msg (#2156)
* Remove will_msg and will_topic from protocol state

* Modify try_open_session/1
2019-01-17 13:57:42 +08:00
YoukiLin 3748cd434d Add test case for emqx_sys_mon (#2150) 2019-01-12 23:09:39 +08:00
Gilbert Wong 7aa46896df Fix typo 2019-01-11 16:41:20 +08:00
Gilbert Wong ec03f8e1fa Fix the deliver packet bug and add test case 2019-01-11 16:41:20 +08:00
turtleDeng a5f9466040 QoS0 msg support msgid (#2145)
* QoS0 msg support msgid

* Fix testcase
2019-01-11 11:47:10 +08:00
Feng Lee fe0f5333b3 Improve the pool design
- Move 'emqx_pool:start_link/0' to emqx_pool_sup module
- Use the new log macros
- Add more test cases
2019-01-10 08:49:58 +08:00
Feng Lee 36a4eaec02 Fix the test case for 'emqx_router:print_routes/1' 2019-01-09 12:10:54 +08:00
Feng Lee 52241a7804 Add more test cases for code coverage 2019-01-09 11:57:22 +08:00
Feng Lee d27c824ed8 Add test case for emqx_trie:empty/0 2019-01-09 11:57:22 +08:00
Gilbert 9f83544fce
Fix failed testcase (#2127)
* Fix failed test case
Prior to this change, terry-xiaoyu enhanced the cuttlefish to
support emqx enterprise edtion configuration entries. But it cause 6
test case failed.

* Fix dep-vsn-check
2019-01-06 19:53:01 +08:00
YoukiLin 78b3c375d8
Improving 'emqx_ws_connection' coverage (#2107) 2019-01-03 12:59:39 +08:00
turtleDeng 6a1ebe299a
Merge emqx32 to emqx30 (#2112) 2018-12-28 19:44:41 +08:00
Gilbert 1797aadbe7 Fix unsuback compat (#2102) 2018-12-22 18:47:38 +08:00
turtled 7d3357e0f3 Merge emqx32 2018-12-21 16:01:32 +08:00
Feng Lee 10e5210581 Workaround ssl:setopts(SslSock, [{active, N}]) (#2095)
* Set '{active, true}' for SSL socket
2018-12-21 15:39:24 +08:00
tigercl 31bf01fd7a Fix bug in topic alias maximum (#2074)
* Fix bug in topic alias maximum
2018-12-21 14:01:21 +08:00
Gilbert bf7f10ecd1 Add will topic validation and acl check (#2075)
* Add will topic validation and acl check
2018-12-21 10:49:03 +08:00
Feng Lee c93d0fb174 Add test cases for emqx_gc module 2018-12-21 10:28:33 +08:00
Gilbert Wong 1007105b57 Delete metrics test in session test suite 2018-12-20 22:31:19 +08:00
turtled b4833d6973 Fixed conflicts 2018-12-20 22:23:20 +08:00
YoukiLin 6b538d2363 Add test cases for 'emqx_cm' and 'emqx_sm' (#2073)
Add test cases for 'emqx_cm' and 'emqx_cn'
2018-12-20 21:03:40 +08:00
Feng Lee 14cffcf7fb Add the 'emqx_pd' module
Add utility functions for erlang process dictionary
Add test cases for emqx_pd
2018-12-20 16:45:25 +08:00
tigercl 97474171d0 Better report errors in acl.conf (#2065) 2018-12-19 23:06:48 +08:00
turtled 7a1ec580b0 Update broker test cases 2018-12-19 17:18:26 +08:00
Gilbert 7d9e350bbe Add option to disconnect client in case acl deny (#2059)
* Add option to disconnect client in case acl deny
2018-12-19 10:34:06 +08:00
turtled 666d9706a3 Fixed conflicts 2018-12-18 16:41:10 +08:00
Feng Lee 721b72b96a Add 'active_n' option to optimize the CPU usage of emqx_connection (#2060)
* Add 'active_n' option to optimize the CPU usage of emqx_connection

* Supports batch processing 'DOWN' events
2018-12-17 19:53:29 +08:00
turtled 34370ef622 Merge branch 'issue#1983' into emqx30 2018-12-14 17:55:36 +08:00
Feng Lee 2a747c9d53 Improve the subscription sharding. 2018-12-12 13:40:01 +08:00
Feng Lee b279eff181 Add t_mnesia/1 test case 2018-12-12 13:40:01 +08:00
Feng Lee 33830d8120 Improve the design of trie, router and broker modules
1. Add do_add_route/1 do_add_route/2, do_delete_route/1,
do_delete_route/2 APIs in emqx_router module
2. Improve the code of emqx_trie module
3. Update the emqx_broker module to call the new APIs of emqx_router
2018-12-12 13:40:01 +08:00
周子博 ec2e289776 Fix crash in emqx_acl_internal:filter/2 2018-12-10 11:13:25 +08:00
Feng Lee faac09eac9 Merge subscription sharding 2018-12-10 10:28:01 +08:00
Gilbert Wong e0eb76afa6 Fix subscription 2018-12-08 16:09:54 +08:00
Feng Lee bce1ddc5c4 Implement a hash-based subscription sharding 2018-12-06 18:45:07 +08:00
Feng Lee b4d981daf2 Add a sequence module to generate index for subscription sharding 2018-12-04 15:59:24 +08:00
Gilbert Wong 61030c8d10 Add eunit tests to increase coverage. 2018-12-03 09:15:10 +08:00
Gilbert 295a9d692e
Fix the coverage shaky (#2010) 2018-11-30 19:16:48 +08:00
周子博 ddb9eaef7b Improve test coverage of emqx_metrics 2018-11-30 17:44:29 +08:00
周子博 ea62b15c87 Alter apis provided by emqx_metrics, and use existing timer to commit metrics 2018-11-30 17:44:29 +08:00
周子博 194dbc02c8 Add batch commit for metrics 2018-11-30 17:44:29 +08:00
Feng Lee 21ed012a0c Add an elegant batch module 2018-11-29 10:13:09 +08:00
周子博 5c291ff23e Fix the 'route_batch_delete' config 2018-11-28 16:04:04 +08:00
tigercl 14b8036576 Use username replace id(issue#1737) (#1961)
* Use username replace id(issue#1737)

* Add test case for issue#1737

* Make with_connection/2 support batch connect
2018-11-21 22:51:33 +08:00
spring2maz a2c658ba19 Add acking mechamism for shared dispatch (#1872)
* Add acking mechamism for shared dispatch

For QoS0 messages, no acking
For QoS1/2 messages, 'ACK' at any of events below:
 - ACK when QoS is downgraded to 0
 - Message is sent to connection process
'NACK' at any of events below:
 - Message queue is full and the receiving session starts to drop old messages
 - The receiving session crash
Upon 'NACK', messages are dispatched to the 'next' subscriber in the group,
depending on the shared subscription dispatch strategy.
2018-11-21 22:49:45 +08:00
Gilbert 16821490ce Fix issue#1874 (#1964)
* Fix issue#1874
Prior to this change, if user use one client connect emqx with mqtt
v3.1.1, the client subscribe the topic and publish message to this
topic, it would receive this message itself published, this commit
provide a configure option to let user ignore the message itself published.

This change fix issue 1874.

* Small Fix

* Fix bug

* Better design

* Fix compile warning and improve coverage

* Better design to solve the performance issue

* Fix typo

* Fix typo

* Delete spaces in end of lines.

* Do not use anonymous function

* Better performance
2018-11-19 13:34:03 +08:00
turtled faeda253e1 Fix conflicts 2018-11-10 11:44:55 +08:00
terry-xiaoyu 997958aed1 Change the start_link API for emqx_client
Prior to this change, emqx_client:start_link does 2 works in one call:
- init an erlang process for emqx_client
- send MQTT CONNECT to remote broker

But this solution have some drawbacks:

- the return value of `start_link` compiles the return values of the 2
 works: {ok, Pid, MqttResult}. It is inconsistent with the return value
 of `gen_statem:start_link`, may causes confusions.

- the return mode of the 2 works are different:
  `start_link` should always return {ok, Pid} or {error, Reason}, but
 connecting to mqtt may throw out exceptions as it handles the
 socket. But the caller couldn't have thought of the exception, he would
 pattern match on the result of `emqx_client:start_link`, but it crashed!

- If the init work succeed but the connection failed, the caller couldn't
get a Pid from the return value, but indeed it was created inside the
emqx_client. This hides the fact that the Pid was created, and when the
Pid dies, the caller would receive an message from a Pid it doesn' know about.

This change divived these 2 work into 2 APIs:
- `start_link/1` is to build and verify the options, and returns {ok,Pid}
 (on success) or {error, Reason} (on failure).
- `connect/1` is to send MQTT CONNECT, and returns {ok, MQTTResult::properties()} or
 {error, MQTTReason}. MQTT reason codes will contains in the `MQTTReason`.
2018-11-09 17:43:04 +08:00
Gilbert Wong 32d3826440 Replace macro QOS$i to QOS_$I
The two styles of qos macro name in one project is chaotic. It is not
a good practice.

So I change the QOS$i to QOS_$i
2018-11-08 20:42:31 +08:00
terry-xiaoyu 94dbdffd59 New logger formatter with meta-data 2018-11-02 18:38:07 +08:00
spring2maz ae743ad1f0 Rewrite emqx_mqueue.erl
Fixed bugs:

- Priority queue lack of a `len + 1` logic in `in/2`

Changed behaviors:

- Topics not found in priority table (from config) will be treated with default priority,
  instead of hasing topic name to a priority number.
- Default priority is now configurable (it was always lower than all configured priorities)
- The dropped message due to reaching `max_len` is now returned from `in/2`,
  so the queue owner (`in/2` caller) can perform autopsy on it
2018-10-27 14:21:53 +02:00
tigercl 64cb920b3b
Merge branch 'emqx30' into improve_connect 2018-10-27 14:27:25 +08:00
turtleDeng 8788cb2158
Merge pull request #1921 from emqx/improve_test_cases
Improve test cases
2018-10-26 19:45:18 +08:00
周子博 92251d4a8a Make more normalize 2018-10-26 17:45:13 +08:00
tigercl abb2e5c918
Improve test cases, and fix some bugs (#1920)
* Improve emqx_banned, emqx_pqueue, emqx_router test cases

* Improve emqx_broker test case, and fix bug in emqx_broker

* Add emqx_hooks to CT_SUITES
2018-10-26 17:27:02 +08:00
Gilbert 0b44c1b75f
improve_test_cases 2018-10-26 17:25:31 +08:00
周子博 e56252dac6 Fix bugs in test cases 2018-10-26 14:34:22 +08:00
Gilbert 7544a21e25
Add test cases for emqx_bridge, emqx_mod_rewrite (#1914) 2018-10-26 14:04:33 +08:00
周子博 ffa220a87d Fix bug in test case 2018-10-26 10:46:56 +08:00
周子博 6675e3d496 Implement will message delay publish in session, add test case for clean start and will message in connect packet 2018-10-25 14:26:31 +08:00
Gilbert Wong a1092a6784 Add eunit cases and fix typo. 2018-10-24 15:59:22 +08:00
tigercl 873a08dc94
Improve coverage for emqx_hooks, and add test case for emqx_mod_sup (#1892)
Improve coverage for emqx_hooks, and add test case for emqx_mod_sup
2018-10-19 16:21:43 +08:00
tigercl 55a12c1ab4
Merge branch 'emqx30' into improve_connect 2018-10-19 16:03:17 +08:00
huangdan 73658b3953 Merged emqx_misc_SUITE to emqx_misc_tests (#1890)
* Merged emqx_misc_SUITE to emqx_misc_tests
2018-10-19 09:46:25 +02:00
Gilbert 4c40f75f4b Request & Response (broker and client) (#1819)
Add request & response support for CONNECT & CONNACK

Prior to this change, there is no validate and specified process for
Request-Response-Information and Response-Information

Also added basic Request/Response functionality to emqx_client implementation
2018-10-18 19:21:05 +02:00
spring2maz 7e7d99fbad Change more stats callbacks to full M:F/A
Including emqx_sm emqx_cm emqx_router_helper
2018-10-19 00:22:29 +08:00
spring2maz 4082f3ade2 Improve stats test
Before this change, the stats callback provided by emqx_broker_helper
was an anonymous function with module local context.
This commit changes it to a full fun M:F/A style callback for:
1. More robust to hot beam reload
2. Faster/smaller variable to construct
3. Easier test
2018-10-19 00:22:29 +08:00
周子博 6ffd0ac44f Increase coverage for emqx_protocol 2018-10-10 18:35:47 +08:00
周子博 12da230662 Increase coverage 2018-10-10 15:53:01 +08:00
spring2maz e3f2ae8db8 Change from customized total heap size check to set process flag
The `max_heap_size` process flag can be used to limit total
heap size of a process, and it gives much more detailed
crash log if the limit is hit.
2018-09-29 21:36:34 +08:00
周子博 a77f8d28f9 Improve coverage 2018-09-29 14:47:21 +08:00
周子博 2d354ca883 Improve topic alias maximum in connect packet 2018-09-29 14:47:21 +08:00
周子博 064db65206 improve receive maximum in connect packet 2018-09-29 14:47:21 +08:00
spring2maz 0b0ef9bd54 Fix default QoS in test cases 2018-09-25 22:09:13 +08:00
spring2maz 3b9247994d Refine emqx_mock_client
Before this change, eqmx_mock_client uses a shared ets table
to store last received message, this causes troulbe when we
want to start / stop two or more clients in one test case
the ets table gets owned by the first spanwed client and
gets closed when the owner client dies.

Now it keeps the last received message in process state
and a gen_server call is added to retrieve it for verification

Along with this change in emqx_mock_client, it made possible
to write test case to verify the actual subscriber pid
used in shared subscription strategy, so test cases were
added (and modified) to verify different strategies
2018-09-22 10:51:38 +02:00
spring2maz b35d37c92d Add new shared subscription dispatch strategy
'random' was already there before this change
Added two new strategies: 'sticky' and 'round_robin'
'sticky' is made default as it is the cheapest
2018-09-22 10:50:34 +02:00
tigercl 03f607c1b2 Fix issue#1833 and #1834 (#1845) 2018-09-22 16:10:24 +08:00
turtleDeng 8653732bae Revert "Calculate the 1.5 keep alive time exactly" 2018-09-22 14:52:31 +08:00
spring2maz b61615323b Move shutdown policy config to zone configs 2018-09-21 18:58:18 +02:00
spring2maz f70d16e387 Add a test case to cover timeout message flush in emqx_misc 2018-09-21 18:58:18 +02:00
spring2maz 6fca651a84 Add connection/session shutdown policy
The hibernation behaviour is also changed (implicitly) in this commit:
Prior to this change, connection/session always hibernates after
the stats timer expires regardless of messages in mailbox.
After this commit, connection/session process only goes to hibernate
when the timer expires AND there is nothing left in the mailbox to
process
2018-09-21 18:58:18 +02:00
spring2maz 721f237bc4 Rewrite emqx_gc.erl
The implementation prior to this commit supports
only one gc enforcement policy which is message count threshold.
The new implementation introduces 1 more: volume threshold based
2018-09-21 22:56:34 +08:00
周子博 b1d4ec750a Remove the same test cases as emqx_keepalive 2018-09-20 17:58:54 +08:00
周子博 2c350bf5fb Match test case for last change 2018-09-20 17:19:21 +08:00
HuangDan 3822ff987b Fix function args
Add test cases for emqx_pool module
2018-09-18 09:15:46 +08:00
周子博 5eb92e37cc Remove check for MQTT path, and normalize code 2018-09-14 11:49:17 +08:00
周子博 5465b015be Add test case for last change 2018-09-14 11:49:17 +08:00
Gilbert Wong 45b2686e1c Delete unnecessary code
Prior to this change, there are multiple deprecated functions.
2018-09-14 09:45:34 +08:00
HuangDan fde6a2a4c3 Fixed issue #1811
Add tests case for issue #1811
2018-09-13 22:55:15 +08:00
Gilbert Wong caedcee2de fix listerners and access suites
Prior to this change, listeners test suites did not start cowboy which
is responsible for websocket connections. and access suites start
duplicated processes and these actions are wrong

This change fix the problem states above.
2018-09-08 09:33:37 +02:00
周子博 08bab7efa4 Fix bugs in test cases 2018-09-08 11:49:20 +08:00
turtleDeng c0ddbba5db
Merge pull request #1794 from spring2maz/generate-temp-config-for-test
Generate a config file for testing
2018-09-07 21:50:35 +08:00
turtleDeng 0ec461484e
Merge pull request #1790 from emqx/emqx30-feng
Improve the Hooks' design
2018-09-07 21:46:30 +08:00
Gilbert 84e43c587d
Merge branch 'emqx30' into emqx30 2018-09-07 18:49:11 +08:00
turtleDeng cb058143a5
Merge pull request #1792 from huangdan/master
Add test cases for mqtt5 connect packet
2018-09-07 18:03:37 +08:00
turtleDeng ba176f2073
Merge pull request #1797 from terry-xiaoyu/banned_api_v2
Update for banned API
2018-09-07 17:50:30 +08:00
周子博 1c5615c957 Stop emqx_zone when emqx_mqtt_caps test over 2018-09-07 17:22:24 +08:00
terry-xiaoyu dd8513ad35 Update for banned API
Use `mnesia:foldl` to traverse mnesia rather than `mnesia:first` and
`mnesia:next`, as a badarg exception would occur if the record was
deleted while travering the whole table.
2018-09-07 14:10:16 +08:00
spring2maz 3a94d7ddae Generate a config file for testing
Prior to this change, the template file etc/emqx.conf is used
directly in testing, as a result, mustache style directories
are created e.g. `{{ platform_log_dir }}` which should have been
replaced with a config varialbe e.g. `log`

In this change, Makefile targets are added as `ct` dependency
to download bbmustach, load the template input, replace with
variableds defined in 'vars' file, finally to etc/gen.emqx.conf.
The direct usage of etc/emqx.conf in test code are replaced with
gen.emqx.conf
2018-09-07 07:04:04 +02:00
Feng Lee 304a24ca6a Code Review: Update the zone module
1. Add force_reload/0 management API
2. Change the reload interval to 5 minutes
2018-09-07 10:26:14 +08:00
Gilbert Wong 765ab5ad7b Add condition to handle when mqx_topic_alias do not exist 2018-09-06 19:09:29 +08:00
HuangDan 7c688a4839 Add test case for mqtt5 connect packet 2018-09-06 18:09:58 +08:00
Feng Lee edf654727c Rename emqx_mqtt_properties module to emqx_mqtt_props 2018-09-06 18:09:22 +08:00
Feng Lee 2a75105580 Improve the Hooks's design 2018-09-06 16:27:16 +08:00
Gilbert Wong 2f63b7a487 update broker suite for latest code 2018-08-31 20:21:28 +08:00
Gilbert Wong 14ba395c21 fix seesion and connectiong test suites 2018-08-31 19:15:17 +08:00
Gilbert Wong 748826bdee update access sutie and access control 2018-08-31 01:16:54 +08:00
Gilbert Wong 487fa6824d add emqx_protocol test suites 2018-08-31 00:42:55 +08:00
Gilbert Wong a7274b115d ignore dup cases 2018-08-31 00:15:45 +08:00
Gilbert Wong 809c516a2b delete client testcases duplicated with emqx_mqtt_compat 2018-08-31 00:04:01 +08:00
Feng Lee 674b55e6e7
Merge pull request #1773 from tigercl/emqx30
Add emqx_banned test suite, and fix bugs in emqx_banned
2018-08-30 23:35:15 +08:00
周子博 83e11b6e39 Add emqx_banned test suite, and fix bugs in emqx_banned 2018-08-30 22:45:08 +08:00
Gilbert Wong f229c16752 fix listener test case 2018-08-30 22:21:13 +08:00
Gilbert Wong d0eaa51928 add emqx listeners suite 2018-08-30 22:16:31 +08:00
Feng Lee ed6ffeda91
Merge pull request #1770 from tigercl/emqx30
Fix bugs in emqx_message, emqx_mqueue ct, and add emqx_message ct to Makefile
2018-08-30 21:28:22 +08:00
Gilbert Wong 8fcfcfb860 update compact test cases except keepalive 2018-08-30 21:12:41 +08:00
周子博 e6d0329663 Fix test suites bug, and add emqx_message ct to Makefile 2018-08-30 19:55:44 +08:00
Feng Lee 1207ec1819
Merge pull request #1768 from tigercl/emqx30
Add test case for emqx_connection:attrs/1
2018-08-30 18:55:16 +08:00
Feng Lee c49e5dfddc
Merge branch 'emqx30' into emqx30-feng 2018-08-30 18:42:29 +08:00
Feng Lee c52f5a8525 Update the emqx_mqueue SUITE 2018-08-30 18:32:43 +08:00
周子博 69b285aa3f Add test case for emqx_connection:attrs/1 2018-08-30 16:26:04 +08:00
周子博 c89f53f14d Add session, mountpoint test suites 2018-08-30 14:43:14 +08:00
Gilbert Wong db76177228 add router clean function before each case 2018-08-30 13:48:54 +08:00
Gilbert Wong e97c3a5c8c update frame suite for latest emqx_frame 2018-08-30 13:44:09 +08:00
HuangDan 18eee0f1b0 Fixed Conflicting files 2018-08-30 10:53:35 +08:00
HuangDan 9b06589eab Add SUBSCRIBER/PUBLISH Packet test cases 2018-08-30 10:35:04 +08:00
HuangDan 37c1570e94 Add mqtt connect tests cases 2018-08-30 10:35:04 +08:00
HuangDan 0fbf813ebf Add mqtt connect tests cases 2018-08-30 10:35:04 +08:00
Feng Lee b1dadf444f Comment 'TEST_DEPS = emqx_ct_helplers' 2018-08-30 00:22:43 +08:00
周子博 f4330b8af3 Add some test suites and fix bugs 2018-08-29 19:19:22 +08:00
Gilbert Wong 47232d0281 update emqx_lib_suite and delete duplicate test case 2018-08-29 14:52:35 +08:00
Gilbert Wong 84f241522f update frame suite and frame suite 2018-08-29 14:36:40 +08:00
Feng Lee 41d1f04659 Update copyright 2018-08-28 20:37:46 +08:00
Feng Lee 734de8bf85
Merge pull request #1755 from tigercl/emqx30
Add some test suites
2018-08-28 20:03:59 +08:00
周子博 545e80cd6b Add some test suites 2018-08-28 17:53:03 +08:00
Gilbert 4a1eaaba98
Merge pull request #1754 from Gilbert-Wong/emqx30
Update emqx_topic and emqx router suite
2018-08-28 16:47:47 +08:00
Gilbert Wong 3e4b15fd6d update emqx_router_SUITE 2018-08-28 13:03:54 +08:00
周子博 b59db00aeb Add sm test suite, and fix bug in stats test suite 2018-08-28 09:42:17 +08:00
Gilbert Wong 9d22fcb413 update emqx_topic_SUITE 2018-08-28 09:20:32 +08:00
Gilbert Wong ce3f2e4d9e fix emqx_broker test suite 2018-08-27 21:18:00 +08:00
Gilbert Wong 087bfe80c8 fix unsubscribe emqx_mock_client error 2018-08-27 15:24:40 +08:00
turtled 6478f811bf Fix conflicts 2018-08-27 10:29:22 +08:00
HuangDan e3fb147594 Fixed test case compilation error 2018-08-26 22:25:54 +08:00
terry-xiaoyu 9d29dd0e10 use config enable_acl_cache 2018-08-26 18:25:17 +08:00
terry-xiaoyu 9717f9b83e add module emqx_acl_cache 2018-08-26 15:46:22 +08:00
terry-xiaoyu 8cd20744be improve cache datastruct using keys-queue 2018-08-26 13:33:00 +08:00
terry-xiaoyu a904031979 acl cache using proc_dict 2018-08-26 13:30:18 +08:00
terry-xiaoyu 737fe19331 update acl test cases 2018-08-26 12:48:32 +08:00
周子博 6b45834de4 Add emqx_cm, emqx_metrics, emqx_stats test suites 2018-08-25 18:13:49 +08:00
Feng Lee 0f052ce352 Upgrade connection, protocol and session modules for MQTT 5.0 2018-08-24 18:39:59 +08:00
Gilbert Wong 96d251ec3c Add encode and decode options and test suites 2018-08-07 10:27:04 +08:00
Gilbert Wong 79481db659 Enhance base62 encode/decode Funs 2018-08-06 23:45:27 +08:00
Feng Lee bffdd2ba74 Upgrade esockd and add more test cases 2018-05-22 13:01:19 +08:00
Feng Lee bf253ab9b3 Support batch delete 2018-05-10 22:03:59 +08:00
Feng Lee c11e8f453b Add test cases for MQTT 5.0 frame 2018-05-09 00:42:41 +08:00
Feng Lee 31bc091873 Implement MQTT Version 5.0 client 2018-05-06 17:45:18 +08:00
Feng Lee bbb66ff92e Refactor the broker, router modules 2018-04-10 18:17:07 +08:00
Feng Lee 6a957e1b33 Support MQTT Version 5.0 2018-03-02 20:18:27 +08:00
Feng Lee d7eae533ac Merge the emqx-mqtt5 library 2018-02-28 21:22:39 +08:00
Feng Lee f4fd6efe16 Merge the emqx-common, emqx-router libraries 2018-02-26 23:29:53 +08:00
Feng Lee fcb2ec8427 Merge the latest enterprise branch 2018-02-24 15:56:32 +08:00
Feng Lee b63c34ab14 Merge the latest master branch 2018-02-24 11:27:09 +08:00
Feng Lee a3e97f798b Update Copyright to 2018 2018-01-16 08:57:46 +08:00
HuangDan 6ad7b46885 Fix failed test 2018-01-08 13:39:52 +08:00
HeeeJianBo d5c54276e2 Fix issue #1398 2017-12-27 14:55:36 +08:00
Feng Lee c8d6e9a012 Update test cases 2017-12-07 16:37:46 +08:00
Feng Lee 6e5134a8b2 Merge with the enterprise edition 2017-12-07 16:24:48 +08:00
Feng Lee f1640f5b85 Merge emq24 to X branch 2017-12-07 11:02:44 +08:00
HuangDan 896088b7e8 Router test cases migration from emqttd_SUITE to emqttd_route_SUITE 2017-12-06 21:09:03 +08:00
HuangDan 4c52d99706 Fixed test cases for emqttd_router_SUITE 2017-12-06 15:47:46 +08:00
Feng Lee 2cec86eba7 Merge with version 2.3.0 2017-11-21 14:14:12 +08:00
HuangDan 2d92f95294 Update the test cases for emqttd 2017-11-19 12:06:55 +08:00
Feng Lee 683c74b808 TODO: add more test cases for CLIs 2017-11-18 13:24:28 +08:00
Feng Lee dcb4a7d69b Update the test cases for emqttd_router 2017-11-17 20:52:23 +08:00
Feng Lee 4b8cd18f5d Merge with EMQ X project 2017-10-09 19:43:06 +08:00
HuangDan 947df6ce35 Add test cases for topic match 2017-08-23 21:45:11 +08:00
HuangDan 38008cf09c Fixed test cases for hot configuration 2017-08-16 16:50:24 +08:00
HuangDan 75c6348cf5 Added more test cases for hot configuration 2017-08-16 03:07:30 +08:00
Feng Lee 7494aee126 Add more test cases for hot configuration 2017-08-14 09:33:04 +08:00
HuangDan 0c3c1c3788 Add restApi related test case 2017-08-11 15:42:55 +08:00
HuangDan 51c7c9b688 Add http management APIs tests cases 2017-08-10 18:30:07 +08:00
HuangDan c83b9e6124 Depends on the ekka_mnesia module 2017-07-23 12:41:44 +08:00
HuangDan e3018146e7 Remove invalid test cases 2017-07-12 20:20:47 +08:00
HuangDan cb4841631e Update emqttd Test Suite 2017-07-11 23:48:58 +08:00
HuangDan fb179748c0 Remove invalid test case 2017-07-06 22:27:44 +08:00
HuangDan de2e1f79e8 Update test case for http api 2017-06-12 22:45:39 +08:00
HuangDan 73d84bef5e Update SUITE conf 2017-05-05 14:53:06 +08:00
HuangDan 9bfa46c880 Add issues#963 case 2017-03-29 21:20:05 +08:00
Feng Lee 50a5c304e2 Merge branch 'emq20' into develop 2017-03-24 13:26:42 +08:00
黄丹 e56ba41027 Update arg sslopts 2017-03-16 10:03:58 +08:00
Feng Lee b5446ceb4d Change the 'ssl' to 'sslopts' 2017-03-13 16:35:36 +08:00
HuangDan 433c2304ac Merge branch 'emq20' into develop 2017-03-13 16:08:32 +08:00
HuangDan 524dce40dd Fix test case 2017-03-13 16:08:22 +08:00
Feng Lee 3d0bc15e93 Use the '?assertEqual' macro and update Copyright info 2017-03-06 18:06:15 +08:00
huangdan 4de8c0921e Add test case 2017-03-04 16:23:13 +08:00
Feng Lee 2d9dbe4729 Support to hook 'tag' function 2017-02-23 11:55:52 +08:00
Feng 62a0eaf65d Fix the test cases for emqttd_parser 2017-02-21 23:02:10 +08:00
huangdan 4a41d005cb Fix tests 2017-02-17 17:12:27 +08:00
Feng Lee 1222746b79 Update copyright and format code 2017-02-16 11:21:31 +08:00
Feng Lee 08100525a5 Add inflight module and test suite 2017-02-16 10:44:00 +08:00
Feng a59d5bb459 Rename the emqttd_time APIs 2017-02-15 22:05:28 +08:00
huangdan 8092543efb Copyright (c) 2012-2017 2017-01-11 19:34:48 +08:00
huangdan d7c5706b17 code review 2016-12-14 21:00:50 +08:00
huangdan 421ae007e8 code format 2016-12-14 19:15:32 +08:00
huangdan 4c9e031ece code format 2016-12-14 19:14:03 +08:00
huangdan b9220490bf code format 2016-12-14 19:11:37 +08:00
huangdan 776e6d9266 sslmut ct 2016-12-14 16:55:05 +08:00
huangdan aa46cc0145 ssl-oneway ct 2016-12-14 13:45:59 +08:00
huangdan fb50fbd13d node_down clean_routes 2016-12-04 19:55:56 +08:00
turtled 186d512038 fixed ssl opts fail_if_no_peer_cert 2016-11-07 13:40:52 +08:00
turtled 3db876781b handshake_timeout change 2016-11-03 11:04:57 +08:00
huangdan bd4685cd73 del retain subscription presence conf 2016-11-01 16:13:47 +08:00
huangdan 7bd7b6199d ct emqttd 2016-10-31 17:47:12 +08:00
Feng Lee 1038f854e3 merge 2016-10-16 17:31:59 +08:00
huangdan fdaa53c2e3 cuttlefish config ct 2016-10-16 11:42:34 +08:00
huangdan 3a3c2977a0 vm ct 2016-10-16 11:42:06 +08:00
huangdan 1266fd70a7 cuttlefish config ct 2016-10-15 10:04:35 +08:00
huangdan 34824c956c vm ct 2016-10-11 09:46:24 +08:00
huangdan 188dcb2645 Merge branch 'emq20' of https://github.com/emqtt/emqttd into emq20 2016-09-28 11:21:38 +08:00
huangdan e3e00a99b1 alarm test 2016-09-25 07:40:36 +08:00
Feng 0063895706 test emqttd:run_hooks/2 2016-09-23 15:29:39 +08:00
huangdan c5bb1e031e cluster ct 2016-09-21 11:27:39 +08:00
huangdan 6bfb794ab7 share local ct 2016-09-18 18:04:50 +08:00
Feng 82b31b630e -> %u 2016-09-09 23:06:41 +08:00
Feng 2c5b543440 test 2016-09-09 10:38:52 +08:00
Feng a16802d018 session.subscribed, session.unsubscribed hooks and retainer module 2016-09-08 09:10:45 +08:00
Feng ff8d074576 HTTP Request Test 2016-08-29 14:15:45 +08:00
Feng d61d2605ad base62 2016-08-27 15:50:49 +08:00
Feng dbed5b914a base62 2016-08-27 15:44:22 +08:00
Feng Lee b0f082ebe0 to_hexstr/1, from_hexstr/1 2016-08-23 10:13:13 +08:00
huangdan a318244be0 http publish 2016-08-22 15:22:57 +08:00
huangdan 74efc0c095 http request test 2016-08-21 16:12:08 +08:00
huangdan 2f777ebe4c test ct 2016-08-21 13:14:00 +08:00
Feng Lee 354ab5ad21 msgid -> id 2016-08-18 10:57:00 +08:00
Feng Lee 9a4c44913e commen tests 2016-08-12 12:59:03 +08:00
Feng 813506d47a Fix test cases for trie 2016-08-12 11:53:20 +08:00
Feng f998d2a41d fix CT errors 2016-07-23 11:10:55 +08:00
Feng Lee b877cec208 Merge branch 'issue#599' into emq10 2016-06-21 11:35:25 +08:00
Feng Lee 0aa8a82e59 ensure the mqtt listener is started successfully 2016-06-21 11:33:23 +08:00
Feng Lee fe3becbf9b Fix issue#599 - Reject empty clientId with non-clean session 2016-06-21 11:29:59 +08:00
Feng Lee fc68021ff5 CIDR badmatch 2016-05-31 21:13:44 +08:00
Feng Lee e16f8506ef base62 encode/decode 2016-05-17 10:36:09 +08:00
Feng Lee 6245d24c83 {error, already_existed} 2016-05-05 15:44:36 +08:00
Feng Lee f50efa5813 fix issue#542 2016-05-05 15:36:44 +08:00
Feng Lee 9cf5e5cf2a vm([]) 2016-05-03 18:29:05 +08:00
Feng Lee 17d1598688 Fix issue#534 - Add './bin/emqttd_ctl vm ports' CLI 2016-04-29 00:23:57 +08:00
Feng e1ae9a7068 pubsub_queue, assert 2016-04-16 14:28:21 +08:00
Feng b257423730 more test cases for parer 2016-04-12 11:19:55 +08:00
Feng 17f40f458f if_subsciption, async_subscribe 2016-03-14 13:21:35 +08:00
Feng e32d85f40a backend and retained_message 2016-03-12 15:39:19 +08:00
Feng faf05eb85a test cases for server, pubsub and router 2016-03-11 23:19:17 +08:00
Feng Lee 5695ba178c cli common tests 2016-02-17 23:52:04 +08:00
Feng Lee 369c5e86c5 fix issue #438 - Bridge emqttd broker to another emqttd broker & emqttd to mosquitto bridge 2016-02-17 21:15:34 +08:00
Feng 928780f322 common tests 2016-02-16 02:20:29 +08:00
Feng 9cb0fe3f0a more test cases 2016-02-14 01:50:51 +08:00
Feng dfdad8bcb6 refactor the router and pubsub 2016-02-14 01:48:49 +08:00
Feng 15ad12d58d more unit tests 2016-02-14 01:26:01 +08:00
Feng 3c53cf2b09 merge zenmq_trie, zenmq_mnesia, zenmq_boot 2016-02-13 14:26:40 +08:00
Feng 89052d8e6e add emqttd_time module, fix comments and format 2016-02-11 15:52:59 +08:00
Feng 3f047a1d16 add emqttd_time module 2016-02-11 14:33:42 +08:00
Feng ea887c8eee Licensed under the Apache 2.0 2016-02-11 02:02:48 +08:00
Feng 0af61fea01 fix plen/2 test case 2016-01-25 19:49:53 +08:00
Feng 89741b6bfe priority_queue:plen/2 test 2016-01-25 14:48:47 +08:00
Feng 2547d40356 add emqttd_tests, rm debugFmt 2016-01-24 13:44:53 +08:00
Feng 3af624a6c3 route tests 2016-01-24 13:32:30 +08:00
Feng b6db311011 100% mqueue test 2016-01-24 13:29:22 +08:00
Feng 2b27351bd0 priority mqueue test 2016-01-24 00:35:20 +08:00
Feng f2267f594f test plen/2, out/2 2016-01-23 22:05:41 +08:00
Feng 21cb2bea6e 2016 2016-01-15 13:43:22 +08:00
Feng f8c638d113 route_tests 2015-12-17 14:12:53 +08:00
Feng fe82fde717 subscription 2015-12-17 12:38:13 +08:00
Feng ea45e45f28 retainer, serialize 2015-12-10 16:21:53 +08:00
Feng dec15c68d9 retainer, serialize 2015-12-10 16:21:40 +08:00
Feng 26893c764c serilize 2015-12-10 14:09:05 +08:00
Feng 8491467bbb support 'and', 'or' 2015-11-04 21:42:17 +08:00
Feng d09721301e conflict 2015-11-04 10:22:49 +08:00
Feng 9bad2bf65b support Seq 2015-11-03 12:52:27 +08:00
Feng 09047287c4 retained test 2015-10-25 14:56:26 +08:00
Allen Xiang 727e7d4727 fix typo 2015-10-13 15:41:46 -05:00
Feng 78ecac09a4 trie test 2015-10-11 15:28:13 +08:00
Feng 273149f633 keepalive tests 2015-10-04 11:23:24 +08:00
Feng Lee 991d658438 add more match tests 2015-08-16 22:01:41 +08:00
Feng 30875c0706 fix test cases 2015-07-08 22:53:27 +08:00
Feng c0d283aaa7 guid and fix clientid 2015-07-05 20:41:26 +08:00
Feng Lee 0f68186472 mqueue test 2015-06-24 09:26:22 +08:00
Feng Lee be52625d59 AclOpts 2015-06-23 12:47:12 +08:00
Feng Lee 3e5675cc71 ipaddress 2015-06-23 12:20:41 +08:00
Feng Lee 8702ab838c 0.9 project structure 2015-06-22 16:18:33 +08:00