fix: bad test case

This commit is contained in:
Zaiming Shi 2021-05-20 15:47:16 +02:00
parent 8443aa5e21
commit 4ec1046160
2 changed files with 4 additions and 3 deletions

View File

@ -322,7 +322,7 @@ t_plugins(_) ->
auth_header_()), auth_header_()),
[Plugin3] = filter(get(<<"data">>, Plugins3), <<"name">>, <<"emqx_auth_mnesia">>), [Plugin3] = filter(get(<<"data">>, Plugins3), <<"name">>, <<"emqx_auth_mnesia">>),
?assertEqual(<<"emqx_auth_mnesia">>, maps:get(<<"name">>, Plugin3)), ?assertEqual(<<"emqx_auth_mnesia">>, maps:get(<<"name">>, Plugin3)),
?assertEqual(false, maps:get(<<"active">>, Plugin3)), ?assertEqual(true, maps:get(<<"active">>, Plugin3)),
{ok, _} = request_api(put, {ok, _} = request_api(put,
api_path(["nodes", api_path(["nodes",

View File

@ -225,10 +225,11 @@ filter_plugins(Names) ->
end, Names). end, Names).
load_plugins(Names, Persistent) -> load_plugins(Names, Persistent) ->
Plugins = list(), NotFound = Names -- names(Plugins), Plugins = list(),
NotFound = Names -- names(Plugins),
case NotFound of case NotFound of
[] -> ok; [] -> ok;
NotFound -> ?LOG(alert, "Cannot find plugins: ~p", [NotFound]) NotFound -> ?LOG(alert, "cannot_find_plugins: ~p", [NotFound])
end, end,
NeedToLoad = Names -- NotFound -- names(started_app), NeedToLoad = Names -- NotFound -- names(started_app),
lists:foreach(fun(Name) -> lists:foreach(fun(Name) ->