test: add cases for importing e427
This commit is contained in:
parent
8fe933e885
commit
1531b34f8a
|
@ -40,10 +40,6 @@ get_data_path() ->
|
||||||
emqx_ct_helpers:deps_path(emqx_management, "test/emqx_auth_mnesia_data_export_import_SUITE_data/").
|
emqx_ct_helpers:deps_path(emqx_management, "test/emqx_auth_mnesia_data_export_import_SUITE_data/").
|
||||||
|
|
||||||
import(FilePath, _Version) ->
|
import(FilePath, _Version) ->
|
||||||
dbg:tracer(),dbg:p(all,call),
|
|
||||||
dbg:tpl(emqx_mgmt_data_backup,import_auth_mnesia,x),
|
|
||||||
dbg:tp(emqx_modules_registry,get_modules,x),
|
|
||||||
dbg:tp(emqx_module_internal_acl,on_module_create,x),
|
|
||||||
ok = emqx_mgmt_data_backup:import(get_data_path() ++ "/" ++ FilePath, <<"{}">>),
|
ok = emqx_mgmt_data_backup:import(get_data_path() ++ "/" ++ FilePath, <<"{}">>),
|
||||||
[_] = lists:filter(
|
[_] = lists:filter(
|
||||||
fun(#module{type = mnesia_authentication}) -> true;
|
fun(#module{type = mnesia_authentication}) -> true;
|
||||||
|
@ -57,6 +53,11 @@ import(FilePath, _Version) ->
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
-ifdef(EMQX_ENTERPRISE).
|
-ifdef(EMQX_ENTERPRISE).
|
||||||
|
|
||||||
|
t_importee427(_) ->
|
||||||
|
import("ee427.json", ee427),
|
||||||
|
{ok, _} = emqx_mgmt_data_backup:export(),
|
||||||
|
remove_all_users_and_acl().
|
||||||
|
|
||||||
t_importee430(_) ->
|
t_importee430(_) ->
|
||||||
import("ee435.json", ee435),
|
import("ee435.json", ee435),
|
||||||
{ok, _} = emqx_mgmt_data_backup:export(),
|
{ok, _} = emqx_mgmt_data_backup:export(),
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":"4.2","date":"2022-05-24 12:09:56","modules":[{"id":"module:842a5c57","type":"mnesia_authentication","config":{"password_hash":"sha256"},"enabled":true,"created_at":1653365372585,"description":""},{"id":"module:e3d38e5a","type":"retainer","config":{"storage_type":"ram","max_retained_messages":0,"max_payload_size":"1MB","expiry_interval":0},"enabled":true,"created_at":1652436434273,"description":""},{"id":"module:4f911150","type":"presence","config":{"qos":0},"enabled":true,"created_at":1652436434273,"description":""},{"id":"module:db11d08f","type":"recon","config":{},"enabled":true,"created_at":1652436434273,"description":""}],"rules":[],"resources":[],"blacklist":[],"apps":[{"id":"admin","secret":"public","name":"Default","desc":"Application user","status":true,"expired":"undefined"}],"users":[{"username":"admin","password":"oFu0ZiOAYJmB1DyOzoLwEervBK0=","tags":"administrator"}],"auth_mnesia":[{"login":"usera","type":"clientid","password":"WVlGsjBiNGJkOWRkN2QyZmYyOWViYjI4MzRiZjQyMDgzNDhkYzJjZmZlOGVjMjUzOGU5NDkwYmYyYjY5N2Q3NjUyMDU=","created_at":1653365382492}],"acl_mnesia":[{"type":"clientid","type_value":"clientida","topic":"t/a","action":"pubsub","access":"allow","created_at":1653365390351}],"schemas":[],"configs":[],"listeners_state":[]}
|
|
@ -1 +1 @@
|
||||||
{"version":"4.3","rules":[],"resources":[],"blacklist":[],"apps":[{"id":"admin","secret":"public","name":"Default","desc":"Application user","status":true,"expired":"undefined"}],"users":[{"username":"admin","password":"02BzoSYaTxkscy2MDtU92EbX7b4=","tags":"administrator"}],"auth_mnesia":[{"login":"usera","type":"clientid","password":"joYZ7GY2NzcxNTQwMzY4OTRjNWUyMTdmNDlkNmE5Yzc5MDJiNjA5OWRkMWRkZjc5N2E5OGI4YWFlYTdlOWNiMjU5OWE=","created_at":1653360665243}],"acl_mnesia":[{"type":"clientid","type_value":"clientida","topic":"t/a","action":"pub","access":"allow","created_at":1653360687955},{"type":"clientid","type_value":"clientida","topic":"t/a","action":"sub","access":"allow","created_at":1653360687955}],"modules":[{"id":"module:fcda7532","type":"mnesia_authentication","config":{"password_hash":"sha256"},"enabled":true,"created_at":1653360656060,"description":""},{"id":"module:16f3f067","type":"internal_acl","config":{"acl_rule_file":"etc/acl.conf"},"enabled":true,"created_at":1653360591111,"description":""},{"id":"module:db849123","type":"retainer","config":{"storage_type":"ram","max_retained_messages":0,"max_payload_size":"1MB","expiry_interval":0},"enabled":true,"created_at":1653360591111,"description":""},{"id":"module:55987aaa","type":"presence","config":{"qos":0},"enabled":true,"created_at":1653360591111,"description":""},{"id":"module:78cae4f9","type":"recon","config":{},"enabled":true,"created_at":1653360591111,"description":""}],"schemas":[],"configs":[],"listeners_state":[],"date":"2022-05-24 10:51:39"}
|
{"version":"4.3","rules":[],"resources":[],"blacklist":[],"apps":[{"id":"admin","secret":"public","name":"Default","desc":"Application user","status":true,"expired":"undefined"}],"users":[{"username":"admin","password":"02BzoSYaTxkscy2MDtU92EbX7b4=","tags":"administrator"}],"auth_mnesia":[{"login":"usera","type":"clientid","password":"joYZ7GY2NzcxNTQwMzY4OTRjNWUyMTdmNDlkNmE5Yzc5MDJiNjA5OWRkMWRkZjc5N2E5OGI4YWFlYTdlOWNiMjU5OWE=","created_at":1653360665243}],"acl_mnesia":[{"type":"clientid","type_value":"clientida","topic":"t/a","action":"pub","access":"allow","created_at":1653360687955},{"type":"clientid","type_value":"clientida","topic":"t/a","action":"sub","access":"allow","created_at":1653360687955}],"modules":[{"id":"module:fcda7532","type":"mnesia_authentication","config":{"password_hash":"sha256"},"enabled":true,"created_at":1653360656060,"description":""},{"id":"module:db849123","type":"retainer","config":{"storage_type":"ram","max_retained_messages":0,"max_payload_size":"1MB","expiry_interval":0},"enabled":true,"created_at":1653360591111,"description":""},{"id":"module:55987aaa","type":"presence","config":{"qos":0},"enabled":true,"created_at":1653360591111,"description":""},{"id":"module:78cae4f9","type":"recon","config":{},"enabled":true,"created_at":1653360591111,"description":""}],"schemas":[],"configs":[],"listeners_state":[],"date":"2022-05-24 10:51:39"}
|
||||||
|
|
Loading…
Reference in New Issue