fix: issue in test cases
This commit is contained in:
parent
4da106882c
commit
9ca5927b88
|
@ -508,12 +508,11 @@ get_schema_mod(RootName) ->
|
||||||
get_root_names() ->
|
get_root_names() ->
|
||||||
maps:get(names, persistent_term:get(?PERSIS_SCHEMA_MODS, #{names => []})).
|
maps:get(names, persistent_term:get(?PERSIS_SCHEMA_MODS, #{names => []})).
|
||||||
|
|
||||||
-spec save_configs(app_envs(), config(), raw_config(), raw_config(), update_opts()) ->
|
-spec save_configs(app_envs(), config(), raw_config(), raw_config(), update_opts()) -> ok.
|
||||||
ok | {error, term()}.
|
|
||||||
save_configs(_AppEnvs, Conf, RawConf, OverrideConf, Opts) ->
|
save_configs(_AppEnvs, Conf, RawConf, OverrideConf, Opts) ->
|
||||||
%% We first try to save to override.conf, because saving to files is more error prone
|
%% We first try to save to override.conf, because saving to files is more error prone
|
||||||
%% than saving into memory.
|
%% than saving into memory.
|
||||||
save_to_override_conf(OverrideConf, Opts),
|
ok = save_to_override_conf(OverrideConf, Opts),
|
||||||
%% We may need also support hot config update for the apps that use application envs.
|
%% We may need also support hot config update for the apps that use application envs.
|
||||||
%% If that is the case uncomment the following line to update the configs to app env
|
%% If that is the case uncomment the following line to update the configs to app env
|
||||||
%save_to_app_env(_AppEnvs),
|
%save_to_app_env(_AppEnvs),
|
||||||
|
|
|
@ -278,24 +278,11 @@ check_and_save_configs(
|
||||||
case do_post_config_update(ConfKeyPath, Handlers, OldConf, NewConf, AppEnvs, UpdateArgs, #{}) of
|
case do_post_config_update(ConfKeyPath, Handlers, OldConf, NewConf, AppEnvs, UpdateArgs, #{}) of
|
||||||
{ok, Result0} ->
|
{ok, Result0} ->
|
||||||
remove_from_local_if_cluster_change(ConfKeyPath, Opts),
|
remove_from_local_if_cluster_change(ConfKeyPath, Opts),
|
||||||
case
|
ok = emqx_config:save_configs(AppEnvs, NewConf, NewRawConf, OverrideConf, Opts),
|
||||||
save_configs(
|
Result1 = return_change_result(ConfKeyPath, UpdateArgs),
|
||||||
ConfKeyPath,
|
|
||||||
AppEnvs,
|
|
||||||
NewConf,
|
|
||||||
NewRawConf,
|
|
||||||
OverrideConf,
|
|
||||||
UpdateArgs,
|
|
||||||
Opts
|
|
||||||
)
|
|
||||||
of
|
|
||||||
{ok, Result1} ->
|
|
||||||
{ok, Result1#{post_config_update => Result0}};
|
{ok, Result1#{post_config_update => Result0}};
|
||||||
Error ->
|
Error ->
|
||||||
Error
|
Error
|
||||||
end;
|
|
||||||
Error ->
|
|
||||||
Error
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
do_post_config_update(ConfKeyPath, Handlers, OldConf, NewConf, AppEnvs, UpdateArgs, Result) ->
|
do_post_config_update(ConfKeyPath, Handlers, OldConf, NewConf, AppEnvs, UpdateArgs, Result) ->
|
||||||
|
@ -432,12 +419,6 @@ call_post_config_update(
|
||||||
) ->
|
) ->
|
||||||
{ok, Result}.
|
{ok, Result}.
|
||||||
|
|
||||||
save_configs(ConfKeyPath, AppEnvs, CheckedConf, NewRawConf, OverrideConf, UpdateArgs, Opts) ->
|
|
||||||
case emqx_config:save_configs(AppEnvs, CheckedConf, NewRawConf, OverrideConf, Opts) of
|
|
||||||
ok -> {ok, return_change_result(ConfKeyPath, UpdateArgs)};
|
|
||||||
{error, Reason} -> {error, {save_configs, Reason}}
|
|
||||||
end.
|
|
||||||
|
|
||||||
%% The default callback of config handlers
|
%% The default callback of config handlers
|
||||||
%% the behaviour is overwriting the old config if:
|
%% the behaviour is overwriting the old config if:
|
||||||
%% 1. the old config is undefined
|
%% 1. the old config is undefined
|
||||||
|
|
|
@ -79,7 +79,7 @@ on_get_status(_InstId, #{pool_name := PoolName}) ->
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
case emqx_plugin_libs_pool:health_check_ecpool_workers(PoolName, Func) of
|
case emqx_plugin_libs_pool:health_check_ecpool_workers(PoolName, Func) of
|
||||||
true -> connecting;
|
true -> connected;
|
||||||
false -> disconnected
|
false -> disconnected
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
|
@ -71,16 +71,17 @@ end_per_testcase(_Case, Config) ->
|
||||||
Config.
|
Config.
|
||||||
|
|
||||||
listener_mqtt_tcp_conf(Port, EnableAuthn) ->
|
listener_mqtt_tcp_conf(Port, EnableAuthn) ->
|
||||||
|
PortS = integer_to_binary(Port),
|
||||||
#{
|
#{
|
||||||
acceptors => 16,
|
<<"acceptors">> => 16,
|
||||||
zone => default,
|
<<"zone">> => <<"default">>,
|
||||||
access_rules => ["allow all"],
|
<<"access_rules">> => ["allow all"],
|
||||||
bind => {{0, 0, 0, 0}, Port},
|
<<"bind">> => <<"0.0.0.0:", PortS/binary>>,
|
||||||
max_connections => 1024000,
|
<<"max_connections">> => 1024000,
|
||||||
mountpoint => <<>>,
|
<<"mountpoint">> => <<>>,
|
||||||
proxy_protocol => false,
|
<<"proxy_protocol">> => false,
|
||||||
proxy_protocol_timeout => 3000,
|
<<"proxy_protocol_timeout">> => 3000,
|
||||||
enable_authn => EnableAuthn
|
<<"enable_authn">> => EnableAuthn
|
||||||
}.
|
}.
|
||||||
|
|
||||||
t_enable_authn(_Config) ->
|
t_enable_authn(_Config) ->
|
||||||
|
|
Loading…
Reference in New Issue