fix: ensure default_plugins/0 is the same as loaded_plugins.tmpl.
This commit is contained in:
parent
2ad297ae19
commit
a3e263676a
|
@ -252,11 +252,14 @@ default_plugins() ->
|
||||||
%% retainer is managed by emqx_modules.
|
%% retainer is managed by emqx_modules.
|
||||||
%% default is true in data/load_modules. **NOT HERE**
|
%% default is true in data/load_modules. **NOT HERE**
|
||||||
{emqx_retainer, false},
|
{emqx_retainer, false},
|
||||||
{emqx_recon, true},
|
{emqx_recon, false},
|
||||||
%% emqx_telemetry is not exist in enterprise.
|
%% emqx_telemetry is not exist in enterprise.
|
||||||
%% {emqx_telemetry, false},
|
%% {emqx_telemetry, false},
|
||||||
{emqx_rule_engine, true},
|
{emqx_rule_engine, true},
|
||||||
{emqx_bridge_mqtt, false}
|
{emqx_bridge_mqtt, false},
|
||||||
|
{emqx_schema_registry, true},
|
||||||
|
{emqx_eviction_agent, true},
|
||||||
|
{emqx_node_rebalance, true}
|
||||||
].
|
].
|
||||||
|
|
||||||
-endif.
|
-endif.
|
||||||
|
|
|
@ -111,9 +111,12 @@ default_plugins() ->
|
||||||
{emqx_dashboard, true},
|
{emqx_dashboard, true},
|
||||||
{emqx_management, true},
|
{emqx_management, true},
|
||||||
{emqx_modules, true},
|
{emqx_modules, true},
|
||||||
{emqx_recon, true},
|
{emqx_recon, false},
|
||||||
{emqx_retainer, false},
|
{emqx_retainer, false},
|
||||||
{emqx_rule_engine, true}
|
{emqx_rule_engine, true},
|
||||||
|
{emqx_schema_registry, true},
|
||||||
|
{emqx_eviction_agent, true},
|
||||||
|
{emqx_node_rebalance, true}
|
||||||
].
|
].
|
||||||
|
|
||||||
-endif.
|
-endif.
|
||||||
|
@ -125,9 +128,23 @@ t_ensure_default_loaded_plugins_file(Config) ->
|
||||||
ok = emqx_plugins:load(),
|
ok = emqx_plugins:load(),
|
||||||
{ok, Contents} = file:consult(TmpFilepath),
|
{ok, Contents} = file:consult(TmpFilepath),
|
||||||
DefaultPlugins = default_plugins(),
|
DefaultPlugins = default_plugins(),
|
||||||
?assertEqual(DefaultPlugins, lists:sort(Contents)),
|
?assertEqual(lists:sort(DefaultPlugins), lists:sort(Contents)),
|
||||||
|
|
||||||
|
GenContents = get_loaded_plugins_from_tmpl(),
|
||||||
|
Fun = fun({Name, _}) -> Name end,
|
||||||
|
Plugins = lists:sort(lists:map(Fun, Contents)),
|
||||||
|
ExpectPlugins = lists:sort(lists:map(Fun, GenContents)),
|
||||||
|
?assertEqual(ExpectPlugins, Plugins),
|
||||||
|
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
|
get_loaded_plugins_from_tmpl() ->
|
||||||
|
%% /_build/test/logs/ct_run.test@127.0.0.1.xxxx
|
||||||
|
{ok, Cwd} = file:get_cwd(),
|
||||||
|
Home = filename:dirname(filename:dirname(filename:dirname(filename:dirname(Cwd)))),
|
||||||
|
{ok, Plugins} = file:consult(filename:join([Home, "data", "loaded_plugins.tmpl"])),
|
||||||
|
Plugins.
|
||||||
|
|
||||||
t_init_config(_) ->
|
t_init_config(_) ->
|
||||||
ConfFile = "emqx_mini_plugin.config",
|
ConfFile = "emqx_mini_plugin.config",
|
||||||
Data = "[{emqx_mini_plugin,[{mininame ,test}]}].",
|
Data = "[{emqx_mini_plugin,[{mininame ,test}]}].",
|
||||||
|
|
Loading…
Reference in New Issue