|
|
@@ -36,10 +36,7 @@ init_per_suite(Config) ->
|
|
|
Apps = emqx_cth_suite:start(
|
|
|
[
|
|
|
{emqx_conf, ?CONF_DEFAULT},
|
|
|
- emqx_gateway,
|
|
|
- emqx_auth,
|
|
|
- emqx_auth_redis,
|
|
|
- emqx_auth_mnesia
|
|
|
+ emqx_gateway
|
|
|
],
|
|
|
#{work_dir => emqx_cth_suite:work_dir(Config)}
|
|
|
),
|
|
|
@@ -50,25 +47,6 @@ end_per_suite(Config) ->
|
|
|
emqx_config:delete_override_conf_files(),
|
|
|
ok.
|
|
|
|
|
|
-init_per_testcase(t_get_basic_usage_info_2, Config) ->
|
|
|
- DataDir = ?config(data_dir, Config),
|
|
|
- application:stop(emqx_gateway),
|
|
|
- ok = setup_fake_usage_data(DataDir),
|
|
|
- Config;
|
|
|
-init_per_testcase(_TestCase, Config) ->
|
|
|
- Config.
|
|
|
-
|
|
|
-end_per_testcase(t_get_basic_usage_info_2, _Config) ->
|
|
|
- emqx_gateway_cm:unregister_channel(lwm2m, <<"client_id">>),
|
|
|
- emqx_config:put([gateway], #{}),
|
|
|
- emqx_common_test_helpers:stop_apps([emqx_gateway]),
|
|
|
- emqx_config:erase(gateway),
|
|
|
- emqx_common_test_helpers:load_config(emqx_gateway_schema, ?CONF_DEFAULT),
|
|
|
- emqx_common_test_helpers:start_apps([emqx_gateway]),
|
|
|
- ok;
|
|
|
-end_per_testcase(_TestCase, _Config) ->
|
|
|
- ok.
|
|
|
-
|
|
|
%%--------------------------------------------------------------------
|
|
|
%% cases
|
|
|
%%--------------------------------------------------------------------
|
|
|
@@ -160,27 +138,8 @@ t_get_basic_usage_info_1(_Config) ->
|
|
|
}
|
|
|
},
|
|
|
emqx_gateway:get_basic_usage_info()
|
|
|
- ).
|
|
|
-
|
|
|
-t_get_basic_usage_info_2(_Config) ->
|
|
|
- ?assertEqual(
|
|
|
- #{
|
|
|
- lwm2m =>
|
|
|
- #{
|
|
|
- authn => <<"password_based:redis">>,
|
|
|
- listeners =>
|
|
|
- [
|
|
|
- #{
|
|
|
- authn =>
|
|
|
- <<"password_based:built_in_database">>,
|
|
|
- type => udp
|
|
|
- }
|
|
|
- ],
|
|
|
- num_clients => 1
|
|
|
- }
|
|
|
- },
|
|
|
- emqx_gateway:get_basic_usage_info()
|
|
|
- ).
|
|
|
+ ),
|
|
|
+ ok = emqx_gateway:unload(?GWNAME).
|
|
|
|
|
|
%%--------------------------------------------------------------------
|
|
|
%% helper functions
|