|
|
@@ -88,25 +88,30 @@ t_empty_export_import(_Config) ->
|
|
|
?assertEqual(ExpRawConf, emqx:get_raw_config([])).
|
|
|
|
|
|
t_cluster_hocon_import_mqtt_subscribers_retainer_messages(Config) ->
|
|
|
- FNameEmqx44 = "emqx-export-4.4.24-retainer-mqttsub.tar.gz",
|
|
|
- BackupFile = filename:join(?config(data_dir, Config), FNameEmqx44),
|
|
|
- Exp = {ok, #{db_errors => #{}, config_errors => #{}}},
|
|
|
- ?assertEqual(Exp, emqx_mgmt_data_backup:import(BackupFile)),
|
|
|
- RawConfAfterImport = emqx:get_raw_config([]),
|
|
|
- %% verify that MQTT sources are imported
|
|
|
- ?assertMatch(
|
|
|
- #{<<"sources">> := #{<<"mqtt">> := Sources}} when map_size(Sources) > 0,
|
|
|
- RawConfAfterImport
|
|
|
- ),
|
|
|
- %% verify that retainer messages are imported
|
|
|
- ?assertMatch(
|
|
|
- {ok, [#message{payload = <<"test-payload">>}]},
|
|
|
- emqx_retainer:read_message(<<"test-retained-message/1">>)
|
|
|
- ),
|
|
|
- %% Export and import again
|
|
|
- {ok, #{filename := FileName}} = emqx_mgmt_data_backup:export(),
|
|
|
- ?assertEqual(Exp, emqx_mgmt_data_backup:import(FileName)),
|
|
|
- ?assertEqual(RawConfAfterImport, emqx:get_raw_config([])),
|
|
|
+ case emqx_release:edition() of
|
|
|
+ ce ->
|
|
|
+ ok;
|
|
|
+ ee ->
|
|
|
+ FNameEmqx44 = "emqx-export-4.4.24-retainer-mqttsub.tar.gz",
|
|
|
+ BackupFile = filename:join(?config(data_dir, Config), FNameEmqx44),
|
|
|
+ Exp = {ok, #{db_errors => #{}, config_errors => #{}}},
|
|
|
+ ?assertEqual(Exp, emqx_mgmt_data_backup:import(BackupFile)),
|
|
|
+ RawConfAfterImport = emqx:get_raw_config([]),
|
|
|
+ %% verify that MQTT sources are imported
|
|
|
+ ?assertMatch(
|
|
|
+ #{<<"sources">> := #{<<"mqtt">> := Sources}} when map_size(Sources) > 0,
|
|
|
+ RawConfAfterImport
|
|
|
+ ),
|
|
|
+ %% verify that retainer messages are imported
|
|
|
+ ?assertMatch(
|
|
|
+ {ok, [#message{payload = <<"test-payload">>}]},
|
|
|
+ emqx_retainer:read_message(<<"test-retained-message/1">>)
|
|
|
+ ),
|
|
|
+ %% Export and import again
|
|
|
+ {ok, #{filename := FileName}} = emqx_mgmt_data_backup:export(),
|
|
|
+ ?assertEqual(Exp, emqx_mgmt_data_backup:import(FileName)),
|
|
|
+ ?assertEqual(RawConfAfterImport, emqx:get_raw_config([]))
|
|
|
+ end,
|
|
|
ok.
|
|
|
|
|
|
t_cluster_hocon_export_import(Config) ->
|