Procházet zdrojové kódy

chore: delete import and export feature

Rory Z před 4 roky
rodič
revize
1582c07cbe
26 změnil soubory, kde provedl 1 přidání a 1961 odebrání
  1. 1 1
      apps/emqx_connector/rebar.config
  2. 0 184
      apps/emqx_management/test/emqx_bridge_mqtt_data_export_import_SUITE.erl
  3. 0 68
      apps/emqx_management/test/emqx_bridge_mqtt_data_export_import_SUITE_data/409.json
  4. 0 70
      apps/emqx_management/test/emqx_bridge_mqtt_data_export_import_SUITE_data/415.json
  5. 0 70
      apps/emqx_management/test/emqx_bridge_mqtt_data_export_import_SUITE_data/420.json
  6. 0 76
      apps/emqx_management/test/emqx_bridge_mqtt_data_export_import_SUITE_data/430.json
  7. 0 68
      apps/emqx_management/test/emqx_bridge_mqtt_data_export_import_SUITE_data/ee4010.json
  8. 0 70
      apps/emqx_management/test/emqx_bridge_mqtt_data_export_import_SUITE_data/ee410.json
  9. 0 70
      apps/emqx_management/test/emqx_bridge_mqtt_data_export_import_SUITE_data/ee411.json
  10. 0 119
      apps/emqx_management/test/emqx_bridge_mqtt_data_export_import_SUITE_data/ee420.json
  11. 0 123
      apps/emqx_management/test/emqx_bridge_mqtt_data_export_import_SUITE_data/ee425.json
  12. 0 123
      apps/emqx_management/test/emqx_bridge_mqtt_data_export_import_SUITE_data/ee430.json
  13. 0 33
      apps/emqx_management/test/emqx_mgmt_api_SUITE.erl
  14. 0 194
      apps/emqx_management/test/emqx_webhook_data_export_import_SUITE.erl
  15. 0 43
      apps/emqx_management/test/emqx_webhook_data_export_import_SUITE_data/409.json
  16. 0 42
      apps/emqx_management/test/emqx_webhook_data_export_import_SUITE_data/415.json
  17. 0 43
      apps/emqx_management/test/emqx_webhook_data_export_import_SUITE_data/422.json
  18. 0 44
      apps/emqx_management/test/emqx_webhook_data_export_import_SUITE_data/423.json
  19. 0 47
      apps/emqx_management/test/emqx_webhook_data_export_import_SUITE_data/425.json
  20. 0 52
      apps/emqx_management/test/emqx_webhook_data_export_import_SUITE_data/430.json
  21. 0 43
      apps/emqx_management/test/emqx_webhook_data_export_import_SUITE_data/ee4010.json
  22. 0 43
      apps/emqx_management/test/emqx_webhook_data_export_import_SUITE_data/ee410.json
  23. 0 43
      apps/emqx_management/test/emqx_webhook_data_export_import_SUITE_data/ee411.json
  24. 0 92
      apps/emqx_management/test/emqx_webhook_data_export_import_SUITE_data/ee420.json
  25. 0 102
      apps/emqx_management/test/emqx_webhook_data_export_import_SUITE_data/ee425.json
  26. 0 98
      apps/emqx_management/test/emqx_webhook_data_export_import_SUITE_data/ee430.json

+ 1 - 1
apps/emqx_connector/rebar.config

@@ -11,7 +11,7 @@
   %% NOTE: mind poolboy version when updating mongodb-erlang version
   {mongodb, {git,"https://github.com/emqx/mongodb-erlang", {tag, "v3.0.7"}}},
   %% NOTE: mind poolboy version when updating eredis_cluster version
-  {eredis_cluster, {git, "https://github.com/emqx/eredis_cluster", {tag, "0.6.6"}}},
+  {eredis_cluster, {git, "https://github.com/emqx/eredis_cluster", {tag, "0.6.7"}}},
   %% mongodb-erlang uses a special fork https://github.com/comtihon/poolboy.git
   %% (which has overflow_ttl feature added).
   %% However, it references `{branch, "master}` (commit 9c06a9a on 2021-04-07).

+ 0 - 184
apps/emqx_management/test/emqx_bridge_mqtt_data_export_import_SUITE.erl

