浏览代码

fix(ft): fix config update tests

Ilya Averyanov 2 年之前
父节点
当前提交
7bcb60a84a
共有 2 个文件被更改,包括 29 次插入1 次删除
  1. 7 0
      apps/emqx_ft/etc/emqx_ft.conf
  2. 22 1
      apps/emqx_ft/test/emqx_ft_conf_SUITE.erl

+ 7 - 0
apps/emqx_ft/etc/emqx_ft.conf

@@ -1,7 +1,14 @@
 file_transfer {
     storage {
         type = local
+        segments {
+            root = "{{ platform_data_dir }}/file_transfer/segments"
+            gc {
+                interval = 60000
+            }
+        }
         exporter {
+            root = "{{ platform_data_dir }}/file_transfer/exports"
             type = local
         }
     }

+ 22 - 1
apps/emqx_ft/test/emqx_ft_conf_SUITE.erl

@@ -25,10 +25,31 @@
 all() -> emqx_common_test_helpers:all(?MODULE).
 
 init_per_suite(Config) ->
-    ok = emqx_common_test_helpers:start_apps([emqx_conf, emqx_ft]),
+    _ = emqx_config:save_schema_mod_and_names(emqx_ft_schema),
+    ok = emqx_common_test_helpers:start_apps([emqx_conf, emqx_ft], fun set_special_config/1),
     {ok, _} = emqx:update_config([rpc, port_discovery], manual),
     Config.
 
+set_special_config(emqx_ft) ->
+    emqx_config:put(
+        [file_transfer],
+        #{
+            storage => #{
+                type => local,
+                segments => #{
+                    gc => #{
+                        interval => 60000
+                    }
+                },
+                exporter => #{
+                    type => local
+                }
+            }
+        }
+    );
+set_special_config(_) ->
+    ok.
+
 end_per_suite(_Config) ->
     ok = emqx_common_test_helpers:stop_apps([emqx_ft, emqx_conf]),
     ok.