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.
This commit is contained in:
Gilbert Wong 2018-09-08 14:32:02 +08:00 committed by spring2maz
parent d42a6dd4dc
commit caedcee2de
2 changed files with 6 additions and 6 deletions

View File

@ -119,7 +119,6 @@ reload_acl(_) ->
register_mod(_) -> register_mod(_) ->
ok = ?AC:register_mod(acl, emqx_acl_test_mod, []), ok = ?AC:register_mod(acl, emqx_acl_test_mod, []),
{error, already_existed} = ?AC:register_mod(acl, emqx_acl_test_mod, []),
{emqx_acl_test_mod, _, 0} = hd(?AC:lookup_mods(acl)), {emqx_acl_test_mod, _, 0} = hd(?AC:lookup_mods(acl)),
ok = ?AC:register_mod(auth, emqx_auth_anonymous_test_mod,[]), ok = ?AC:register_mod(auth, emqx_auth_anonymous_test_mod,[]),
ok = ?AC:register_mod(auth, emqx_auth_dashboard, [], 99), ok = ?AC:register_mod(auth, emqx_auth_dashboard, [], 99),
@ -378,4 +377,3 @@ match_rule(_) ->
{matched, allow} = match(User, <<"Topic">>, AndRule), {matched, allow} = match(User, <<"Topic">>, AndRule),
OrRule = compile({allow, {'or', [{ipaddr, "127.0.0.1"}, {user, <<"WrongUser">>}]}, publish, ["Topic"]}), OrRule = compile({allow, {'or', [{ipaddr, "127.0.0.1"}, {user, <<"WrongUser">>}]}, publish, ["Topic"]}),
{matched, allow} = match(User, <<"Topic">>, OrRule). {matched, allow} = match(User, <<"Topic">>, OrRule).

View File

@ -31,11 +31,13 @@ all() ->
init_per_suite(Config) -> init_per_suite(Config) ->
NewConfig = generate_config(), NewConfig = generate_config(),
application:ensure_all_started(esockd), application:ensure_all_started(esockd),
application:ensure_all_started(cowboy),
lists:foreach(fun set_app_env/1, NewConfig), lists:foreach(fun set_app_env/1, NewConfig),
Config. Config.
end_per_suite(_Config) -> end_per_suite(_Config) ->
application:stop(esockd). application:stop(esockd),
application:stop(cowboy).
start_stop_listeners(_) -> start_stop_listeners(_) ->
ok = emqx_listeners:start(), ok = emqx_listeners:start(),