@@ -1,184 +0,0 @@
-%%--------------------------------------------------------------------
-%% Copyright (c) 2020-2021 EMQ Technologies Co., Ltd. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%%     http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%--------------------------------------------------------------------
-
--module(emqx_bridge_mqtt_data_export_import_SUITE).
--include_lib("eunit/include/eunit.hrl").
--include_lib("emqx_rule_engine/include/rule_engine.hrl").
--compile([export_all, nowarn_export_all]).
-
-% -define(EMQX_ENTERPRISE, true).
-
-%%--------------------------------------------------------------------
-%% Setups
-%%--------------------------------------------------------------------
-all() ->
-    emqx_ct:all(?MODULE).
-
-init_per_suite(Cfg) ->
-    application:load(emqx_modules),
-    application:load(emqx_bridge_mqtt),
-    emqx_ct_helpers:start_apps([emqx_rule_engine, emqx_management]),
-    Cfg.
-
-end_per_suite(Cfg) ->
-    emqx_ct_helpers:stop_apps([emqx_management, emqx_rule_engine]),
-    Cfg.
-
-get_data_path() ->
-    emqx_ct_helpers:deps_path(emqx_management, "test/emqx_bridge_mqtt_data_export_import_SUITE_data/").
-
-import(FilePath, Version) ->
-    ok = emqx_mgmt_data_backup:import(get_data_path() ++ "/" ++ FilePath, <<"{}">>),
-    timer:sleep(500),
-    lists:foreach(fun(#resource{id = Id, config = Config} = _Resource) ->
-        case Id of
-            <<"bridge">> ->
-                test_utils:resource_is_alive(Id),
-                handle_config(Config, Version, bridge);
-            <<"rpc">> ->
-                test_utils:resource_is_alive(Id),
-                handle_config(Config, Version, rpc);
-            _ -> ok
-        end
-    end, emqx_rule_registry:get_resources()).
-
-%%--------------------------------------------------------------------
-%% Cases
-%%--------------------------------------------------------------------
-
--ifndef(EMQX_ENTERPRISE).
-
-t_import420(_) ->
-    import("420.json", 420),
-    {ok, _} = emqx_mgmt_data_backup:export(),
-    remove_resources().
-
-t_import430(_) ->
-    import("430.json", 430),
-    {ok, _} = emqx_mgmt_data_backup:export(),
-    remove_resources().
-
-t_import409(_) ->
-    import("409.json", 409),
-    {ok, _} = emqx_mgmt_data_backup:export(),
-    remove_resources().
-
-t_import415(_) ->
-    import("415.json", 415),
-    {ok, _} = emqx_mgmt_data_backup:export(),
-    remove_resources().
-
-
-handle_config(Config, 420, bridge) ->
-    ?assertEqual(false, maps:get(<<"ssl">>, Config));
-
-handle_config(Config, 430, bridge) ->
-    ?assertEqual(false, maps:get(<<"ssl">>, Config));
-
-handle_config(Config, 420, rpc) ->
-    handle_config(Config, 430, rpc);
-
-handle_config(Config, 409, rpc) ->
-    handle_config(Config, 420, rpc);
-
-handle_config(Config, 415, rpc) ->
-    handle_config(Config, 420, rpc);
-
-handle_config(Config, 409, bridge) ->
-    handle_config(Config, 420, bridge);
-
-handle_config(Config, 415, bridge) ->
-    handle_config(Config, 420, bridge);
-
-handle_config(Config, 430, rpc) ->
-    ?assertEqual(<<"test@127.0.0.1">>, maps:get(<<"address">>, Config)),
-    ?assertEqual(32, maps:get(<<"batch_size">>, Config)),
-    ?assertEqual(<<"off">>, maps:get(<<"disk_cache">>, Config)),
-    ?assertEqual(<<"bridge/emqx/${node}/">>, maps:get(<<"mountpoint">>, Config)),
-    ?assertEqual(<<"30s">>, maps:get(<<"reconnect_interval">>, Config)),
-    ?assertEqual(8, maps:get(<<"pool_size">>, Config));
-
-handle_config(_, _, _) -> ok.
-
--endif.
-
--ifdef(EMQX_ENTERPRISE).
-
-t_importee4010(_) ->
-    import("ee4010.json", ee4010),
-    {ok, _} = emqx_mgmt_data_backup:export(),
-    remove_resources().
-
-t_importee410(_) ->
-    import("ee410.json", ee410),
-    {ok, _} = emqx_mgmt_data_backup:export(),
-    remove_resources().
-
-t_importee411(_) ->
-    import("ee411.json", ee411),
-    {ok, _} = emqx_mgmt_data_backup:export(),
-    remove_resources().
-
-t_importee420(_) ->
-    import("ee420.json", ee420),
-    {ok, _} = emqx_mgmt_data_backup:export(),
-    remove_resources().
-
-t_importee425(_) ->
-    import("ee425.json", ee425),
-    {ok, _} = emqx_mgmt_data_backup:export(),
-    remove_resources().
-
-t_importee430(_) ->
-    import("ee430.json", ee430),
-    {ok, _} = emqx_mgmt_data_backup:export(),
-    remove_resources().
-
-%%--------------------------------------------------------------------
-%% handle_config
-%%--------------------------------------------------------------------
-
-handle_config(Config, ee4010, Id) ->
-    handle_config(Config, ee430, Id);
-
-handle_config(Config, ee410, Id) ->
-    handle_config(Config, ee430, Id);
-
-handle_config(Config, ee411, Id) ->
-    handle_config(Config, ee430, Id);
-
-handle_config(Config, ee420, Id) ->
-    handle_config(Config, ee430, Id);
-
-handle_config(Config, ee425, Id) ->
-    handle_config(Config, ee430, Id);
-
-handle_config(Config, ee430, bridge) ->
-    ?assertEqual(false, maps:get(<<"ssl">>, Config));
-
-handle_config(Config, ee430, rpc) ->
-    ?assertEqual(<<"off">>, maps:get(<<"disk_cache">>, Config));
-
-handle_config(Config, ee435, Id) ->
-    handle_config(Config, ee430, Id).
--endif.
-
-remove_resources() ->
-    timer:sleep(500),
-    lists:foreach(fun(#resource{id = Id}) ->
-        emqx_rule_engine:delete_resource(Id)
-    end, emqx_rule_registry:get_resources()),
-    timer:sleep(500).

+ 0 - 68
apps/emqx_management/test/emqx_bridge_mqtt_data_export_import_SUITE_data/409.json

@@ -1,68 +0,0 @@
-{
-    "version": "4.0",
-    "users": [
-        {
-            "username": "admin",
-            "tags": "administrator",
-            "password": "m/GtjNgri9GILklefVJH8BeTnNE="
-        }
-    ],
-    "schemas": [],
-    "rules": [],
-    "resources": [
-        {
-            "type": "bridge_mqtt",
-            "id": "bridge",
-            "description": "bridge",
-            "created_at": null,
-            "config": {
-                "username": "user",
-                "ssl": "off",
-                "retry_interval": "20s",
-                "reconnect_interval": "30s",
-                "proto_ver": "mqttv4",
-                "password": "passwd",
-                "mountpoint": "bridge/emqx/${node}/",
-                "keyfile": "etc/certs/client-key.pem",
-                "keepalive": "60s",
-                "disk_cache": "off",
-                "clientid": "bridge_aws",
-                "ciphers": "ECDHE-ECDSA-AES256-GCM-SHA384,ECDHE-RSA-AES256-GCM-SHA384",
-                "certfile": "etc/certs/client-cert.pem",
-                "cacertfile": "etc/certs/cacert.pem",
-                "bridge_mode": true,
-                "address": "127.0.0.1:1883"
-            }
-        },
-        {
-            "type": "bridge_rpc",
-            "id": "rpc",
-            "description": "rpc",
-            "created_at": null,
-            "config": {
-                "reconnect_interval": "30s",
-                "pool_size": 8,
-                "mountpoint": "bridge/emqx/${node}/",
-                "disk_cache": "off",
-                "batch_size": 32,
-                "address": "test@127.0.0.1"
-            }
-        }
-    ],
-    "date": "2021-03-30 13:38:39",
-    "blacklist": [],
-    "auth_username": [],
-    "auth_mnesia": [],
-    "auth_clientid": [],
-    "apps": [
-        {
-            "status": true,
-            "secret": "public",
-            "name": "Default",
-            "id": "admin",
-            "expired": "undefined",
-            "desc": "Application user"
-        }
-    ],
-    "acl_mnesia": []
-}

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 70
apps/emqx_management/test/emqx_bridge_mqtt_data_export_import_SUITE_data/415.json


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 70
apps/emqx_management/test/emqx_bridge_mqtt_data_export_import_SUITE_data/420.json


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 76
apps/emqx_management/test/emqx_bridge_mqtt_data_export_import_SUITE_data/430.json


+ 0 - 68
apps/emqx_management/test/emqx_bridge_mqtt_data_export_import_SUITE_data/ee4010.json

@@ -1,68 +0,0 @@
-{
-    "version": "4.0",
-    "users": [
-        {
-            "username": "admin",
-            "tags": "administrator",
-            "password": "GCX5nvOMK0hbiMB4AUyc25wI8fU="
-        }
-    ],
-    "schemas": [],
-    "rules": [],
-    "resources": [
-        {
-            "type": "bridge_mqtt",
-            "id": "bridge",
-            "description": "bridge",
-            "created_at": null,
-            "config": {
-                "username": "user",
-                "ssl": "off",
-                "retry_interval": "20s",
-                "reconnect_interval": "30s",
-                "proto_ver": "mqttv4",
-                "password": "passwd",
-                "mountpoint": "bridge/emqx/${node}/",
-                "keyfile": "etc/certs/client-key.pem",
-                "keepalive": "60s",
-                "disk_cache": "off",
-                "clientid": "bridge_aws",
-                "ciphers": "ECDHE-ECDSA-AES256-GCM-SHA384,ECDHE-RSA-AES256-GCM-SHA384",
-                "certfile": "etc/certs/client-cert.pem",
-                "cacertfile": "etc/certs/cacert.pem",
-                "bridge_mode": true,
-                "address": "127.0.0.1:1883"
-            }
-        },
-        {
-            "type": "bridge_rpc",
-            "id": "rpc",
-            "description": "rpc",
-            "created_at": null,
-            "config": {
-                "reconnect_interval": "30s",
-                "pool_size": 8,
-                "mountpoint": "bridge/emqx/${node}/",
-                "disk_cache": "off",
-                "batch_size": 32,
-                "address": "test@127.0.0.1"
-            }
-        }
-    ],
-    "date": "2021-04-13 13:57:23",
-    "blacklist": [],
-    "auth_username": [],
-    "auth_mnesia": [],
-    "auth_clientid": [],
-    "apps": [
-        {
-            "status": true,
-            "secret": "public",
-            "name": "Default",
-            "id": "admin",
-            "expired": "undefined",
-            "desc": "Application user"
-        }
-    ],
-    "acl_mnesia": []
-}

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 70
apps/emqx_management/test/emqx_bridge_mqtt_data_export_import_SUITE_data/ee410.json


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 70
apps/emqx_management/test/emqx_bridge_mqtt_data_export_import_SUITE_data/ee411.json


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 119
apps/emqx_management/test/emqx_bridge_mqtt_data_export_import_SUITE_data/ee420.json


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 123
apps/emqx_management/test/emqx_bridge_mqtt_data_export_import_SUITE_data/ee425.json


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 123
apps/emqx_management/test/emqx_bridge_mqtt_data_export_import_SUITE_data/ee430.json


+ 0 - 33
apps/emqx_management/test/emqx_mgmt_api_SUITE.erl

@@ -537,39 +537,6 @@ t_stats(_) ->
     ?assertEqual(<<"undefined">>, get(<<"message">>, Return)),
     meck:unload(emqx_mgmt).
 
-t_data(_) ->
-    ok = emqx_rule_registry:mnesia(boot),
-    ok = emqx_dashboard_admin:mnesia(boot),
-    application:ensure_all_started(emqx_rule_engine),
-    application:ensure_all_started(emqx_dashboard),
-    {ok, Data} = request_api(post, api_path(["data","export"]), [], auth_header_(), [#{}]),
-    #{<<"filename">> := Filename, <<"node">> := Node} = emqx_ct_http:get_http_data(Data),
-    {ok, DataList} = request_api(get, api_path(["data","export"]), auth_header_()),
-    ?assertEqual(true, lists:member(emqx_ct_http:get_http_data(Data), emqx_ct_http:get_http_data(DataList))),
-
-    ?assertMatch({ok, _}, request_api(post, api_path(["data","import"]), [], auth_header_(), #{<<"filename">> => Filename, <<"node">> => Node})),
-    ?assertMatch({ok, _}, request_api(post, api_path(["data","import"]), [], auth_header_(), #{<<"filename">> => Filename})),
-    application:stop(emqx_rule_engine),
-    application:stop(emqx_dahboard),
-    ok.
-
-t_data_import_content(_) ->
-    ok = emqx_rule_registry:mnesia(boot),
-    ok = emqx_dashboard_admin:mnesia(boot),
-    application:ensure_all_started(emqx_rule_engine),
-    application:ensure_all_started(emqx_dashboard),
-    {ok, Data} = request_api(post, api_path(["data","export"]), [], auth_header_(), [#{}]),
-    #{<<"filename">> := Filename} = emqx_ct_http:get_http_data(Data),
-    Dir = emqx:get_env(data_dir),
-    {ok, Bin} = file:read_file(filename:join(Dir, Filename)),
-    Content = emqx_json:decode(Bin),
-    %% TODO: enable when 5.0 if we are still using data export/import
-    %?assertMatch({ok, "{\"code\":0}"}, request_api(post, api_path(["data","import"]), [], auth_header_(), Content)),
-    ?assertMatch({ok, "{\"message\":\"5.0\",\"code\":\"unsupported_version\"}"},
-                 request_api(post, api_path(["data","import"]), [], auth_header_(), Content)),
-    application:stop(emqx_rule_engine),
-    application:stop(emqx_dahboard).
-
 request_api(Method, Url, Auth) ->
     request_api(Method, Url, [], Auth, []).
 

+ 0 - 194
apps/emqx_management/test/emqx_webhook_data_export_import_SUITE.erl

@@ -1,194 +0,0 @@
-%%--------------------------------------------------------------------
-%% Copyright (c) 2020-2021 EMQ Technologies Co., Ltd. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%%     http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%--------------------------------------------------------------------
-
--module(emqx_webhook_data_export_import_SUITE).
--include_lib("eunit/include/eunit.hrl").
--include_lib("emqx_rule_engine/include/rule_engine.hrl").
--compile([export_all, nowarn_export_all]).
-
-% -define(EMQX_ENTERPRISE, true).
-
-%%--------------------------------------------------------------------
-%% Setups
-%%--------------------------------------------------------------------
-all() ->
-    emqx_ct:all(?MODULE).
-
-init_per_suite(Cfg) ->
-    application:load(emqx_modules),
-    application:load(emqx_web_hook),
-    emqx_ct_helpers:start_apps([emqx_rule_engine, emqx_management]),
-    ok = emqx_rule_registry:mnesia(boot),
-    ok = emqx_rule_engine:load_providers(),
-    Cfg.
-
-end_per_suite(Cfg) ->
-    emqx_ct_helpers:stop_apps([emqx_management, emqx_rule_engine]),
-    Cfg.
-
-get_data_path() ->
-    emqx_ct_helpers:deps_path(emqx_management, "test/emqx_webhook_data_export_import_SUITE_data/").
-
-remove_resource(Id) ->
-    emqx_rule_registry:remove_resource(Id),
-    emqx_rule_registry:remove_resource_params(Id).
-
-import(FilePath, Version) ->
-    ok = emqx_mgmt_data_backup:import(get_data_path() ++ "/" ++ FilePath, <<"{}">>),
-    lists:foreach(fun(#resource{id = Id, config = Config} = _Resource) ->
-        case Id of
-            <<"webhook">> ->
-                test_utils:resource_is_alive(Id),
-                handle_config(Config, Version),
-                remove_resource(Id);
-            _ -> ok
-        end
-    end, emqx_rule_registry:get_resources()).
-
-%%--------------------------------------------------------------------
-%% Cases
-%%--------------------------------------------------------------------
--ifdef(EMQX_ENTERPRISE).
-
-t_importee4010(_) ->
-    import("ee4010.json", ee4010),
-    {ok, _} = emqx_mgmt_data_backup:export().
-
-t_importee410(_) ->
-    import("ee410.json", ee410),
-    {ok, _} = emqx_mgmt_data_backup:export().
-
-t_importee411(_) ->
-    import("ee411.json", ee411),
-    {ok, _} = emqx_mgmt_data_backup:export().
-
-t_importee420(_) ->
-    import("ee420.json", ee420),
-    {ok, _} = emqx_mgmt_data_backup:export().
-
-t_importee425(_) ->
-    import("ee425.json", ee425),
-    {ok, _} = emqx_mgmt_data_backup:export().
-
-t_importee430(_) ->
-    import("ee430.json", ee430),
-    {ok, _} = emqx_mgmt_data_backup:export().
-
-%%--------------------------------------------------------------------
-%% handle_config
-%%--------------------------------------------------------------------
-handle_config(Config, 409) ->
-    handle_config(Config, 422);
-
-handle_config(Config, 415) ->
-    handle_config(Config, 422);
-
-handle_config(Config, 422) ->
-    ?assertEqual(<<"http://www.emqx.io">>, maps:get(<<"url">>, Config)),
-    ?assertEqual(<<"POST">>, maps:get(<<"method">>, Config)),
-    ?assertEqual(#{"k" => "v"}, maps:get(<<"headers">>, Config));
-
-handle_config(Config, 423) ->
-    ?assertEqual(<<"http://www.emqx.io">>, maps:get(<<"url">>, Config)),
-    ?assertEqual(<<"POST">>, maps:get(<<"method">>, Config)),
-    ?assertEqual("application/json", maps:get(<<"content_type">>, Config)),
-    ?assertEqual(#{"k" => "v"}, maps:get(<<"headers">>, Config));
-
-handle_config(Config, 425) ->
-    ?assertEqual(<<"http://www.emqx.io">>, maps:get(<<"url">>, Config)),
-    ?assertEqual(<<"POST">>, maps:get(<<"method">>, Config)),
-    ?assertEqual(#{"k" => "v"}, maps:get(<<"headers">>, Config)),
-    ?assertEqual(5, maps:get(<<"connect_timeout">>, Config)),
-    ?assertEqual(5, maps:get(<<"request_timeout">>, Config)),
-    ?assertEqual(8, maps:get(<<"pool_size">>, Config));
-
-handle_config(Config, 430) ->
-    ?assertEqual(<<"http://www.emqx.io">>, maps:get(<<"url">>, Config)),
-    ?assertEqual(<<"POST">>, maps:get(<<"method">>, Config)),
-    ?assertEqual(#{"k" => "v"}, maps:get(<<"headers">>, Config)),
-    ?assertEqual("5s", maps:get(<<"connect_timeout">>, Config)),
-    ?assertEqual("5s", maps:get(<<"request_timeout">>, Config)),
-    ?assertEqual(false, maps:get(<<"verify">>, Config)),
-    ?assertEqual(true, is_map(maps:get(<<"cacertfile">>, Config))),
-    ?assertEqual(true, is_map(maps:get(<<"certfile">>, Config))),
-    ?assertEqual(true, is_map(maps:get(<<"keyfile">>, Config))),
-    ?assertEqual(8, maps:get(<<"pool_size">>, Config));
-handle_config(_, _) -> ok.
--endif.
-
--ifndef(EMQX_ENTERPRISE).
-
-t_import422(_) ->
-    import("422.json", 422),
-    {ok, _} = emqx_mgmt_data_backup:export().
-
-t_import423(_) ->
-    import("423.json", 423),
-    {ok, _} = emqx_mgmt_data_backup:export().
-
-t_import425(_) ->
-    import("425.json", 425),
-    {ok, _} = emqx_mgmt_data_backup:export().
-
-t_import430(_) ->
-    import("430.json", 430),
-    {ok, _} = emqx_mgmt_data_backup:export().
-
-t_import409(_) ->
-    import("409.json", 409),
-    {ok, _} = emqx_mgmt_data_backup:export().
-
-t_import415(_) ->
-    import("415.json", 415),
-    {ok, _} = emqx_mgmt_data_backup:export().
-
-%%--------------------------------------------------------------------
-%% handle_config
-%%--------------------------------------------------------------------
-
-handle_config(Config, ee4010) ->
-    ?assertEqual(<<"http://www.emqx.io">>, maps:get(<<"url">>, Config));
-
-handle_config(Config, ee410) ->
-    ?assertEqual(<<"http://www.emqx.io">>, maps:get(<<"url">>, Config));
-
-handle_config(Config, ee411) ->
-    ?assertEqual(<<"http://www.emqx.io">>, maps:get(<<"url">>, Config));
-
-handle_config(Config, ee420) ->
-    ?assertEqual(<<"http://www.emqx.io">>, maps:get(<<"url">>, Config));
-
-handle_config(Config, ee425) ->
-    ?assertEqual(<<"http://www.emqx.io">>, maps:get(<<"url">>, Config)),
-    ?assertEqual(<<"5s">>, maps:get(<<"connect_timeout">>, Config)),
-    ?assertEqual(<<"5s">>, maps:get(<<"request_timeout">>, Config)),
-    ?assertEqual(false, maps:get(<<"verify">>, Config)),
-    ?assertEqual(8, maps:get(<<"pool_size">>, Config));
-
-handle_config(Config, ee435) ->
-    handle_config(Config, ee430);
-
-handle_config(Config, ee430) ->
-    ?assertEqual(<<"http://www.emqx.io">>, maps:get(<<"url">>, Config)),
-    ?assertEqual(<<"5s">>, maps:get(<<"connect_timeout">>, Config)),
-    ?assertEqual(<<"5s">>, maps:get(<<"request_timeout">>, Config)),
-    ?assertEqual(false, maps:get(<<"verify">>, Config)),
-    ?assertEqual(8, maps:get(<<"pool_size">>, Config));
-
-handle_config(Config, _) ->
-    io:format("|>=> :~p~n", [Config]).
-
--endif.

+ 0 - 43
apps/emqx_management/test/emqx_webhook_data_export_import_SUITE_data/409.json

@@ -1,43 +0,0 @@
-{
-    "version": "4.0",
-    "users": [
-        {
-            "username": "admin",
-            "tags": "administrator",
-            "password": "m/GtjNgri9GILklefVJH8BeTnNE="
-        }
-    ],
-    "schemas": [],
-    "rules": [],
-    "resources": [
-        {
-            "type": "web_hook",
-            "id": "webhook",
-            "description": "webhook",
-            "created_at": null,
-            "config": {
-                "headers": {
-                    "k": "v"
-                },
-                "method": "POST",
-                "url": "http://www.emqx.io"
-            }
-        }
-    ],
-    "date": "2021-03-30 13:38:39",
-    "blacklist": [],
-    "auth_username": [],
-    "auth_mnesia": [],
-    "auth_clientid": [],
-    "apps": [
-        {
-            "status": true,
-            "secret": "public",
-            "name": "Default",
-            "id": "admin",
-            "expired": "undefined",
-            "desc": "Application user"
-        }
-    ],
-    "acl_mnesia": []
-}

+ 0 - 42
apps/emqx_management/test/emqx_webhook_data_export_import_SUITE_data/415.json

@@ -1,42 +0,0 @@
-{
-    "version": "4.1",
-    "users": [
-        {
-            "username": "admin",
-            "tags": "administrator",
-            "password": "3W+nHOkCZLFspENkIvHKzCbHxHI="
-        }
-    ],
-    "schemas": [],
-    "rules": [],
-    "resources": [
-        {
-            "type": "web_hook",
-            "id": "webhook",
-            "description": "webhook",
-            "created_at": null,
-            "config": {
-                "url": "http://www.emqx.io",
-                "method": "POST",
-                "headers": {
-                    "k": "v"
-                }
-            }
-        }
-    ],
-    "date": "2021-03-30 13:52:53",
-    "blacklist": [],
-    "auth_username": [],
-    "auth_clientid": [],
-    "apps": [
-        {
-            "status": true,
-            "secret": "public",
-            "name": "Default",
-            "id": "admin",
-            "expired": "undefined",
-            "desc": "Application user"
-        }
-    ],
-    "acl_mnesia": []
-}

+ 0 - 43
apps/emqx_management/test/emqx_webhook_data_export_import_SUITE_data/422.json

@@ -1,43 +0,0 @@
-{
-    "version": "4.2",
-    "date": "2021-03-23 23:22:30",
-    "rules": [],
-    "resources": [
-        {
-            "id": "webhook",
-            "type": "web_hook",
-            "config": {
-                "headers": {
-                    "k": "v"
-                },
-                "method": "POST",
-                "url": "http://www.emqx.io"
-            },
-            "created_at": null,
-            "description": "webhook"
-        }
-    ],
-    "blacklist": [],
-    "apps": [
-        {
-            "id": "admin",
-            "secret": "public",
-            "name": "Default",
-            "desc": "Application user",
-            "status": true,
-            "expired": "undefined"
-        }
-    ],
-    "users": [
-        {
-            "username": "admin",
-            "password": "mOTRLWt85F7GW+CSiBuRUZiRANw=",
-            "tags": "administrator"
-        }
-    ],
-    "auth_clientid": [],
-    "auth_username": [],
-    "auth_mnesia": [],
-    "acl_mnesia": [],
-    "schemas": []
-}

+ 0 - 44
apps/emqx_management/test/emqx_webhook_data_export_import_SUITE_data/423.json

@@ -1,44 +0,0 @@
-{
-    "version": "4.2",
-    "date": "2021-03-23 23:29:24",
-    "rules": [],
-    "resources": [
-        {
-            "id": "webhook",
-            "type": "web_hook",
-            "config": {
-                "headers": {
-                    "k": "v"
-                },
-                "method": "POST",
-                "url": "http://www.emqx.io"
-            },
-            "content_type": "application/json",
-            "created_at": null,
-            "description": "webhook"
-        }
-    ],
-    "blacklist": [],
-    "apps": [
-        {
-            "id": "admin",
-            "secret": "public",
-            "name": "Default",
-            "desc": "Application user",
-            "status": true,
-            "expired": "undefined"
-        }
-    ],
-    "users": [
-        {
-            "username": "admin",
-            "password": "mOTRLWt85F7GW+CSiBuRUZiRANw=",
-            "tags": "administrator"
-        }
-    ],
-    "auth_clientid": [],
-    "auth_username": [],
-    "auth_mnesia": [],
-    "acl_mnesia": [],
-    "schemas": []
-}

+ 0 - 47
apps/emqx_management/test/emqx_webhook_data_export_import_SUITE_data/425.json

@@ -1,47 +0,0 @@
-{
-    "version": "4.2",
-    "date": "2021-03-24 14:51:22",
-    "rules": [],
-    "resources": [
-        {
-            "id": "webhook",
-            "type": "web_hook",
-            "config": {
-                "headers": {
-                    "k": "v"
-                },
-                "method": "POST",
-                "url": "http://www.emqx.io"
-            },
-            "content_type": "application/json",
-            "connect_timeout" : 5,
-            "request_timeout" : 5,
-            "pool_size" : 8,
-            "created_at": null,
-            "description": "webhook"
-        }
-    ],
-    "blacklist": [],
-    "apps": [
-        {
-            "id": "admin",
-            "secret": "public",
-            "name": "Default",
-            "desc": "Application user",
-            "status": true,
-            "expired": "undefined"
-        }
-    ],
-    "users": [
-        {
-            "username": "admin",
-            "password": "mOTRLWt85F7GW+CSiBuRUZiRANw=",
-            "tags": "administrator"
-        }
-    ],
-    "auth_clientid": [],
-    "auth_username": [],
-    "auth_mnesia": [],
-    "acl_mnesia": [],
-    "schemas": []
-}

+ 0 - 52
apps/emqx_management/test/emqx_webhook_data_export_import_SUITE_data/430.json

@@ -1,52 +0,0 @@
-{
-    "version": "4.3",
-    "rules": [],
-    "resources": [
-        {
-            "id": "webhook",
-            "type": "web_hook",
-            "config": {
-                "cacertfile": {
-                    "filename": "",
-                    "file": ""
-                },
-                "certfile": {
-                    "filename": "",
-                    "file": ""
-                },
-                "keyfile": {
-                    "filename": "",
-                    "file": ""
-                },
-                "connect_timeout": "5s",
-                "pool_size": 8,
-                "request_timeout": "5s",
-                "url": "http://www.emqx.io",
-                "verify": false
-            },
-            "created_at": 1616581851001,
-            "description": "webhook"
-        }
-    ],
-    "blacklist": [],
-    "apps": [
-        {
-            "id": "admin",
-            "secret": "public",
-            "name": "Default",
-            "desc": "Application user",
-            "status": true,
-            "expired": "undefined"
-        }
-    ],
-    "users": [
-        {
-            "username": "admin",
-            "password": "q8v7hISIMz+iKn/ZuAaogvAxKbA=",
-            "tags": "administrator"
-        }
-    ],
-    "auth_mnesia": [],
-    "acl_mnesia": [],
-    "date": "2021-03-24 18:31:21"
-}

+ 0 - 43
apps/emqx_management/test/emqx_webhook_data_export_import_SUITE_data/ee4010.json

@@ -1,43 +0,0 @@
-{
-    "version": "4.0",
-    "users": [
-        {
-            "username": "admin",
-            "tags": "administrator",
-            "password": "GCX5nvOMK0hbiMB4AUyc25wI8fU="
-        }
-    ],
-    "schemas": [],
-    "rules": [],
-    "resources": [
-        {
-            "type": "web_hook",
-            "id": "web_hook",
-            "description": "webhook",
-            "created_at": null,
-            "config": {
-                "url": "http://www.emqx.io",
-                "method": "POST",
-                "headers": {
-                    "k": "v"
-                }
-            }
-        }
-    ],
-    "date": "2021-04-13 13:57:23",
-    "blacklist": [],
-    "auth_username": [],
-    "auth_mnesia": [],
-    "auth_clientid": [],
-    "apps": [
-        {
-            "status": true,
-            "secret": "public",
-            "name": "Default",
-            "id": "admin",
-            "expired": "undefined",
-            "desc": "Application user"
-        }
-    ],
-    "acl_mnesia": []
-}

+ 0 - 43
apps/emqx_management/test/emqx_webhook_data_export_import_SUITE_data/ee410.json

@@ -1,43 +0,0 @@
-{
-    "version": "4.1",
-    "users": [
-        {
-            "username": "admin",
-            "tags": "administrator",
-            "password": "atdwlByxL9/9P3CoFJ60drhodkY="
-        }
-    ],
-    "schemas": [],
-    "rules": [],
-    "resources": [
-        {
-            "type": "web_hook",
-            "id": "webhook",
-            "description": "webhook",
-            "created_at": null,
-            "config": {
-                "url": "http://www.emqx.io",
-                "method": "POST",
-                "headers": {
-                    "k": "v"
-                }
-            }
-        }
-    ],
-    "date": "2021-04-13 11:30:21",
-    "blacklist": [],
-    "auth_username": [],
-    "auth_mnesia": [],
-    "auth_clientid": [],
-    "apps": [
-        {
-            "status": true,
-            "secret": "public",
-            "name": "Default",
-            "id": "admin",
-            "expired": "undefined",
-            "desc": "Application user"
-        }
-    ],
-    "acl_mnesia": []
-}

+ 0 - 43
apps/emqx_management/test/emqx_webhook_data_export_import_SUITE_data/ee411.json

@@ -1,43 +0,0 @@
-{
-    "version": "4.1",
-    "users": [
-        {
-            "username": "admin",
-            "tags": "administrator",
-            "password": "tsYtP3TylchkM7J7YTc46Di0kPk="
-        }
-    ],
-    "schemas": [],
-    "rules": [],
-    "resources": [
-        {
-            "type": "web_hook",
-            "id": "web_hook",
-            "description": "webhook",
-            "created_at": null,
-            "config": {
-                "url": "http://www.emqx.io",
-                "method": "POST",
-                "headers": {
-                    "k": "v"
-                }
-            }
-        }
-    ],
-    "date": "2021-04-13 16:37:18",
-    "blacklist": [],
-    "auth_username": [],
-    "auth_mnesia": [],
-    "auth_clientid": [],
-    "apps": [
-        {
-            "status": true,
-            "secret": "public",
-            "name": "Default",
-            "id": "admin",
-            "expired": "undefined",
-            "desc": "Application user"
-        }
-    ],
-    "acl_mnesia": []
-}

+ 0 - 92
apps/emqx_management/test/emqx_webhook_data_export_import_SUITE_data/ee420.json

@@ -1,92 +0,0 @@
-{
-    "version": "4.2",
-    "date": "2021-04-13 11:35:13",
-    "modules": [
-        {
-            "id": "module:b9294d70",
-            "type": "recon",
-            "config": {},
-            "enabled": true,
-            "created_at": "undefined",
-            "description": ""
-        },
-        {
-            "id": "module:c7c7b692",
-            "type": "presence",
-            "config": {
-                "qos": 0
-            },
-            "enabled": true,
-            "created_at": "undefined",
-            "description": ""
-        },
-        {
-            "id": "module:486adc4b",
-            "type": "internal_acl",
-            "config": {
-                "acl_rule_file": "etc/acl.conf"
-            },
-            "enabled": true,
-            "created_at": "undefined",
-            "description": ""
-        },
-        {
-            "id": "module:411cf85d",
-            "type": "retainer",
-            "config": {
-                "storage_type": "ram",
-                "max_retained_messages": 0,
-                "max_payload_size": "1MB",
-                "expiry_interval": 0
-            },
-            "enabled": true,
-            "created_at": "undefined",
-            "description": ""
-        },
-        {
-            "id": "module:127b92c3",
-            "type": "hot_confs",
-            "config": {},
-            "enabled": true,
-            "created_at": "undefined",
-            "description": ""
-        }
-    ],
-    "rules": [],
-    "resources": [
-        {
-            "id": "webhook",
-            "type": "web_hook",
-            "config": {
-                "headers": {
-                    "k": "v"
-                },
-                "method": "POST",
-                "url": "http://www.emqx.io"
-            },
-            "created_at": null,
-            "description": "webhook"
-        }
-    ],
-    "blacklist": [],
-    "apps": [
-        {
-            "id": "admin",
-            "secret": "public",
-            "name": "Default",
-            "desc": "Application user",
-            "status": true,
-            "expired": "undefined"
-        }
-    ],
-    "users": [
-        {
-            "username": "admin",
-            "password": "bx1P63qGDhKvZYdltxX4NVY2kS4=",
-            "tags": "administrator"
-        }
-    ],
-    "auth_mnesia": [],
-    "acl_mnesia": [],
-    "schemas": []
-}

+ 0 - 102
apps/emqx_management/test/emqx_webhook_data_export_import_SUITE_data/ee425.json

@@ -1,102 +0,0 @@
-{
-    "version": "4.2",
-    "date": "2021-04-13 16:42:34",
-    "modules": [
-        {
-            "id": "module:3dc04a9c",
-            "type": "retainer",
-            "config": {
-                "storage_type": "ram",
-                "max_retained_messages": 0,
-                "max_payload_size": "1MB",
-                "expiry_interval": 0
-            },
-            "enabled": true,
-            "created_at": "undefined",
-            "description": ""
-        },
-        {
-            "id": "module:5128901f",
-            "type": "recon",
-            "config": {},
-            "enabled": true,
-            "created_at": "undefined",
-            "description": ""
-        },
-        {
-            "id": "module:9d1596c8",
-            "type": "presence",
-            "config": {
-                "qos": 0
-            },
-            "enabled": true,
-            "created_at": "undefined",
-            "description": ""
-        },
-        {
-            "id": "module:43d43410",
-            "type": "internal_acl",
-            "config": {
-                "acl_rule_file": "etc/acl.conf"
-            },
-            "enabled": true,
-            "created_at": "undefined",
-            "description": ""
-        }
-    ],
-    "rules": [],
-    "resources": [
-        {
-            "id": "webhook",
-            "type": "web_hook",
-            "config": {
-                "cacertfile": {
-                    "filename": "",
-                    "file": ""
-                },
-                "certfile": {
-                    "filename": "",
-                    "file": ""
-                },
-                "connect_timeout": "5s",
-                "headers": {
-                    "k": "v"
-                },
-                "keyfile": {
-                    "filename": "",
-                    "file": ""
-                },
-                "method": "POST",
-                "pool_size": 8,
-                "request_timeout": "5s",
-                "url": "http://www.emqx.io",
-                "verify": false
-            },
-            "created_at": null,
-            "description": "webhook"
-        }
-    ],
-    "blacklist": [],
-    "apps": [
-        {
-            "id": "admin",
-            "secret": "public",
-            "name": "Default",
-            "desc": "Application user",
-            "status": true,
-            "expired": "undefined"
-        }
-    ],
-    "users": [
-        {
-            "username": "admin",
-            "password": "Hd8AMmbFs+LsqQXQxaV/WqLoGEk=",
-            "tags": "administrator"
-        }
-    ],
-    "auth_mnesia": [],
-    "acl_mnesia": [],
-    "schemas": [],
-    "configs": [],
-    "listeners_state": []
-}

+ 0 - 98
apps/emqx_management/test/emqx_webhook_data_export_import_SUITE_data/ee430.json

@@ -1,98 +0,0 @@
-{
-    "version": "4.3",
-    "rules": [],
-    "resources": [
-        {
-            "id": "webhook",
-            "type": "web_hook",
-            "config": {
-                "cacertfile": {
-                    "filename": "",
-                    "file": ""
-                },
-                "certfile": {
-                    "filename": "",
-                    "file": ""
-                },
-                "connect_timeout": "5s",
-                "keyfile": {
-                    "filename": "",
-                    "file": ""
-                },
-                "pool_size": 8,
-                "request_timeout": "5s",
-                "url": "http://www.emqx.io",
-                "verify": false
-            },
-            "created_at": 1618304340172,
-            "description": "webhook"
-        }
-    ],
-    "blacklist": [],
-    "apps": [
-        {
-            "id": "admin",
-            "secret": "public",
-            "name": "Default",
-            "desc": "Application user",
-            "status": true,
-            "expired": "undefined"
-        }
-    ],
-    "users": [
-        {
-            "username": "admin",
-            "password": "qq8hg9pOkmYiHqzi3+bcUaK2CGA=",
-            "tags": "administrator"
-        }
-    ],
-    "auth_mnesia": [],
-    "acl_mnesia": [],
-    "modules": [
-        {
-            "id": "module:aabeddbf",
-            "type": "recon",
-            "config": {},
-            "enabled": true,
-            "created_at": 1618304311061,
-            "description": ""
-        },
-        {
-            "id": "module:cbe6d976",
-            "type": "internal_acl",
-            "config": {
-                "acl_rule_file": "etc/acl.conf"
-            },
-            "enabled": true,
-            "created_at": 1618304311061,
-            "description": ""
-        },
-        {
-            "id": "module:46375e06",
-            "type": "retainer",
-            "config": {
-                "storage_type": "ram",
-                "max_retained_messages": 0,
-                "max_payload_size": "1MB",
-                "expiry_interval": 0
-            },
-            "enabled": true,
-            "created_at": 1618304311061,
-            "description": ""
-        },
-        {
-            "id": "module:091eb7c3",
-            "type": "presence",
-            "config": {
-                "qos": 0
-            },
-            "enabled": true,
-            "created_at": 1618304311061,
-            "description": ""
-        }
-    ],
-    "schemas": [],
-    "configs": [],
-    "listeners_state": [],
-    "date": "2021-04-13 17:59:52"
-}