Commit Graph

737 Commits

Author SHA1 Message Date
zhouzb ec2f758c9f Use erlang:system_time/1 2019-12-10 09:25:39 +08:00
Feng Lee 0f9f1258b6 Improve the emqx_message module and add more test cases
- Add 'emqx_message:clean_dup/1' function
- Clean dup flag before publishing a message
- Add more test cases for emqx_message module
2019-12-10 09:22:38 +08:00
Feng Lee 0c377c67cd Use 'erlang:system_time' to replace 'os:timestamp' (#3088)
Use 'erlang:system_time/1' to replace 'os:timestamp/0'
2019-12-09 16:27:25 +08:00
zhanghongtong 81b1c5872c Fix error foe test/emqx_mod_presence_SUITE 2019-12-07 14:55:34 +08:00
张奇怪 7895432b7d Add more test cases (#3080) 2019-12-07 13:38:56 +08:00
Feng Lee 9c3273a2c6 Improve the process of handling MQTT control packets (#3079) 2019-12-06 19:51:06 +08:00
turtled 4b59db62fa Optimize caps 2019-12-04 13:52:01 +08:00
turtled 13b625f729 Fix compile warning 2019-12-03 19:15:04 +08:00
zhouzb 62484ba84e Fix test cases and update certs 2019-11-18 16:08:51 +08:00
Feng Lee 045216bd4c Remove the the test case 't_check_flapping/1' 2019-11-18 13:56:42 +08:00
tigercl d793c4256f
Merge pull request #3034 from emqx/rm-vm-module
Improve the emqx_vm module and update test cases
2019-11-18 10:51:54 +08:00
tigercl b10cd85ba3
Merge pull request #3033 from emqx/flapping2
Optimize flapping and banned modules
2019-11-18 10:50:35 +08:00
tigercl 2ad701361d
Merge pull request #3031 from emqx/more_test_cases
Add more test cases
2019-11-18 10:49:56 +08:00
Feng Lee 17332b0465 Improve the emqx_vm module and update test cases 2019-11-14 10:40:55 +08:00
Feng Lee d3107facf9 Validate packet id if strict mode. 2019-11-14 09:46:56 +08:00
zhouzb 2fb4d66496 Optimize flapping and banned modules 2019-11-14 09:37:37 +08:00
zhanghongtong 1072536382 Add more test cases for emqx_sup 2019-11-13 18:30:02 +08:00
Feng Lee d6ebbb7cce Merge branch 'develop' of github.com:emqx/emqx into develop 2019-11-12 15:46:48 +08:00
Feng Lee 6682eca19a Add test cases for emqx_misc module 2019-11-12 15:46:27 +08:00
zhanghongtong b22a1a87ba Add more test case for emqx_plugins 2019-11-09 21:26:15 +08:00
zhanghongtong f1ae430d43 Add more test cases for emqx_sys 2019-11-08 17:01:10 +08:00
zhanghongtong 63fb6f2fd0 Add more test cases for emqx 2019-11-07 16:17:17 +08:00
zhanghongtong c3d07dbf80 Add more test cases for emqx_shared_sub 2019-11-07 15:05:41 +08:00
zhanghongtong 718dc40421 Add more test cases for emqx_sys_mon 2019-11-06 10:23:38 +08:00
zhanghongtong bca723e1b5 Add more test cass for emqx_access_rule 2019-11-05 17:07:39 +08:00
zhanghongtong 0dd45aeb3c Add more test cases for emqx_mod_acl_internal 2019-11-05 15:14:31 +08:00
zhanghongtong cc9ad392af Add more test cases for emqx_cm_locker 2019-11-05 14:11:09 +08:00
zhanghongtong 434f937921 Add more test cases for emqx_mod_subscription 2019-11-05 11:47:57 +08:00
zhanghongtong 53caec8504 Add more test cases for emqx_access_control 2019-11-05 11:32:35 +08:00
terry-xiaoyu b17a54d392 Fix testcases for emqx_ws_connection 2019-11-01 20:25:43 +08:00
zhouzb 422c3525d8 Move test case of checking oom to emqx_misc_SUITE 2019-11-01 20:12:18 +08:00
terry-xiaoyu 3cc2bf2bfa Merge branch 'develop' into make_test_cases_pass 2019-11-01 20:05:52 +08:00
terry-xiaoyu 865192c631 Fix testcases for emqx_connection 2019-11-01 19:57:14 +08:00
zhouzb 0be06a93d6 Fix test cases 2019-11-01 18:38:30 +08:00
terry-xiaoyu d946848d42 Improve testcases for emqx_logger 2019-11-01 18:21:46 +08:00
Shawn 19033b38d9
Merge pull request #3014 from emqx/add_more_test_cases
Add test case for logger parse transform
2019-11-01 17:38:47 +08:00
terry-xiaoyu 0f2609b56d Add test case for logger parse transform 2019-11-01 17:36:56 +08:00
zhanghongtong 3e70143518 Fix error test case for emqx 2019-11-01 17:07:32 +08:00
zhouzb e3ddd4ebe9 Make test cases pass temporarily 2019-11-01 16:58:53 +08:00
tigercl 1a901942f7
Merge pull request #3007 from emqx/improve-connection
Improve the 'connection', 'channel' and 'zone' modules
2019-11-01 16:40:20 +08:00
tigercl 81a507c6fa
Merge pull request #3012 from emqx/add_more_test_cases
Add more test cases
2019-11-01 16:40:00 +08:00
zhanghongtong 0e81924034 Add more test cases for emqx 2019-11-01 16:37:20 +08:00
tigercl b3731aaff4
Merge pull request #3010 from emqx/test_cases_zhou
Add test cases and fix bugs
2019-11-01 16:29:00 +08:00
zhouzb c5ad674dd7 Add test cases and fix bugs 2019-11-01 15:48:28 +08:00
zhanghongtong 48f944a9c8 Add more test cases for emqx_listeners 2019-11-01 09:23:45 +08:00
Feng Lee 4c9dda105f Add 'active_n' option for WebSocket listener 2019-11-01 08:00:11 +08:00
zhanghongtong bf82c5a1fe Add more test cases for emqx_tracer 2019-10-30 15:48:32 +08:00
zhanghongtong d444d1c61c Add more test cases for emqx_vm_mon 2019-10-30 14:48:17 +08:00
zhanghongtong 3009eeb270 Add more test cases for emqx_zone 2019-10-29 15:43:09 +08:00
zhanghongtong 971a361ea9 Add more test cases for emqx_logger and fix bug for emqx_logger 2019-10-29 14:27:47 +08:00
terry-xiaoyu 3405dbaf5c Ordered messaging via multiple gen_rpc clients 2019-10-28 21:01:53 +08:00
zhanghongtong 9ef4e62219 Add more test cases for emqx_alarm_handler 2019-10-28 20:37:15 +08:00
terry-xiaoyu f7d3c01308 Merge branch 'develop' into clean_acl_cache 2019-10-28 18:02:41 +08:00
terry-xiaoyu c1d768ff74 Add API for clean and get acl cache 2019-10-28 17:53:53 +08:00
zhanghongtong 73bfaa038b Add more test cases for emqx_packet 2019-10-25 10:08:57 +08:00
张奇怪 c713d619da
Add more test cases (#2992)
* Add more test cases for emqx_stats and emqx_os_mon
Fix test case error for emqx_ws_connection

* Add more test cases for emqx_sys_mon

* Update erlang otp to 22.1 for travis ci

* Delete readable=false for make ct

* Add unset_all_env for emqx_zone and update test cases
2019-10-24 15:41:26 +08:00
Feng Lee d5412c8d34 Merge branch 'gen-ct' into develop 2019-10-23 16:36:17 +08:00
Feng Lee 7be110cdef Add more test cases 2019-10-23 16:35:15 +08:00
terry-xiaoyu 9aef5d60e0 Fix testcase for logger_formatter 2019-10-23 10:26:25 +08:00
Feng Lee fca7a7e761 Merge branch 'connection-test-using-meck' into develop 2019-10-21 19:53:53 +08:00
terry-xiaoyu cb77b229b8 Add testcase for emqx_logger_formatter 2019-10-21 18:35:32 +08:00
Feng Lee 7117dde879 Add more test cases for connection, channel and session modules 2019-10-21 17:14:50 +08:00
Feng Lee 26eab630b3 Add test cases for emqx_channel module 2019-10-20 19:20:38 +08:00
Feng Lee aecda09b9a Add more test cases 2019-10-19 20:18:34 +08:00
Feng Lee cd4adbada0 Add more test cases for connection, channel and session modules 2019-10-18 18:53:31 +08:00
Feng Lee a09b87fc94 Add more test cases for connecton module using meck 2019-10-15 17:28:20 +08:00
Feng Lee a1877f3f42 Return the '{enter, connected}' event first 2019-10-14 13:04:49 +08:00
Feng Lee 6233aa7d46 Ensure the 'conn_state' be 'disconnected' after socket closed 2019-10-12 19:14:33 +08:00
terry-xiaoyu 7f730ffec6 Revert client_id options in the testcases 2019-10-12 18:05:34 +08:00
Feng Lee 932821360f Merge branch 'new-connection-module' into develop 2019-10-12 17:08:48 +08:00
Feng Lee cce0dbd3cf Improve the connection, ws_connection and channel modules 2019-10-12 17:05:37 +08:00
terry-xiaoyu 54e11d3bb5 Fix client_id options in testcases 2019-10-12 15:10:49 +08:00
terry-xiaoyu 47a192ee34 Avoid process crash report for arbitrary exit reason 2019-10-12 14:48:39 +08:00
zhouzb d004a5b68e Rename 'client_id' field to 'clientid' 2019-09-29 16:46:27 +08:00
Feng Lee e8491b69a9 Merge branch 'clientinfo' into develop 2019-09-29 11:00:24 +08:00
Feng Lee 977b551bbf Fix the test cases for session, channel and connection modules 2019-09-29 10:53:59 +08:00
Feng Lee 8ab682151d Improve the connection and channel modules
- Rename the 'client_id' field to 'clientid'
- Support publish stats in channel module
- Update test cases for frame and channel modules
2019-09-29 10:22:02 +08:00
tigercl 9fed1667bb
Merge pull request #2921 from emqx/ct-metrics
Add test cases for new/1, all/0 functions
2019-09-29 09:59:59 +08:00
Feng Lee fcb1b83495 Rename the 'client_id' option to 'clientid' 2019-09-28 10:06:16 +08:00
Feng Lee 20ddd498fc Rename the 'client_id' field to 'clientid' 2019-09-24 17:06:25 +08:00
JianBo He 26e1d3bcef Fix emqx_cm_SUITE failed 2019-09-21 16:22:33 +08:00
terry-xiaoyu 18b401d5fc Fix testcases for new object field protocol 2019-09-21 13:50:18 +08:00
terry-xiaoyu eb0826ef3f Fix testcases for new object field protocol 2019-09-21 12:37:08 +08:00
Feng Lee d945ee4972 Add test cases for new/1, all/0 functions 2019-09-20 23:25:19 +08:00
Feng Lee 699fea4869 Sleep 100 milliseconds 2019-09-20 22:42:33 +08:00
tigercl b72a82e50b
Merge pull request #2919 from emqx/fix-test-cases
Add 'unregister_channel/1' function and test cases
2019-09-20 19:57:47 +08:00
Feng Lee d0a8086d73 Add 'unregister_channel/1' function and test cases 2019-09-20 19:42:59 +08:00
terry-xiaoyu a108f292c2 Ensure expiry_interval expired in testcase 2019-09-20 19:26:56 +08:00
terry-xiaoyu 2c07fc310e Unload meck before testcase ends 2019-09-20 19:15:35 +08:00
terry-xiaoyu 3a39442a1c Update testcases for session module 2019-09-20 18:50:31 +08:00
zhouzb fd455e57eb Fix the test case 't_mod_presence' 2019-09-20 18:38:28 +08:00
terry-xiaoyu 4d214fb6e2 Fix session not saved after maybe_resume_session 2019-09-20 18:28:44 +08:00
zhouzb f0a1ffc3b1 Fix test case 2019-09-20 17:58:31 +08:00
Feng Lee 6aac73f51f Fix the test case 't_handle_disconnect' 2019-09-20 16:48:21 +08:00
terry-xiaoyu b5c9def06a Add testcases for print and usage 2019-09-20 16:18:24 +08:00
Feng Lee 1a3261b186
Merge branch 'develop' into remove-protocol-module 2019-09-20 16:17:44 +08:00
zhouzb 24bfaa768d Call emqx_flapping:detect and generate alarm when flapping is detected 2019-09-20 15:01:51 +08:00
zhouzb a9dd94b2b5 Improve mechanism of waiting for session to expire 2019-09-20 15:01:51 +08:00
Feng Lee 3202ed2392 Improve the 'channel' module and add more test cases
- Rename the 'Client' field to 'ClientInfo'
- Remove the 'expiry_interval' from session record
- Add more test cases for emqx_zone module
- Add more test cases for emqx_banned module
- Add more test cases for emqx_message module
- Remove 'sockname', 'conn_mod' fields from type 'client'
2019-09-20 14:38:16 +08:00
Feng Lee 81e2f47126 Add test cases for emqx_ctl module 2019-09-20 13:47:05 +08:00
Feng Lee 8ecc9ab88a Add test case 't_undefined_headers' 2019-09-19 11:53:29 +08:00
Feng Lee 65cb9dbf38 Add test cases for 'reason/1' 2019-09-19 11:16:13 +08:00
Feng Lee 3705f4f929 Rewrite the test cases for extended modules 2019-09-19 11:04:29 +08:00
Feng Lee c067a43990 Update test cases 2019-09-19 06:06:25 +08:00
Feng Lee ad7e0ae436 Use 'peerhost' to replace 'peername' 2019-09-18 19:44:28 +08:00
Feng Lee 00f3a2f939 Use 'peerhost' to replace 'peername' 2019-09-18 19:17:30 +08:00
turtled 46659854da Fix test cases 2019-09-16 20:25:19 +08:00
zhouzb 0c7c720018 Add delay in test case 2019-09-16 17:51:36 +08:00
zhouzb e35eaa97b3 Fix test case 2019-09-16 17:36:22 +08:00
zhouzb 1667cbd359 Fix test cases 2019-09-16 16:05:06 +08:00
tigercl fc553b8cee
Merge pull request #2803 from emqx/fix_msg_expiry
Fix Message-Expiry-Interval not working
2019-09-16 14:45:22 +08:00
Feng Lee 4764a7707c Rewrite the emqx_packet module and improve channel pipeline (#2903)
Add use_username_as_clientid/1 function and Improve function 'pipeline/3'
2019-09-16 14:17:36 +08:00
Feng Lee 681ae511a8 Introduce the 'strict_mode' option and validate MQTT header (#2898)
Introduce the 'strict_mode' option and validate MQTT header
2019-09-16 14:02:31 +08:00
tigercl 35822ff97a
Fix handling for MQTT spec (#2892)
Fix invalid QoS and protocol name, fix handling for Topic-Alias-Maximum and Maximum-Packet-Size, and send DISCONNECT Packet to client when the session is taken over
2019-09-16 13:51:50 +08:00
Feng Lee 594153c0fb Merge branch 'boot' into develop 2019-09-10 16:26:20 +08:00
Feng Lee a3daa533e7 Add a test case for the new flapping module 2019-09-10 16:20:56 +08:00
Feng Lee 88321fe6fe Remove the emqx_config module
- Remove the emqx_config module
- Move get_env/1, get_env/2 to emqx module
2019-09-09 10:18:10 +08:00
Feng Lee 6eedcb0eda Add test cases for emqx_boot module 2019-09-06 19:17:31 +08:00
Feng Lee 7175e4a74c Set 'boot_modules' when starting emqx apps. 2019-09-06 17:36:34 +08:00
terry-xiaoyu 983973c841 Fix set_chan_stats incorrect 2019-09-05 15:59:18 +08:00
Feng Lee 4ba92b6a3b Fix test case 't_handle_deliver' 2019-09-05 15:02:20 +08:00
Feng Lee 847375d2fb Improve connection and channel modules (#2860)
Improve the connection and channel modules
2019-09-05 14:17:15 +08:00
Feng Lee 62f0f0ccbc Add more test cases for 'emqx_misc' module 2019-08-28 14:29:44 +08:00
GilbertWong 0e9647b601 Delete useless include lib 2019-08-28 11:19:51 +08:00
GilbertWong 783e29d6f7 Add test case for emqx_mod_rewrite 2019-08-28 11:19:51 +08:00
terry-xiaoyu 6352f9e2dc Update testcase emqx_channel:handle_out 2019-08-23 15:20:25 +08:00
tigercl ebc1bd77a9
Send the will message immediately when the network connection is closed by the client (#2834)
Send the will message immediately when the network connection is closed by the client
2019-08-23 14:41:52 +08:00
Feng Lee c69a2b1b48 Ensure session expiration (#2825)
Ensure session expiration
2019-08-23 09:35:29 +08:00
Feng Lee 8b03371a4a Improve the keepalive, connection, channel and session modules (#2813) 2019-08-22 16:38:25 +08:00
tigercl 201428279b
Merge pull request #2817 from emqx/test_emqx_config
Remove redundant code and add test case
2019-08-22 16:13:50 +08:00
GilbertWong 3f20bcf58f Relace emqx_client with emqtt 2019-08-22 14:27:29 +08:00
zhouzb 94c56b5e31 Remove redundant code and add test case 2019-08-21 14:12:34 +08:00
Feng Lee ae33b6037e Fix the test suites. 2019-08-17 14:39:04 +08:00
Feng Lee 52b2f31ced Merge branch 'improve-channel-design-again' into develop 2019-08-17 14:09:26 +08:00
Feng Lee f26505d40a Implement session takeover and resumption.
- Implement session takeover
- Remove `init_proc_mng_policy/1' from emqx_misc module
- Remove `conn_proc_mng_policy/1' from emqx_misc module
- Add `emqx_oom' module to monitor OOM of channel process
2019-08-17 13:37:48 +08:00
tigercl c1fd5f89f1 Make codes compliance with mqtt protocol specifications (#2790)
* Make codes compliance with mqtt protocol specifications

* Fix test case

* Remove emqx_protocol:puback/4
2019-08-17 09:15:43 +08:00
terry-xiaoyu fa1adf5cfb Fix Message-Expiry-Interval not working 2019-08-16 18:27:22 +08:00
tigercl 2e26cd244a Improve test coverage (#2799)
* Improve test coverage

* Improve test coverage for emqx_cm

* Improve test coverage for emqx_cm_registry

* Fix emqx_client_SUITE
2019-08-16 18:25:49 +08:00
Feng Lee d63eccd8b8 Add test cases for emqx_keepalive module (#2784)
* Improve the keepalive module
2019-08-16 18:24:39 +08:00
JianBo He acf54509f5 Add emqx_plugins module test case (#2801) 2019-08-16 18:21:51 +08:00
Gilbert 79744af681 Wrapper proper test cases into common test cases (#2785)
* Wrapper proper test cases into common test cases

* Improve test cases for reason code module (#2789)

* Split 3 proper tests into 3 ct cases

* Improve test cases for client, rpc and request-response

* Add psk suites to increase coverage

* Add sys test cases
2019-08-16 18:07:12 +08:00
JianBo He 8e401968f2 Add testcase for emqx_mod_sup 2019-08-16 17:48:37 +08:00
Shawn b2ddcb26e2
Testcase logf (#2800)
* Add test cases for logger formatter

* Remove the unregister API
2019-08-16 15:11:38 +08:00
Feng Lee 444972968f Improve emqx_mqtt_props module and add test cases 2019-08-12 14:29:38 +08:00
terry-xiaoyu 0c24bfd78c Make emqx_tracer more reliable 2019-08-09 19:59:39 +08:00
周子博 07fcc152e2 Fix test cases 2019-08-09 19:56:42 +08:00
GilbertWong b5aebb19b9 Fix stats test cases 2019-08-09 16:51:28 +08:00
GilbertWong 26cfc20867 Run test via common test 2019-08-09 16:43:54 +08:00
turtled 91a8dbda56 Fix conflicts 2019-08-09 16:41:11 +08:00
terry-xiaoyu 2fcda7d891 Dirty update testcases for shared_sub 2019-08-09 15:44:29 +08:00
GilbertWong 857b3df93d Fix the test cases of websocket channel 2019-08-09 15:30:00 +08:00
Feng Lee a324965240 Add more test cases for emqx_protocol module 2019-08-09 14:29:49 +08:00
周子博 85c33ce81f Fix test cases 2019-08-09 14:24:05 +08:00
GilbertWong 251f1a7174 Disable flapping test cases 2019-08-09 14:16:50 +08:00
Gilbert abb4b07665
Add session proper test cases (#2768)
* Add session proper test cases
* Remove useless mockers
2019-08-09 14:15:34 +08:00
GilbertWong 61ee889113 Fix client bug 2019-08-09 13:40:07 +08:00
Feng Lee 916afc1c74 Add test cases for emqx_protocol module
- Add emqx_session:info/2 for unit tests
- Add emqx_protocol:set/3 for unit tests
- Fix the `check_sub/3` of emqx_mqtt_caps
2019-08-09 11:33:52 +08:00
Feng Lee a2d5b834da Improve emqx_pmon module and add more test cases 2019-08-08 22:42:45 +08:00
Feng Lee 6513a32d37
Merge pull request #2766 from emqx/improve-mqtt-caps-module
Improve mqtt caps module
2019-08-08 22:35:32 +08:00
Feng Lee bd061415c9 Rewrite the emqx_mqtt_caps module and add test cases
- Rename `mqtt_retain_available` to `retain_available`
- Rename `mqtt_wildcard_subscription` to `wildcard_subscription`
- Rename `mqtt_shared_subscription` to `shared_subscription`
- Add `emqx_zone:unset_env/2` API for unit test
2019-08-08 14:11:26 +08:00
Gilbert 96b341fde5
Add proper tests for base62 (#2761)
* Add proper tests for base62

* Delete useless comment
2019-08-07 09:24:03 +08:00
Feng Lee 4afa02ee48 Update all the test cases 2019-08-06 09:04:37 +08:00
Feng Lee c4faeab45a Move test/run_emqx.escript -> scripts/run_emqx.escript 2019-08-03 14:08:20 +08:00
Feng Lee c8317a230d Update copyright 2019-08-03 11:43:30 +08:00
GilbertWong 2aa9b2aa4e Specify mnesia dir for `make run` command 2019-08-03 11:10:25 +08:00
周子博 ef9cbe51eb Fix conflict 2019-08-02 10:41:46 +08:00
周子博 0cdb0d5591 Remove all dependencies on emqx_client.hrl 2019-08-02 10:20:09 +08:00
Feng Lee c95a89ed1e Merge branch 'nchannel' into develop 2019-07-31 14:03:48 +08:00
terry-xiaoyu b0e2b7db0c Support inter-node messages via RPC cast 2019-07-27 12:59:07 +08:00
Feng Lee 6b84eb0595 Rewrite the channel, protocol and session modules. 2019-07-22 17:08:53 +08:00
terry-xiaoyu 7472e531b1 Remove log handler for alarms 2019-07-11 13:27:03 +08:00
GilbertWong 234037aee1 Fix will message mechanism for websocket channel 2019-07-11 09:43:52 +08:00
GilbertWong 41dcb4acf2 Delete slave.config 2019-07-11 09:20:38 +08:00
Feng Lee 8c37ea3f38 Fix conflict 2019-07-02 14:02:42 +08:00
周子博 8234b616e5 Fix test case 2019-06-29 12:38:57 +08:00
terry-xiaoyu 96fff39535 Change default logger level to warning 2019-06-28 21:34:21 +08:00
Gilbert 9df6345a6c Remove bridge functions from emqx (#2652)
* Remove bridge functions from emqx
2019-06-26 19:33:17 +08:00
Feng Lee 9ee0a4d171 Fix the function_clause error when publishing QoS2 message 2019-06-25 17:35:58 +08:00
Feng Lee f32a415a83 Merge branch 'channel3' 2019-06-25 15:55:31 +08:00
Gilbert 475cabde4d Fix issue#2619 (#2646)
* Fix issue#2619
Prior to this change, websocket connection would not be disconnected
when dataframe type is other frametype. However, in mqtt spec, it
shoud be disconnected.

This change fix this inconsistent behaviour with mqtt 5.0
2019-06-21 21:21:49 +08:00
Gilbert 20188f9189 Optimize develop workflow and support make run and code hot swapping (#2644)
* Optimize develop workflow and support make run and code hot swapping
2019-06-21 20:52:27 +08:00
tigercl 0c7c4ee417 Using fixed topic for system message of alarm (#2647)
* Using fixed topic for system message of alarm
2019-06-21 19:51:58 +08:00
Gilbert 1d23d7de86
Optimize test workflow (#2642)
* Optimize test suites workflow

* Better format of makefile

* Fix protocol suite

* Add emqx_access_SUITE
2019-06-20 11:44:44 +08:00
Feng Lee 3877c4db1a Merge branch 'channel2' into channel3 2019-06-18 16:49:26 +08:00
Feng Lee 1d88f8fd9e Improve the emqx_connection, emqx_ws_connection and emqx_frame modules (#2611)
* Adopt channel architecture and improve the MQTT frame parser

* Update the test cases for emqx_channel, emqx_protocol

- Improve emqx_client to Use the new emqx_frame:parse/2
- Update the ct suites for emqx_channel, emqx_ws_channel

* Fix test case
2019-06-14 12:44:27 +08:00
Gilbert d3e7d1f0c9 Fix websocket bug (#2615)
Fix websocket bug.

Prior to this change, websocket connection would be closed directly
without sending connack packet when acl check fails.

This change fix this bug.
2019-06-14 11:33:44 +08:00
Feng Lee de978d4771 Update the test cases for emqx_channel, emqx_protocol
- Improve emqx_client to Use the new emqx_frame:parse/2
- Update the ct suites for emqx_channel, emqx_ws_channel
2019-06-12 10:31:44 +08:00
Feng Lee d386b27e8a Adopt channel architecture and improve the MQTT frame parser 2019-06-11 23:18:38 +08:00
Feng Lee f801ff1e53 Optimize metrics using counters and persistent_term (#2597)
* Optimize emqx_metrics module using persistent_term and counters in OTP 22
2019-06-05 23:16:35 +08:00
Gilbert 0857b976ed Better zone (#2548) 2019-05-25 22:29:23 +08:00
HeeeJianBo 87ffa77ade Fix lookup_session_pids return data type error 2019-05-25 22:28:34 +08:00
spring2maz ac0e637a4b Delete APPLICATION macro from erl-opts in rebar.config 2019-05-24 10:16:10 +08:00
spring2maz d0131ec663 Pin emqx-ct-helpers v1.1 (#2495)
* Pin emqx-ct-helpers v1.1.1

* Fix loaded_plugins touch command
2019-05-04 04:41:08 +08:00
spring2maz 97476b8bde Build with rebar3 (#2475)
* Pin cuttlefish rebar3 branch

* No shallow clone for rebar3

* Replace timer:sleep with receive after for deterministic

* Build with only rebar3

* bbmustache as a test dependency

* Change to plain deps

* Use shallow clone by default

* Add ct-helpers as test dep
2019-04-28 09:40:39 +08:00
Gilbert Wong b3927ff730 Add emqx_ct_helpers as deps and refactor test suites 2019-04-25 13:41:22 +08:00
Gilbert Wong bcbb4b68e9 Add flapping detect feature 2019-04-19 16:34:33 +08:00
Gilbert Wong f1616c33d9 Convert value of attribute table to map 2019-04-13 10:35:59 +08:00
Gilbert Wong 81ef5b9b8d Support cookie based auth 2019-04-12 19:25:22 +08:00
Shawn a53320069b Fix trace logger level not work (#2408)
* Fix trace logger level not work #2385
2019-04-10 09:14:53 +08:00
JianBo He aad2d7378e Put peername into messsage headers (#2390)
* Put peername into the message.heaers
2019-04-04 13:41:03 +08:00
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