1cb7eb8c9Sopenharmony_ci# Copyright (C) 2023-2024 Huawei Device Co., Ltd.
2cb7eb8c9Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
3cb7eb8c9Sopenharmony_ci# you may not use this file except in compliance with the License.
4cb7eb8c9Sopenharmony_ci# You may obtain a copy of the License at
5cb7eb8c9Sopenharmony_ci#
6cb7eb8c9Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
7cb7eb8c9Sopenharmony_ci#
8cb7eb8c9Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
9cb7eb8c9Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
10cb7eb8c9Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11cb7eb8c9Sopenharmony_ci# See the License for the specific language governing permissions and
12cb7eb8c9Sopenharmony_ci# limitations under the License.
13cb7eb8c9Sopenharmony_ci
14cb7eb8c9Sopenharmony_ciimport("//build/test.gni")
15cb7eb8c9Sopenharmony_ciimport("//foundation/filemanagement/dfs_service/distributedfile.gni")
16cb7eb8c9Sopenharmony_ci
17cb7eb8c9Sopenharmony_ciohos_unittest("fuse_manager_test") {
18cb7eb8c9Sopenharmony_ci  module_out_path = "filemanagement/dfs_service"
19cb7eb8c9Sopenharmony_ci
20cb7eb8c9Sopenharmony_ci  sources = [
21cb7eb8c9Sopenharmony_ci    "${distributedfile_path}/services/cloudfiledaemon/src/fuse_manager/cloud_daemon_statistic.cpp",
22cb7eb8c9Sopenharmony_ci    "${distributedfile_path}/services/cloudfiledaemon/src/fuse_manager/fuse_manager.cpp",
23cb7eb8c9Sopenharmony_ci    "fuse_manager_test.cpp",
24cb7eb8c9Sopenharmony_ci  ]
25cb7eb8c9Sopenharmony_ci
26cb7eb8c9Sopenharmony_ci  cloud_disk = [
27cb7eb8c9Sopenharmony_ci    "${services_path}/cloudfiledaemon/src/cloud_disk/database_manager.cpp",
28cb7eb8c9Sopenharmony_ci    "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_base.cpp",
29cb7eb8c9Sopenharmony_ci    "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_cloud.cpp",
30cb7eb8c9Sopenharmony_ci    "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_local.cpp",
31cb7eb8c9Sopenharmony_ci    "${services_path}/cloudfiledaemon/src/cloud_disk/fuse_operations.cpp",
32cb7eb8c9Sopenharmony_ci  ]
33cb7eb8c9Sopenharmony_ci
34cb7eb8c9Sopenharmony_ci  sources += cloud_disk
35cb7eb8c9Sopenharmony_ci
36cb7eb8c9Sopenharmony_ci  include_dirs = [
37cb7eb8c9Sopenharmony_ci    "../../../../../communication/ipc/interfaces/innerkits/ipc_core/include",
38cb7eb8c9Sopenharmony_ci    "${distributedfile_path}/services/cloudfiledaemon/include",
39cb7eb8c9Sopenharmony_ci    "${distributedfile_path}/services/cloudfiledaemon/include/fuse_manager",
40cb7eb8c9Sopenharmony_ci    "${services_path}/cloudfiledaemon/include/cloud_disk/",
41cb7eb8c9Sopenharmony_ci    "${distributedfile_path}/adapter/cloud_adapter_example/include",
42cb7eb8c9Sopenharmony_ci    "${clouddisk_database_path}/include",
43cb7eb8c9Sopenharmony_ci    "${media_library_path}/frameworks/innerkitsimpl/media_library_helper/include",
44cb7eb8c9Sopenharmony_ci    "${media_library_path}/interfaces/inner_api/media_library_helper/include",
45cb7eb8c9Sopenharmony_ci    "${media_library_path}/frameworks/utils/include",
46cb7eb8c9Sopenharmony_ci  ]
47cb7eb8c9Sopenharmony_ci
48cb7eb8c9Sopenharmony_ci  deps = [
49cb7eb8c9Sopenharmony_ci    "${clouddisk_database_path}:clouddisk_database",
50cb7eb8c9Sopenharmony_ci    "${innerkits_native_path}/cloud_daemon_kit_inner:cloud_daemon_kit_inner",
51cb7eb8c9Sopenharmony_ci    "${innerkits_native_path}/cloud_file_kit_inner:cloudfile_kit",
52cb7eb8c9Sopenharmony_ci    "${utils_path}:libdistributedfiledentry",
53cb7eb8c9Sopenharmony_ci    "${utils_path}:libdistributedfileutils",
54cb7eb8c9Sopenharmony_ci    "//third_party/googletest:gmock_main",
55cb7eb8c9Sopenharmony_ci    "//third_party/googletest:gtest_main",
56cb7eb8c9Sopenharmony_ci  ]
57cb7eb8c9Sopenharmony_ci
58cb7eb8c9Sopenharmony_ci  external_deps = [
59cb7eb8c9Sopenharmony_ci    "ability_base:zuri",
60cb7eb8c9Sopenharmony_ci    "ability_runtime:dataobs_manager",
61cb7eb8c9Sopenharmony_ci    "c_utils:utils",
62cb7eb8c9Sopenharmony_ci    "ffrt:libffrt",
63cb7eb8c9Sopenharmony_ci    "hilog:libhilog",
64cb7eb8c9Sopenharmony_ci    "hisysevent:libhisysevent",
65cb7eb8c9Sopenharmony_ci    "hitrace:hitrace_meter",
66cb7eb8c9Sopenharmony_ci    "init:libbegetutil",
67cb7eb8c9Sopenharmony_ci    "ipc:ipc_single",
68cb7eb8c9Sopenharmony_ci    "libfuse:libfuse",
69cb7eb8c9Sopenharmony_ci    "relational_store:native_rdb",
70cb7eb8c9Sopenharmony_ci  ]
71cb7eb8c9Sopenharmony_ci
72cb7eb8c9Sopenharmony_ci  defines = [
73cb7eb8c9Sopenharmony_ci    "private=public",
74cb7eb8c9Sopenharmony_ci    "LOG_DOMAIN=0xD004308",
75cb7eb8c9Sopenharmony_ci    "LOG_TAG=\"CloudFileDaemon\"",
76cb7eb8c9Sopenharmony_ci  ]
77cb7eb8c9Sopenharmony_ci
78cb7eb8c9Sopenharmony_ci  if (cloudsync_service_hicollie_enable) {
79cb7eb8c9Sopenharmony_ci    external_deps += [ "hicollie:libhicollie" ]
80cb7eb8c9Sopenharmony_ci    defines += [ "HICOLLIE_ENABLE" ]
81cb7eb8c9Sopenharmony_ci  }
82cb7eb8c9Sopenharmony_ci
83cb7eb8c9Sopenharmony_ci  use_exceptions = true
84cb7eb8c9Sopenharmony_ci  part_name = "dfs_service"
85cb7eb8c9Sopenharmony_ci  subsystem_name = "filemanagement"
86cb7eb8c9Sopenharmony_ci}
87cb7eb8c9Sopenharmony_ci
88cb7eb8c9Sopenharmony_ciohos_unittest("cloud_daemon_statistic_test") {
89cb7eb8c9Sopenharmony_ci  module_out_path = "filemanagement/dfs_service"
90cb7eb8c9Sopenharmony_ci
91cb7eb8c9Sopenharmony_ci  sources = [
92cb7eb8c9Sopenharmony_ci    "${distributedfile_path}/services/cloudfiledaemon/src/fuse_manager/cloud_daemon_statistic.cpp",
93cb7eb8c9Sopenharmony_ci    "cloud_daemon_statistic_test.cpp",
94cb7eb8c9Sopenharmony_ci  ]
95cb7eb8c9Sopenharmony_ci
96cb7eb8c9Sopenharmony_ci  cloud_disk = [
97cb7eb8c9Sopenharmony_ci    "${services_path}/cloudfiledaemon/src/cloud_disk/database_manager.cpp",
98cb7eb8c9Sopenharmony_ci    "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_base.cpp",
99cb7eb8c9Sopenharmony_ci    "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_cloud.cpp",
100cb7eb8c9Sopenharmony_ci    "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_local.cpp",
101cb7eb8c9Sopenharmony_ci    "${services_path}/cloudfiledaemon/src/cloud_disk/fuse_operations.cpp",
102cb7eb8c9Sopenharmony_ci  ]
103cb7eb8c9Sopenharmony_ci
104cb7eb8c9Sopenharmony_ci  sources += cloud_disk
105cb7eb8c9Sopenharmony_ci
106cb7eb8c9Sopenharmony_ci  include_dirs = [
107cb7eb8c9Sopenharmony_ci    "../../../../../communication/ipc/interfaces/innerkits/ipc_core/include",
108cb7eb8c9Sopenharmony_ci    "${distributedfile_path}/services/cloudfiledaemon/include",
109cb7eb8c9Sopenharmony_ci    "${distributedfile_path}/services/cloudfiledaemon/include/fuse_manager",
110cb7eb8c9Sopenharmony_ci    "${services_path}/cloudfiledaemon/include/cloud_disk/",
111cb7eb8c9Sopenharmony_ci    "${distributedfile_path}/adapter/cloud_adapter_example/include",
112cb7eb8c9Sopenharmony_ci    "${clouddisk_database_path}/include",
113cb7eb8c9Sopenharmony_ci    "${media_library_path}/frameworks/innerkitsimpl/media_library_helper/include",
114cb7eb8c9Sopenharmony_ci    "${media_library_path}/interfaces/inner_api/media_library_helper/include",
115cb7eb8c9Sopenharmony_ci    "${media_library_path}/frameworks/utils/include",
116cb7eb8c9Sopenharmony_ci  ]
117cb7eb8c9Sopenharmony_ci
118cb7eb8c9Sopenharmony_ci  deps = [
119cb7eb8c9Sopenharmony_ci    "${clouddisk_database_path}:clouddisk_database",
120cb7eb8c9Sopenharmony_ci    "${innerkits_native_path}/cloud_daemon_kit_inner:cloud_daemon_kit_inner",
121cb7eb8c9Sopenharmony_ci    "${innerkits_native_path}/cloud_file_kit_inner:cloudfile_kit",
122cb7eb8c9Sopenharmony_ci    "${utils_path}:libdistributedfiledentry",
123cb7eb8c9Sopenharmony_ci    "${utils_path}:libdistributedfileutils",
124cb7eb8c9Sopenharmony_ci    "//third_party/googletest:gmock_main",
125cb7eb8c9Sopenharmony_ci    "//third_party/googletest:gtest_main",
126cb7eb8c9Sopenharmony_ci  ]
127cb7eb8c9Sopenharmony_ci
128cb7eb8c9Sopenharmony_ci  external_deps = [
129cb7eb8c9Sopenharmony_ci    "ability_base:zuri",
130cb7eb8c9Sopenharmony_ci    "ability_runtime:dataobs_manager",
131cb7eb8c9Sopenharmony_ci    "ffrt:libffrt",
132cb7eb8c9Sopenharmony_ci    "hilog:libhilog",
133cb7eb8c9Sopenharmony_ci    "hitrace:hitrace_meter",
134cb7eb8c9Sopenharmony_ci    "init:libbegetutil",
135cb7eb8c9Sopenharmony_ci    "ipc:ipc_single",
136cb7eb8c9Sopenharmony_ci    "libfuse:libfuse",
137cb7eb8c9Sopenharmony_ci    "relational_store:native_rdb",
138cb7eb8c9Sopenharmony_ci  ]
139cb7eb8c9Sopenharmony_ci
140cb7eb8c9Sopenharmony_ci  defines = [
141cb7eb8c9Sopenharmony_ci    "private=public",
142cb7eb8c9Sopenharmony_ci    "LOG_DOMAIN=0xD004308",
143cb7eb8c9Sopenharmony_ci    "LOG_TAG=\"CloudFileDaemon\"",
144cb7eb8c9Sopenharmony_ci  ]
145cb7eb8c9Sopenharmony_ci
146cb7eb8c9Sopenharmony_ci  use_exceptions = true
147cb7eb8c9Sopenharmony_ci  part_name = "dfs_service"
148cb7eb8c9Sopenharmony_ci  subsystem_name = "filemanagement"
149cb7eb8c9Sopenharmony_ci}
150cb7eb8c9Sopenharmony_ci
151cb7eb8c9Sopenharmony_ciohos_unittest("cloud_daemon_test") {
152cb7eb8c9Sopenharmony_ci  module_out_path = "filemanagement/dfs_service"
153cb7eb8c9Sopenharmony_ci
154cb7eb8c9Sopenharmony_ci  sources = [
155cb7eb8c9Sopenharmony_ci    "${distributedfile_path}/services/cloudfiledaemon/src/fuse_manager/cloud_daemon_statistic.cpp",
156cb7eb8c9Sopenharmony_ci    "${distributedfile_path}/services/cloudfiledaemon/src/fuse_manager/fuse_manager.cpp",
157cb7eb8c9Sopenharmony_ci    "${distributedfile_path}/services/cloudfiledaemon/src/ipc/cloud_daemon.cpp",
158cb7eb8c9Sopenharmony_ci    "${distributedfile_path}/services/cloudfiledaemon/src/ipc/cloud_daemon_stub.cpp",
159cb7eb8c9Sopenharmony_ci    "cloud_daemon_test.cpp",
160cb7eb8c9Sopenharmony_ci  ]
161cb7eb8c9Sopenharmony_ci
162cb7eb8c9Sopenharmony_ci  cloud_disk = [
163cb7eb8c9Sopenharmony_ci    "${services_path}/cloudfiledaemon/src/cloud_disk/database_manager.cpp",
164cb7eb8c9Sopenharmony_ci    "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_base.cpp",
165cb7eb8c9Sopenharmony_ci    "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_cloud.cpp",
166cb7eb8c9Sopenharmony_ci    "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_local.cpp",
167cb7eb8c9Sopenharmony_ci    "${services_path}/cloudfiledaemon/src/cloud_disk/fuse_operations.cpp",
168cb7eb8c9Sopenharmony_ci  ]
169cb7eb8c9Sopenharmony_ci
170cb7eb8c9Sopenharmony_ci  sources += cloud_disk
171cb7eb8c9Sopenharmony_ci
172cb7eb8c9Sopenharmony_ci  include_dirs = [
173cb7eb8c9Sopenharmony_ci    "../../../../../communication/ipc/interfaces/innerkits/ipc_core/include",
174cb7eb8c9Sopenharmony_ci    "${distributedfile_path}/services/cloudfiledaemon/include",
175cb7eb8c9Sopenharmony_ci    "${services_path}/cloudfiledaemon/include/cloud_disk/",
176cb7eb8c9Sopenharmony_ci    "${distributedfile_path}/adapter/cloud_adapter_example/include",
177cb7eb8c9Sopenharmony_ci    "${clouddisk_database_path}/include",
178cb7eb8c9Sopenharmony_ci    "${media_library_path}/frameworks/innerkitsimpl/media_library_helper/include",
179cb7eb8c9Sopenharmony_ci    "${media_library_path}/interfaces/inner_api/media_library_helper/include",
180cb7eb8c9Sopenharmony_ci    "${media_library_path}/frameworks/utils/include",
181cb7eb8c9Sopenharmony_ci  ]
182cb7eb8c9Sopenharmony_ci
183cb7eb8c9Sopenharmony_ci  deps = [
184cb7eb8c9Sopenharmony_ci    "${clouddisk_database_path}:clouddisk_database",
185cb7eb8c9Sopenharmony_ci    "${innerkits_native_path}/cloud_daemon_kit_inner:cloud_daemon_kit_inner",
186cb7eb8c9Sopenharmony_ci    "${utils_path}:libdistributedfiledentry",
187cb7eb8c9Sopenharmony_ci    "${utils_path}:libdistributedfileutils",
188cb7eb8c9Sopenharmony_ci    "//third_party/googletest:gmock_main",
189cb7eb8c9Sopenharmony_ci    "//third_party/googletest:gtest_main",
190cb7eb8c9Sopenharmony_ci  ]
191cb7eb8c9Sopenharmony_ci
192cb7eb8c9Sopenharmony_ci  external_deps = [
193cb7eb8c9Sopenharmony_ci    "ability_base:zuri",
194cb7eb8c9Sopenharmony_ci    "ability_runtime:dataobs_manager",
195cb7eb8c9Sopenharmony_ci    "c_utils:utils",
196cb7eb8c9Sopenharmony_ci    "ffrt:libffrt",
197cb7eb8c9Sopenharmony_ci    "hilog:libhilog",
198cb7eb8c9Sopenharmony_ci    "hitrace:hitrace_meter",
199cb7eb8c9Sopenharmony_ci    "ipc:ipc_single",
200cb7eb8c9Sopenharmony_ci    "libfuse:libfuse",
201cb7eb8c9Sopenharmony_ci    "relational_store:native_rdb",
202cb7eb8c9Sopenharmony_ci    "safwk:system_ability_fwk",
203cb7eb8c9Sopenharmony_ci    "samgr:samgr_proxy",
204cb7eb8c9Sopenharmony_ci  ]
205cb7eb8c9Sopenharmony_ci
206cb7eb8c9Sopenharmony_ci  defines = [
207cb7eb8c9Sopenharmony_ci    "private=public",
208cb7eb8c9Sopenharmony_ci    "LOG_DOMAIN=0xD004308",
209cb7eb8c9Sopenharmony_ci    "LOG_TAG=\"CloudFileDaemon\"",
210cb7eb8c9Sopenharmony_ci  ]
211cb7eb8c9Sopenharmony_ci
212cb7eb8c9Sopenharmony_ci  if (cloudsync_service_hicollie_enable) {
213cb7eb8c9Sopenharmony_ci    external_deps += [ "hicollie:libhicollie" ]
214cb7eb8c9Sopenharmony_ci    defines += [ "HICOLLIE_ENABLE" ]
215cb7eb8c9Sopenharmony_ci  }
216cb7eb8c9Sopenharmony_ci
217cb7eb8c9Sopenharmony_ci  use_exceptions = true
218cb7eb8c9Sopenharmony_ci  part_name = "dfs_service"
219cb7eb8c9Sopenharmony_ci  subsystem_name = "filemanagement"
220cb7eb8c9Sopenharmony_ci}
221cb7eb8c9Sopenharmony_ci
222cb7eb8c9Sopenharmony_ciohos_unittest("cloud_daemon_stub_test") {
223cb7eb8c9Sopenharmony_ci  module_out_path = "filemanagement/dfs_service"
224cb7eb8c9Sopenharmony_ci
225cb7eb8c9Sopenharmony_ci  sources = [
226cb7eb8c9Sopenharmony_ci    "${distributedfile_path}/services/cloudfiledaemon/src/ipc/cloud_daemon_stub.cpp",
227cb7eb8c9Sopenharmony_ci    "cloud_daemon_stub_test.cpp",
228cb7eb8c9Sopenharmony_ci  ]
229cb7eb8c9Sopenharmony_ci
230cb7eb8c9Sopenharmony_ci  include_dirs = [
231cb7eb8c9Sopenharmony_ci    "${distributedfile_path}/services/cloudfiledaemon/include",
232cb7eb8c9Sopenharmony_ci    "${services_path}/cloudsyncservice/include/data_sync/",
233cb7eb8c9Sopenharmony_ci    "${distributedfile_path}/adapter/cloud_adapter_example/include",
234cb7eb8c9Sopenharmony_ci  ]
235cb7eb8c9Sopenharmony_ci
236cb7eb8c9Sopenharmony_ci  deps = [
237cb7eb8c9Sopenharmony_ci    "${innerkits_native_path}/cloud_daemon_kit_inner:cloud_daemon_kit_inner",
238cb7eb8c9Sopenharmony_ci    "${utils_path}:libdistributedfiledentry",
239cb7eb8c9Sopenharmony_ci    "${utils_path}:libdistributedfileutils",
240cb7eb8c9Sopenharmony_ci    "//third_party/googletest:gmock_main",
241cb7eb8c9Sopenharmony_ci    "//third_party/googletest:gtest_main",
242cb7eb8c9Sopenharmony_ci  ]
243cb7eb8c9Sopenharmony_ci
244cb7eb8c9Sopenharmony_ci  external_deps = [
245cb7eb8c9Sopenharmony_ci    "c_utils:utils",
246cb7eb8c9Sopenharmony_ci    "hilog:libhilog",
247cb7eb8c9Sopenharmony_ci    "ipc:ipc_single",
248cb7eb8c9Sopenharmony_ci    "libfuse:libfuse",
249cb7eb8c9Sopenharmony_ci    "safwk:system_ability_fwk",
250cb7eb8c9Sopenharmony_ci    "samgr:samgr_proxy",
251cb7eb8c9Sopenharmony_ci  ]
252cb7eb8c9Sopenharmony_ci
253cb7eb8c9Sopenharmony_ci  defines = [
254cb7eb8c9Sopenharmony_ci    "private=public",
255cb7eb8c9Sopenharmony_ci    "LOG_DOMAIN=0xD004308",
256cb7eb8c9Sopenharmony_ci    "LOG_TAG=\"CloudFileDaemon\"",
257cb7eb8c9Sopenharmony_ci  ]
258cb7eb8c9Sopenharmony_ci
259cb7eb8c9Sopenharmony_ci  use_exceptions = true
260cb7eb8c9Sopenharmony_ci  part_name = "dfs_service"
261cb7eb8c9Sopenharmony_ci  subsystem_name = "filemanagement"
262cb7eb8c9Sopenharmony_ci}
263cb7eb8c9Sopenharmony_ci
264cb7eb8c9Sopenharmony_cigroup("services_daemon_test") {
265cb7eb8c9Sopenharmony_ci  testonly = true
266cb7eb8c9Sopenharmony_ci
267cb7eb8c9Sopenharmony_ci  deps = [
268cb7eb8c9Sopenharmony_ci    ":cloud_daemon_statistic_test",
269cb7eb8c9Sopenharmony_ci    ":cloud_daemon_stub_test",
270cb7eb8c9Sopenharmony_ci    ":fuse_manager_test",
271cb7eb8c9Sopenharmony_ci  ]
272cb7eb8c9Sopenharmony_ci}
273