浏览代码

update access sutie and access control

Gilbert Wong 7 年之前
父节点
当前提交
748826bdee
共有 2 个文件被更改,包括 3 次插入2 次删除
  1. 1 1
      src/emqx_access_control.erl
  2. 2 1
      test/emqx_access_SUITE.erl

+ 1 - 1
src/emqx_access_control.erl

@@ -154,7 +154,7 @@ init([]) ->
 handle_call({register_mod, Type, Mod, Opts, Seq}, _From, State) ->
     Mods = lookup_mods(Type),
     reply(case lists:keyfind(Mod, 1, Mods) of
-              true ->
+              {_, _, _} ->
                   {error, already_existed};
               false ->
                   case catch Mod:init(Opts) of

+ 2 - 1
test/emqx_access_SUITE.erl

@@ -98,7 +98,8 @@ end_per_group(_Group, Config) ->
     Config.
 
 init_per_testcase(_TestCase, Config) ->
-    {ok, _Pid} = ?AC:start_link(),
+    %% {ok, _Pid} = 
+    ?AC:start_link(),
     Config.
 end_per_testcase(_TestCase, _Config) ->
     ok.