• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2021-2025 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13import("//build/test.gni")
14import("//foundation/filemanagement/dfs_service/distributedfile.gni")
15
16module_output_path = "storage_distributed_file_manager/distributedfiledaemon"
17
18config("module_private_config") {
19  visibility = [ ":*" ]
20
21  include_dirs = [
22    "${distributedfile_path}/frameworks/native/distributed_file_inner/include",
23    "${distributedfile_path}/test/mock",
24    "${services_path}/distributedfiledaemon/include",
25    "${services_path}/distributedfiledaemon/include/ipc",
26    "//third_party/json/include",
27  ]
28}
29
30ohos_unittest("device_info_test") {
31  branch_protector_ret = "pac_ret"
32  sanitize = {
33    integer_overflow = true
34    cfi = true
35    cfi_cross_dso = true
36    debug = false
37  }
38
39  module_out_path = module_output_path
40
41  sources =
42      [ "${services_path}/distributedfiledaemon/src/device/device_info.cpp" ]
43
44  sources += [ "device/device_info_test.cpp" ]
45
46  configs = [
47    ":module_private_config",
48    "${utils_path}:compiler_configs",
49  ]
50
51  deps = [
52    "${utils_path}:libdistributedfileutils",
53    "//third_party/googletest:gmock_main",
54    "//third_party/googletest:gtest_main",
55  ]
56
57  external_deps = [
58    "c_utils:utils",
59    "device_manager:devicemanagersdk",
60    "hilog:libhilog",
61  ]
62
63  defines = [ "private=public" ]
64}
65
66ohos_unittest("device_manager_agent_sup_test") {
67  branch_protector_ret = "pac_ret"
68  sanitize = {
69    integer_overflow = true
70    cfi = true
71    cfi_cross_dso = true
72    debug = false
73    blocklist = "${distributedfile_path}/cfi_blocklist.txt"
74  }
75
76  module_out_path = module_output_path
77
78  include_dirs = [ "device/include/" ]
79
80  sources = [
81    "${distributedfile_path}/frameworks/native/distributed_file_inner/src/asset/asset_obj.cpp",
82    "${distributedfile_path}/test/mock/device_manager_impl_mock.cpp",
83    "${distributedfile_path}/test/mock/device_manager_mock.cpp",
84    "${distributedfile_path}/test/mock/softbus_bus_center_mock.cpp",
85    "${services_path}/distributedfiledaemon/src/all_connect/all_connect_manager.cpp",
86    "${services_path}/distributedfiledaemon/src/connect_count/connect_count.cpp",
87    "${services_path}/distributedfiledaemon/src/device/device_info.cpp",
88    "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp",
89    "${services_path}/distributedfiledaemon/src/ipc/asset_callback_manager.cpp",
90    "${services_path}/distributedfiledaemon/src/ipc/asset_recv_callback_proxy.cpp",
91    "${services_path}/distributedfiledaemon/src/ipc/asset_send_callback_proxy.cpp",
92    "${services_path}/distributedfiledaemon/src/ipc/connection_detector.cpp",
93    "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp",
94    "${services_path}/distributedfiledaemon/src/ipc/daemon_eventhandler.cpp",
95    "${services_path}/distributedfiledaemon/src/ipc/daemon_execute.cpp",
96    "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp",
97    "${services_path}/distributedfiledaemon/src/ipc/file_trans_listener_proxy.cpp",
98    "${services_path}/distributedfiledaemon/src/ipc/trans_mananger.cpp",
99    "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp",
100    "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp",
101    "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp",
102    "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp",
103    "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp",
104    "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp",
105    "${services_path}/distributedfiledaemon/src/network/session_pool.cpp",
106    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp",
107    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_recv_listener.cpp",
108    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_send_listener.cpp",
109    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_receive_listener.cpp",
110    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_send_listener.cpp",
111    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler.cpp",
112    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler_asset.cpp",
113    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp",
114    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp",
115    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_listener.cpp",
116    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_pool.cpp",
117  ]
118
119  sources += [
120    "device/device_manager_agent_sup_test.cpp",
121    "device/mock_other_method.cpp",
122  ]
123
124  configs = [
125    ":module_private_config",
126    "${utils_path}:compiler_configs",
127  ]
128
129  deps = [
130    "${utils_path}:libdistributedfileutils",
131    "//third_party/googletest:gmock_main",
132    "//third_party/googletest:gtest_main",
133  ]
134
135  external_deps = [
136    "ability_base:want",
137    "ability_base:zuri",
138    "access_token:libaccesstoken_sdk",
139    "app_file_service:sandbox_helper_native",
140    "c_utils:utils",
141    "common_event_service:cesfwk_innerkits",
142    "dataclassification:data_transit_mgr",
143    "device_auth:deviceauth_sdk",
144    "device_manager:devicemanagersdk",
145    "dsoftbus:softbus_client",
146    "eventhandler:libeventhandler",
147    "hilog:libhilog",
148    "hisysevent:libhisysevent",
149    "init:libbegetutil",
150    "ipc:ipc_single",
151    "os_account:os_account_innerkits",
152    "safwk:system_ability_fwk",
153    "samgr:samgr_proxy",
154    "storage_service:storage_manager_sa_proxy",
155    "zlib:shared_libz",
156  ]
157
158  defines = [ "private=public" ]
159
160  if (support_same_account) {
161    defines += [ "SUPPORT_SAME_ACCOUNT" ]
162  }
163}
164
165ohos_unittest("device_manager_agent_test") {
166  branch_protector_ret = "pac_ret"
167  sanitize = {
168    integer_overflow = true
169    cfi = true
170    cfi_cross_dso = true
171    debug = false
172    blocklist = "${distributedfile_path}/cfi_blocklist.txt"
173  }
174
175  module_out_path = module_output_path
176
177  sources = [
178    "${distributedfile_path}/frameworks/native/distributed_file_inner/src/asset/asset_obj.cpp",
179    "${distributedfile_path}/test/mock/device_manager_impl_mock.cpp",
180    "${distributedfile_path}/test/mock/device_manager_mock.cpp",
181    "${distributedfile_path}/test/mock/softbus_bus_center_mock.cpp",
182    "${services_path}/distributedfiledaemon/src/all_connect/all_connect_manager.cpp",
183    "${services_path}/distributedfiledaemon/src/connect_count/connect_count.cpp",
184    "${services_path}/distributedfiledaemon/src/device/device_info.cpp",
185    "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp",
186    "${services_path}/distributedfiledaemon/src/ipc/asset_callback_manager.cpp",
187    "${services_path}/distributedfiledaemon/src/ipc/asset_recv_callback_proxy.cpp",
188    "${services_path}/distributedfiledaemon/src/ipc/asset_send_callback_proxy.cpp",
189    "${services_path}/distributedfiledaemon/src/ipc/connection_detector.cpp",
190    "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp",
191    "${services_path}/distributedfiledaemon/src/ipc/daemon_eventhandler.cpp",
192    "${services_path}/distributedfiledaemon/src/ipc/daemon_execute.cpp",
193    "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp",
194    "${services_path}/distributedfiledaemon/src/ipc/file_trans_listener_proxy.cpp",
195    "${services_path}/distributedfiledaemon/src/ipc/trans_mananger.cpp",
196    "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp",
197    "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp",
198    "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp",
199    "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp",
200    "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp",
201    "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp",
202    "${services_path}/distributedfiledaemon/src/network/session_pool.cpp",
203    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp",
204    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_recv_listener.cpp",
205    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_send_listener.cpp",
206    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_receive_listener.cpp",
207    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_send_listener.cpp",
208    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler.cpp",
209    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler_asset.cpp",
210    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp",
211    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp",
212    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_listener.cpp",
213    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_pool.cpp",
214  ]
215
216  sources += [ "device/device_manager_agent_test.cpp" ]
217
218  configs = [
219    ":module_private_config",
220    "${utils_path}:compiler_configs",
221  ]
222
223  deps = [
224    "${utils_path}:libdistributedfileutils",
225    "//third_party/googletest:gmock_main",
226    "//third_party/googletest:gtest_main",
227  ]
228
229  external_deps = [
230    "ability_base:want",
231    "ability_base:zuri",
232    "access_token:libaccesstoken_sdk",
233    "app_file_service:sandbox_helper_native",
234    "c_utils:utils",
235    "common_event_service:cesfwk_innerkits",
236    "dataclassification:data_transit_mgr",
237    "device_auth:deviceauth_sdk",
238    "device_manager:devicemanagersdk",
239    "dsoftbus:softbus_client",
240    "eventhandler:libeventhandler",
241    "hilog:libhilog",
242    "hisysevent:libhisysevent",
243    "init:libbegetutil",
244    "ipc:ipc_single",
245    "os_account:os_account_innerkits",
246    "safwk:system_ability_fwk",
247    "samgr:samgr_proxy",
248    "storage_service:storage_manager_sa_proxy",
249    "zlib:shared_libz",
250  ]
251
252  defines = [ "private=public" ]
253
254  if (support_same_account) {
255    defines += [ "SUPPORT_SAME_ACCOUNT" ]
256  }
257}
258
259ohos_unittest("os_account_observer_test") {
260  branch_protector_ret = "pac_ret"
261  sanitize = {
262    integer_overflow = true
263    cfi = true
264    cfi_cross_dso = true
265    debug = false
266  }
267
268  module_out_path = module_output_path
269
270  sources = [
271    "${distributedfile_path}/frameworks/native/distributed_file_inner/src/asset/asset_obj.cpp",
272    "${services_path}/distributedfiledaemon/src/all_connect/all_connect_manager.cpp",
273    "${services_path}/distributedfiledaemon/src/connect_count/connect_count.cpp",
274    "${services_path}/distributedfiledaemon/src/device/device_info.cpp",
275    "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp",
276    "${services_path}/distributedfiledaemon/src/ipc/asset_callback_manager.cpp",
277    "${services_path}/distributedfiledaemon/src/ipc/asset_recv_callback_proxy.cpp",
278    "${services_path}/distributedfiledaemon/src/ipc/asset_send_callback_proxy.cpp",
279    "${services_path}/distributedfiledaemon/src/ipc/connection_detector.cpp",
280    "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp",
281    "${services_path}/distributedfiledaemon/src/ipc/daemon_eventhandler.cpp",
282    "${services_path}/distributedfiledaemon/src/ipc/daemon_execute.cpp",
283    "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp",
284    "${services_path}/distributedfiledaemon/src/ipc/file_trans_listener_proxy.cpp",
285    "${services_path}/distributedfiledaemon/src/ipc/trans_mananger.cpp",
286    "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp",
287    "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp",
288    "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp",
289    "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp",
290    "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp",
291    "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp",
292    "${services_path}/distributedfiledaemon/src/network/session_pool.cpp",
293    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp",
294    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_recv_listener.cpp",
295    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_send_listener.cpp",
296    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_receive_listener.cpp",
297    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_send_listener.cpp",
298    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler.cpp",
299    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler_asset.cpp",
300    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp",
301    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp",
302    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_listener.cpp",
303    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_pool.cpp",
304  ]
305
306  sources += [ "multiuser/os_account_observer_test.cpp" ]
307
308  configs = [
309    ":module_private_config",
310    "${utils_path}:compiler_configs",
311  ]
312
313  deps = [
314    "${utils_path}:libdistributedfileutils",
315    "//third_party/googletest:gtest_main",
316  ]
317
318  external_deps = [
319    "ability_base:want",
320    "ability_base:zuri",
321    "access_token:libaccesstoken_sdk",
322    "app_file_service:sandbox_helper_native",
323    "c_utils:utils",
324    "common_event_service:cesfwk_innerkits",
325    "dataclassification:data_transit_mgr",
326    "device_auth:deviceauth_sdk",
327    "device_manager:devicemanagersdk",
328    "dsoftbus:softbus_client",
329    "eventhandler:libeventhandler",
330    "hilog:libhilog",
331    "hisysevent:libhisysevent",
332    "init:libbegetutil",
333    "ipc:ipc_single",
334    "os_account:os_account_innerkits",
335    "safwk:system_ability_fwk",
336    "samgr:samgr_proxy",
337    "storage_service:storage_manager_sa_proxy",
338    "zlib:shared_libz",
339  ]
340
341  defines = [ "private=public" ]
342  if (support_same_account) {
343    defines += [ "SUPPORT_SAME_ACCOUNT" ]
344  }
345}
346
347ohos_unittest("devsl_dispatcher_test") {
348  branch_protector_ret = "pac_ret"
349  sanitize = {
350    integer_overflow = true
351    cfi = true
352    cfi_cross_dso = true
353    debug = false
354  }
355
356  module_out_path = module_output_path
357
358  sources = [
359    "${distributedfile_path}/frameworks/native/distributed_file_inner/src/asset/asset_obj.cpp",
360    "${services_path}/distributedfiledaemon/src/all_connect/all_connect_manager.cpp",
361    "${services_path}/distributedfiledaemon/src/connect_count/connect_count.cpp",
362    "${services_path}/distributedfiledaemon/src/device/device_info.cpp",
363    "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp",
364    "${services_path}/distributedfiledaemon/src/ipc/asset_callback_manager.cpp",
365    "${services_path}/distributedfiledaemon/src/ipc/asset_recv_callback_proxy.cpp",
366    "${services_path}/distributedfiledaemon/src/ipc/asset_send_callback_proxy.cpp",
367    "${services_path}/distributedfiledaemon/src/ipc/connection_detector.cpp",
368    "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp",
369    "${services_path}/distributedfiledaemon/src/ipc/daemon_eventhandler.cpp",
370    "${services_path}/distributedfiledaemon/src/ipc/daemon_execute.cpp",
371    "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp",
372    "${services_path}/distributedfiledaemon/src/ipc/file_trans_listener_proxy.cpp",
373    "${services_path}/distributedfiledaemon/src/ipc/trans_mananger.cpp",
374    "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp",
375    "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp",
376    "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp",
377    "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp",
378    "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp",
379    "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp",
380    "${services_path}/distributedfiledaemon/src/network/session_pool.cpp",
381    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp",
382    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_recv_listener.cpp",
383    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_send_listener.cpp",
384    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_receive_listener.cpp",
385    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_send_listener.cpp",
386    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler.cpp",
387    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler_asset.cpp",
388    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp",
389    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp",
390    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_listener.cpp",
391    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_pool.cpp",
392    "network/devsl_dispatcher_test.cpp",
393  ]
394
395  configs = [
396    ":module_private_config",
397    "${utils_path}:compiler_configs",
398  ]
399
400  deps = [
401    "${utils_path}:libdistributedfileutils",
402    "//third_party/googletest:gtest_main",
403  ]
404
405  external_deps = [
406    "ability_base:want",
407    "ability_base:zuri",
408    "access_token:libaccesstoken_sdk",
409    "app_file_service:sandbox_helper_native",
410    "c_utils:utils",
411    "common_event_service:cesfwk_innerkits",
412    "dataclassification:data_transit_mgr",
413    "device_auth:deviceauth_sdk",
414    "device_manager:devicemanagersdk",
415    "dsoftbus:softbus_client",
416    "eventhandler:libeventhandler",
417    "hilog:libhilog",
418    "hisysevent:libhisysevent",
419    "init:libbegetutil",
420    "ipc:ipc_single",
421    "os_account:os_account_innerkits",
422    "safwk:system_ability_fwk",
423    "samgr:samgr_proxy",
424    "storage_service:storage_manager_sa_proxy",
425    "zlib:shared_libz",
426  ]
427
428  defines = [ "private=public" ]
429
430  if (support_same_account) {
431    defines += [ "SUPPORT_SAME_ACCOUNT" ]
432  }
433}
434
435ohos_unittest("kernel_talker_test") {
436  branch_protector_ret = "pac_ret"
437  sanitize = {
438    integer_overflow = true
439    cfi = true
440    cfi_cross_dso = true
441    debug = false
442  }
443
444  module_out_path = module_output_path
445
446  sources = [
447    "${distributedfile_path}/frameworks/native/distributed_file_inner/src/asset/asset_obj.cpp",
448    "${services_path}/distributedfiledaemon/src/all_connect/all_connect_manager.cpp",
449    "${services_path}/distributedfiledaemon/src/connect_count/connect_count.cpp",
450    "${services_path}/distributedfiledaemon/src/device/device_info.cpp",
451    "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp",
452    "${services_path}/distributedfiledaemon/src/ipc/asset_callback_manager.cpp",
453    "${services_path}/distributedfiledaemon/src/ipc/asset_recv_callback_proxy.cpp",
454    "${services_path}/distributedfiledaemon/src/ipc/asset_send_callback_proxy.cpp",
455    "${services_path}/distributedfiledaemon/src/ipc/connection_detector.cpp",
456    "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp",
457    "${services_path}/distributedfiledaemon/src/ipc/daemon_eventhandler.cpp",
458    "${services_path}/distributedfiledaemon/src/ipc/daemon_execute.cpp",
459    "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp",
460    "${services_path}/distributedfiledaemon/src/ipc/file_trans_listener_proxy.cpp",
461    "${services_path}/distributedfiledaemon/src/ipc/trans_mananger.cpp",
462    "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp",
463    "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp",
464    "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp",
465    "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp",
466    "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp",
467    "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp",
468    "${services_path}/distributedfiledaemon/src/network/session_pool.cpp",
469    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp",
470    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_recv_listener.cpp",
471    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_send_listener.cpp",
472    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_receive_listener.cpp",
473    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_send_listener.cpp",
474    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler.cpp",
475    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler_asset.cpp",
476    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp",
477    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp",
478    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_listener.cpp",
479    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_pool.cpp",
480    "network/kernel_talker_test.cpp",
481  ]
482
483  configs = [
484    ":module_private_config",
485    "${utils_path}:compiler_configs",
486  ]
487
488  deps = [
489    "${utils_path}:libdistributedfileutils",
490    "//third_party/googletest:gtest_main",
491  ]
492
493  external_deps = [
494    "ability_base:want",
495    "ability_base:zuri",
496    "access_token:libaccesstoken_sdk",
497    "app_file_service:sandbox_helper_native",
498    "c_utils:utils",
499    "common_event_service:cesfwk_innerkits",
500    "dataclassification:data_transit_mgr",
501    "device_auth:deviceauth_sdk",
502    "device_manager:devicemanagersdk",
503    "dsoftbus:softbus_client",
504    "eventhandler:libeventhandler",
505    "hilog:libhilog",
506    "hisysevent:libhisysevent",
507    "init:libbegetutil",
508    "ipc:ipc_single",
509    "os_account:os_account_innerkits",
510    "safwk:system_ability_fwk",
511    "samgr:samgr_proxy",
512    "storage_service:storage_manager_sa_proxy",
513    "zlib:shared_libz",
514  ]
515
516  defines = [ "private=public" ]
517
518  if (support_same_account) {
519    defines += [ "SUPPORT_SAME_ACCOUNT" ]
520  }
521}
522
523ohos_unittest("network_agent_template_test") {
524  branch_protector_ret = "pac_ret"
525  sanitize = {
526    integer_overflow = true
527    cfi = true
528    cfi_cross_dso = true
529    debug = false
530  }
531
532  module_out_path = module_output_path
533
534  sources = [
535    "${services_path}/distributedfiledaemon/src/all_connect/all_connect_manager.cpp",
536    "${services_path}/distributedfiledaemon/src/device/device_info.cpp",
537    "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp",
538    "${services_path}/distributedfiledaemon/src/ipc/connection_detector.cpp",
539    "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp",
540    "${services_path}/distributedfiledaemon/src/ipc/daemon_eventhandler.cpp",
541    "${services_path}/distributedfiledaemon/src/ipc/daemon_execute.cpp",
542    "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp",
543    "${services_path}/distributedfiledaemon/src/ipc/file_trans_listener_proxy.cpp",
544    "${services_path}/distributedfiledaemon/src/ipc/trans_mananger.cpp",
545    "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp",
546    "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp",
547    "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp",
548    "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp",
549    "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp",
550    "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp",
551    "${services_path}/distributedfiledaemon/src/network/session_pool.cpp",
552    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp",
553    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_recv_listener.cpp",
554    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_send_listener.cpp",
555    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_receive_listener.cpp",
556    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_send_listener.cpp",
557    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler.cpp",
558    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler_asset.cpp",
559    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp",
560    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp",
561    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_listener.cpp",
562    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_pool.cpp",
563    "network/network_agent_template_test.cpp",
564  ]
565
566  configs = [
567    ":module_private_config",
568    "${utils_path}:compiler_configs",
569  ]
570
571  deps = [
572    "${utils_path}:libdistributedfileutils",
573    "//third_party/googletest:gtest_main",
574  ]
575
576  external_deps = [
577    "ability_base:want",
578    "ability_base:zuri",
579    "access_token:libaccesstoken_sdk",
580    "app_file_service:sandbox_helper_native",
581    "c_utils:utils",
582    "common_event_service:cesfwk_innerkits",
583    "dataclassification:data_transit_mgr",
584    "device_auth:deviceauth_sdk",
585    "device_manager:devicemanagersdk",
586    "dsoftbus:softbus_client",
587    "eventhandler:libeventhandler",
588    "hilog:libhilog",
589    "init:libbegetutil",
590    "ipc:ipc_single",
591    "os_account:os_account_innerkits",
592    "safwk:system_ability_fwk",
593    "samgr:samgr_proxy",
594    "storage_service:storage_manager_sa_proxy",
595    "zlib:shared_libz",
596  ]
597
598  defines = [ "private=public" ]
599
600  if (support_same_account) {
601    defines += [ "SUPPORT_SAME_ACCOUNT" ]
602  }
603}
604
605ohos_unittest("session_pool_test") {
606  branch_protector_ret = "pac_ret"
607  sanitize = {
608    integer_overflow = true
609    cfi = true
610    cfi_cross_dso = true
611    debug = false
612  }
613
614  module_out_path = module_output_path
615
616  sources = [
617    "${distributedfile_path}/frameworks/native/distributed_file_inner/src/asset/asset_obj.cpp",
618    "${services_path}/distributedfiledaemon/src/all_connect/all_connect_manager.cpp",
619    "${services_path}/distributedfiledaemon/src/connect_count/connect_count.cpp",
620    "${services_path}/distributedfiledaemon/src/device/device_info.cpp",
621    "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp",
622    "${services_path}/distributedfiledaemon/src/ipc/asset_callback_manager.cpp",
623    "${services_path}/distributedfiledaemon/src/ipc/asset_recv_callback_proxy.cpp",
624    "${services_path}/distributedfiledaemon/src/ipc/asset_send_callback_proxy.cpp",
625    "${services_path}/distributedfiledaemon/src/ipc/connection_detector.cpp",
626    "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp",
627    "${services_path}/distributedfiledaemon/src/ipc/daemon_eventhandler.cpp",
628    "${services_path}/distributedfiledaemon/src/ipc/daemon_execute.cpp",
629    "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp",
630    "${services_path}/distributedfiledaemon/src/ipc/file_trans_listener_proxy.cpp",
631    "${services_path}/distributedfiledaemon/src/ipc/trans_mananger.cpp",
632    "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp",
633    "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp",
634    "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp",
635    "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp",
636    "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp",
637    "${services_path}/distributedfiledaemon/src/network/session_pool.cpp",
638    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp",
639    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_recv_listener.cpp",
640    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_send_listener.cpp",
641    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_receive_listener.cpp",
642    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_send_listener.cpp",
643    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler.cpp",
644    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler_asset.cpp",
645    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp",
646    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp",
647    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_listener.cpp",
648    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_pool.cpp",
649    "network/session_pool_test.cpp",
650  ]
651
652  configs = [
653    ":module_private_config",
654    "${utils_path}:compiler_configs",
655  ]
656
657  deps = [
658    "${utils_path}:libdistributedfileutils",
659    "//third_party/googletest:gtest_main",
660  ]
661
662  external_deps = [
663    "ability_base:want",
664    "ability_base:zuri",
665    "access_token:libaccesstoken_sdk",
666    "app_file_service:sandbox_helper_native",
667    "c_utils:utils",
668    "common_event_service:cesfwk_innerkits",
669    "dataclassification:data_transit_mgr",
670    "device_auth:deviceauth_sdk",
671    "device_manager:devicemanagersdk",
672    "dsoftbus:softbus_client",
673    "eventhandler:libeventhandler",
674    "hilog:libhilog",
675    "hisysevent:libhisysevent",
676    "init:libbegetutil",
677    "ipc:ipc_single",
678    "os_account:os_account_innerkits",
679    "safwk:system_ability_fwk",
680    "samgr:samgr_proxy",
681    "storage_service:storage_manager_sa_proxy",
682    "zlib:shared_libz",
683  ]
684
685  defines = [ "private=public" ]
686
687  if (support_same_account) {
688    defines += [ "SUPPORT_SAME_ACCOUNT" ]
689  }
690}
691
692ohos_unittest("softbus_agent_test") {
693  branch_protector_ret = "pac_ret"
694  sanitize = {
695    integer_overflow = true
696    cfi = true
697    cfi_cross_dso = true
698    debug = false
699    blocklist = "${distributedfile_path}/cfi_blocklist.txt"
700  }
701
702  module_out_path = module_output_path
703
704  sources = [
705    "${distributedfile_path}/frameworks/native/distributed_file_inner/src/asset/asset_obj.cpp",
706    "${distributedfile_path}/test/mock/socket_mock.cpp",
707    "${services_path}/distributedfiledaemon/src/all_connect/all_connect_manager.cpp",
708    "${services_path}/distributedfiledaemon/src/connect_count/connect_count.cpp",
709    "${services_path}/distributedfiledaemon/src/device/device_info.cpp",
710    "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp",
711    "${services_path}/distributedfiledaemon/src/ipc/asset_callback_manager.cpp",
712    "${services_path}/distributedfiledaemon/src/ipc/asset_recv_callback_proxy.cpp",
713    "${services_path}/distributedfiledaemon/src/ipc/asset_send_callback_proxy.cpp",
714    "${services_path}/distributedfiledaemon/src/ipc/connection_detector.cpp",
715    "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp",
716    "${services_path}/distributedfiledaemon/src/ipc/daemon_eventhandler.cpp",
717    "${services_path}/distributedfiledaemon/src/ipc/daemon_execute.cpp",
718    "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp",
719    "${services_path}/distributedfiledaemon/src/ipc/file_trans_listener_proxy.cpp",
720    "${services_path}/distributedfiledaemon/src/ipc/trans_mananger.cpp",
721    "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp",
722    "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp",
723    "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp",
724    "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp",
725    "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp",
726    "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp",
727    "${services_path}/distributedfiledaemon/src/network/session_pool.cpp",
728    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp",
729    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_recv_listener.cpp",
730    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_send_listener.cpp",
731    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_receive_listener.cpp",
732    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_send_listener.cpp",
733    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler.cpp",
734    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler_asset.cpp",
735    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp",
736    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp",
737    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_listener.cpp",
738    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_pool.cpp",
739    "network/softbus/softbus_agent_test.cpp",
740  ]
741
742  configs = [
743    ":module_private_config",
744    "${utils_path}:compiler_configs",
745  ]
746
747  deps = [
748    "${utils_path}:libdistributedfileutils",
749    "//third_party/googletest:gmock_main",
750    "//third_party/googletest:gtest_main",
751  ]
752
753  external_deps = [
754    "ability_base:want",
755    "ability_base:zuri",
756    "access_token:libaccesstoken_sdk",
757    "app_file_service:sandbox_helper_native",
758    "c_utils:utils",
759    "common_event_service:cesfwk_innerkits",
760    "dataclassification:data_transit_mgr",
761    "device_auth:deviceauth_sdk",
762    "device_manager:devicemanagersdk",
763    "dsoftbus:softbus_client",
764    "eventhandler:libeventhandler",
765    "hilog:libhilog",
766    "hisysevent:libhisysevent",
767    "init:libbegetutil",
768    "ipc:ipc_single",
769    "os_account:os_account_innerkits",
770    "safwk:system_ability_fwk",
771    "samgr:samgr_proxy",
772    "storage_service:storage_manager_sa_proxy",
773    "zlib:shared_libz",
774  ]
775
776  defines = [
777    "private=public",
778    "protected=public",
779  ]
780
781  if (support_same_account) {
782    defines += [ "SUPPORT_SAME_ACCOUNT" ]
783  }
784}
785
786ohos_unittest("softbus_agent_sup_test") {
787  branch_protector_ret = "pac_ret"
788  sanitize = {
789    integer_overflow = true
790    cfi = true
791    cfi_cross_dso = true
792    debug = false
793    blocklist = "${distributedfile_path}/cfi_blocklist.txt"
794  }
795
796  module_out_path = module_output_path
797
798  include_dirs = [ "${services_path}/distributedfiledaemon/test/mock/include/" ]
799
800  sources = [
801    "${distributedfile_path}/frameworks/native/distributed_file_inner/src/asset/asset_obj.cpp",
802    "${distributedfile_path}/test/mock/device_manager_impl_mock.cpp",
803    "${services_path}/distributedfiledaemon/src/all_connect/all_connect_manager.cpp",
804    "${services_path}/distributedfiledaemon/src/connect_count/connect_count.cpp",
805    "${services_path}/distributedfiledaemon/src/device/device_info.cpp",
806    "${services_path}/distributedfiledaemon/src/ipc/asset_callback_manager.cpp",
807    "${services_path}/distributedfiledaemon/src/ipc/asset_recv_callback_proxy.cpp",
808    "${services_path}/distributedfiledaemon/src/ipc/asset_send_callback_proxy.cpp",
809    "${services_path}/distributedfiledaemon/src/ipc/connection_detector.cpp",
810    "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp",
811    "${services_path}/distributedfiledaemon/src/ipc/daemon_eventhandler.cpp",
812    "${services_path}/distributedfiledaemon/src/ipc/daemon_execute.cpp",
813    "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp",
814    "${services_path}/distributedfiledaemon/src/ipc/file_trans_listener_proxy.cpp",
815    "${services_path}/distributedfiledaemon/src/ipc/trans_mananger.cpp",
816    "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp",
817    "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp",
818    "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp",
819    "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp",
820    "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp",
821    "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp",
822    "${services_path}/distributedfiledaemon/src/network/session_pool.cpp",
823    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp",
824    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_recv_listener.cpp",
825    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_send_listener.cpp",
826    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_receive_listener.cpp",
827    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_send_listener.cpp",
828    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler.cpp",
829    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler_asset.cpp",
830    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp",
831    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp",
832    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_listener.cpp",
833    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_pool.cpp",
834    "${services_path}/distributedfiledaemon/test/mock/device_manager_agent_mock.cpp",
835    "network/softbus/softbus_agent_sup_test.cpp",
836  ]
837
838  configs = [
839    ":module_private_config",
840    "${utils_path}:compiler_configs",
841  ]
842
843  deps = [
844    "${utils_path}:libdistributedfileutils",
845    "//third_party/googletest:gmock_main",
846    "//third_party/googletest:gtest_main",
847  ]
848
849  external_deps = [
850    "ability_base:want",
851    "ability_base:zuri",
852    "access_token:libaccesstoken_sdk",
853    "app_file_service:sandbox_helper_native",
854    "c_utils:utils",
855    "common_event_service:cesfwk_innerkits",
856    "dataclassification:data_transit_mgr",
857    "device_auth:deviceauth_sdk",
858    "device_manager:devicemanagersdk",
859    "dsoftbus:softbus_client",
860    "eventhandler:libeventhandler",
861    "hilog:libhilog",
862    "hisysevent:libhisysevent",
863    "init:libbegetutil",
864    "ipc:ipc_single",
865    "os_account:os_account_innerkits",
866    "safwk:system_ability_fwk",
867    "samgr:samgr_proxy",
868    "storage_service:storage_manager_sa_proxy",
869    "zlib:shared_libz",
870  ]
871
872  defines = [
873    "private=public",
874    "protected=public",
875    "NORMAL_MOCK",
876  ]
877
878  if (support_same_account) {
879    defines += [ "SUPPORT_SAME_ACCOUNT" ]
880  }
881}
882
883ohos_unittest("softbus_file_receive_listener_test") {
884  branch_protector_ret = "pac_ret"
885  sanitize = {
886    integer_overflow = true
887    cfi = true
888    cfi_cross_dso = true
889    debug = false
890  }
891
892  module_out_path = module_output_path
893
894  include_dirs = [
895    "${distributedfile_path}/services/distributedfiledaemon/include/ipc",
896    "${distributedfile_path}/services/distributedfiledaemon/include/network/softbus",
897    "${distributedfile_path}/services/distributedfiledaemon/test/mock/include",
898  ]
899
900  sources = [
901    "${services_path}/distributedfiledaemon/src/ipc/trans_mananger.cpp",
902    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_receive_listener.cpp",
903    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_send_listener.cpp",
904    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler.cpp",
905    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_listener.cpp",
906    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_pool.cpp",
907    "${services_path}/distributedfiledaemon/test/mock/all_connect_manager_mock.cpp",
908    "network/softbus/softbus_file_receive_listener_test.cpp",
909  ]
910
911  configs = [
912    ":module_private_config",
913    "${utils_path}:compiler_configs",
914  ]
915
916  deps = [
917    "${utils_path}:libdistributedfileutils",
918    "//third_party/googletest:gtest_main",
919  ]
920
921  external_deps = [
922    "app_file_service:sandbox_helper_native",
923    "c_utils:utils",
924    "device_manager:devicemanagersdk",
925    "dsoftbus:softbus_client",
926    "googletest:gmock_main",
927    "hilog:libhilog",
928    "hisysevent:libhisysevent",
929    "os_account:os_account_innerkits",
930  ]
931
932  defines = [ "private=public" ]
933
934  if (support_same_account) {
935    defines += [ "SUPPORT_SAME_ACCOUNT" ]
936  }
937}
938
939ohos_unittest("softbus_file_send_listener_test") {
940  branch_protector_ret = "pac_ret"
941  sanitize = {
942    integer_overflow = true
943    cfi = true
944    cfi_cross_dso = true
945    debug = false
946  }
947
948  module_out_path = module_output_path
949
950  include_dirs = [
951    "${distributedfile_path}/services/distributedfiledaemon/include/ipc",
952    "${distributedfile_path}/services/distributedfiledaemon/include/network/softbus",
953    "${distributedfile_path}/services/distributedfiledaemon/test/mock/include",
954  ]
955
956  sources = [
957    "${services_path}/distributedfiledaemon/src/ipc/trans_mananger.cpp",
958    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_receive_listener.cpp",
959    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_send_listener.cpp",
960    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler.cpp",
961    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_listener.cpp",
962    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_pool.cpp",
963    "${services_path}/distributedfiledaemon/test/mock/all_connect_manager_mock.cpp",
964    "network/softbus/softbus_file_send_listener_test.cpp",
965  ]
966
967  configs = [
968    ":module_private_config",
969    "${utils_path}:compiler_configs",
970  ]
971
972  deps = [
973    "${utils_path}:libdistributedfileutils",
974    "//third_party/googletest:gtest_main",
975  ]
976
977  external_deps = [
978    "app_file_service:sandbox_helper_native",
979    "c_utils:utils",
980    "device_manager:devicemanagersdk",
981    "dsoftbus:softbus_client",
982    "googletest:gmock_main",
983    "hilog:libhilog",
984    "hisysevent:libhisysevent",
985    "os_account:os_account_innerkits",
986  ]
987
988  defines = [ "private=public" ]
989
990  if (support_same_account) {
991    defines += [ "SUPPORT_SAME_ACCOUNT" ]
992  }
993}
994
995ohos_unittest("softbus_session_dispatcher_test") {
996  branch_protector_ret = "pac_ret"
997  sanitize = {
998    integer_overflow = true
999    cfi = true
1000    cfi_cross_dso = true
1001    debug = false
1002  }
1003
1004  module_out_path = module_output_path
1005
1006  sources = [
1007    "${distributedfile_path}/frameworks/native/distributed_file_inner/src/asset/asset_obj.cpp",
1008    "${services_path}/distributedfiledaemon/src/all_connect/all_connect_manager.cpp",
1009    "${services_path}/distributedfiledaemon/src/connect_count/connect_count.cpp",
1010    "${services_path}/distributedfiledaemon/src/device/device_info.cpp",
1011    "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp",
1012    "${services_path}/distributedfiledaemon/src/ipc/asset_callback_manager.cpp",
1013    "${services_path}/distributedfiledaemon/src/ipc/asset_recv_callback_proxy.cpp",
1014    "${services_path}/distributedfiledaemon/src/ipc/asset_send_callback_proxy.cpp",
1015    "${services_path}/distributedfiledaemon/src/ipc/connection_detector.cpp",
1016    "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp",
1017    "${services_path}/distributedfiledaemon/src/ipc/daemon_eventhandler.cpp",
1018    "${services_path}/distributedfiledaemon/src/ipc/daemon_execute.cpp",
1019    "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp",
1020    "${services_path}/distributedfiledaemon/src/ipc/file_trans_listener_proxy.cpp",
1021    "${services_path}/distributedfiledaemon/src/ipc/trans_mananger.cpp",
1022    "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp",
1023    "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp",
1024    "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp",
1025    "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp",
1026    "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp",
1027    "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp",
1028    "${services_path}/distributedfiledaemon/src/network/session_pool.cpp",
1029    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp",
1030    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_recv_listener.cpp",
1031    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_send_listener.cpp",
1032    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_receive_listener.cpp",
1033    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_send_listener.cpp",
1034    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler.cpp",
1035    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler_asset.cpp",
1036    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp",
1037    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp",
1038    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_listener.cpp",
1039    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_pool.cpp",
1040    "network/softbus/softbus_session_dispatcher_test.cpp",
1041  ]
1042
1043  configs = [
1044    ":module_private_config",
1045    "${utils_path}:compiler_configs",
1046  ]
1047
1048  deps = [
1049    "${utils_path}:libdistributedfileutils",
1050    "//third_party/googletest:gtest_main",
1051  ]
1052
1053  external_deps = [
1054    "ability_base:want",
1055    "ability_base:zuri",
1056    "access_token:libaccesstoken_sdk",
1057    "app_file_service:sandbox_helper_native",
1058    "c_utils:utils",
1059    "common_event_service:cesfwk_innerkits",
1060    "dataclassification:data_transit_mgr",
1061    "device_auth:deviceauth_sdk",
1062    "device_manager:devicemanagersdk",
1063    "dsoftbus:softbus_client",
1064    "eventhandler:libeventhandler",
1065    "hilog:libhilog",
1066    "hisysevent:libhisysevent",
1067    "init:libbegetutil",
1068    "ipc:ipc_single",
1069    "os_account:os_account_innerkits",
1070    "safwk:system_ability_fwk",
1071    "samgr:samgr_proxy",
1072    "storage_service:storage_manager_sa_proxy",
1073    "zlib:shared_libz",
1074  ]
1075
1076  defines = [ "private=public" ]
1077
1078  if (support_same_account) {
1079    defines += [ "SUPPORT_SAME_ACCOUNT" ]
1080  }
1081}
1082
1083ohos_unittest("softbus_session_test") {
1084  branch_protector_ret = "pac_ret"
1085  sanitize = {
1086    integer_overflow = true
1087    cfi = true
1088    cfi_cross_dso = true
1089    debug = false
1090  }
1091
1092  module_out_path = module_output_path
1093
1094  sources = [
1095    "${distributedfile_path}/frameworks/native/distributed_file_inner/src/asset/asset_obj.cpp",
1096    "${services_path}/distributedfiledaemon/src/all_connect/all_connect_manager.cpp",
1097    "${services_path}/distributedfiledaemon/src/connect_count/connect_count.cpp",
1098    "${services_path}/distributedfiledaemon/src/device/device_info.cpp",
1099    "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp",
1100    "${services_path}/distributedfiledaemon/src/ipc/asset_callback_manager.cpp",
1101    "${services_path}/distributedfiledaemon/src/ipc/asset_recv_callback_proxy.cpp",
1102    "${services_path}/distributedfiledaemon/src/ipc/asset_send_callback_proxy.cpp",
1103    "${services_path}/distributedfiledaemon/src/ipc/connection_detector.cpp",
1104    "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp",
1105    "${services_path}/distributedfiledaemon/src/ipc/daemon_eventhandler.cpp",
1106    "${services_path}/distributedfiledaemon/src/ipc/daemon_execute.cpp",
1107    "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp",
1108    "${services_path}/distributedfiledaemon/src/ipc/file_trans_listener_proxy.cpp",
1109    "${services_path}/distributedfiledaemon/src/ipc/trans_mananger.cpp",
1110    "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp",
1111    "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp",
1112    "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp",
1113    "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp",
1114    "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp",
1115    "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp",
1116    "${services_path}/distributedfiledaemon/src/network/session_pool.cpp",
1117    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp",
1118    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_recv_listener.cpp",
1119    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_send_listener.cpp",
1120    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_receive_listener.cpp",
1121    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_send_listener.cpp",
1122    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler.cpp",
1123    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler_asset.cpp",
1124    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp",
1125    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp",
1126    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_listener.cpp",
1127    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_pool.cpp",
1128    "network/softbus/softbus_session_test.cpp",
1129  ]
1130
1131  configs = [
1132    ":module_private_config",
1133    "${utils_path}:compiler_configs",
1134  ]
1135
1136  deps = [
1137    "${utils_path}:libdistributedfileutils",
1138    "//third_party/googletest:gtest_main",
1139  ]
1140
1141  external_deps = [
1142    "ability_base:want",
1143    "ability_base:zuri",
1144    "access_token:libaccesstoken_sdk",
1145    "app_file_service:sandbox_helper_native",
1146    "c_utils:utils",
1147    "common_event_service:cesfwk_innerkits",
1148    "dataclassification:data_transit_mgr",
1149    "device_auth:deviceauth_sdk",
1150    "device_manager:devicemanagersdk",
1151    "dsoftbus:softbus_client",
1152    "eventhandler:libeventhandler",
1153    "hilog:libhilog",
1154    "hisysevent:libhisysevent",
1155    "init:libbegetutil",
1156    "ipc:ipc_single",
1157    "os_account:os_account_innerkits",
1158    "safwk:system_ability_fwk",
1159    "samgr:samgr_proxy",
1160    "storage_service:storage_manager_sa_proxy",
1161    "zlib:shared_libz",
1162  ]
1163
1164  defines = [ "private=public" ]
1165
1166  if (support_same_account) {
1167    defines += [ "SUPPORT_SAME_ACCOUNT" ]
1168  }
1169}
1170
1171ohos_unittest("softbus_handler_asset_test") {
1172  branch_protector_ret = "pac_ret"
1173  sanitize = {
1174    integer_overflow = true
1175    cfi = true
1176    cfi_cross_dso = true
1177    debug = false
1178    blocklist = "${distributedfile_path}/cfi_blocklist.txt"
1179  }
1180
1181  module_out_path = module_output_path
1182
1183  include_dirs = [ "${distributedfile_path}/services/distributedfiledaemon/include/network/softbus" ]
1184
1185  sources = [
1186    "${distributedfile_path}/frameworks/native/distributed_file_inner/src/asset/asset_obj.cpp",
1187    "${distributedfile_path}/test/mock/device_manager_impl_mock.cpp",
1188    "${distributedfile_path}/test/mock/socket_mock.cpp",
1189    "${distributedfile_path}/test/mock/softbus_bus_center_mock.cpp",
1190    "${services_path}/distributedfiledaemon/src/ipc/trans_mananger.cpp",
1191    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_recv_listener.cpp",
1192    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_send_listener.cpp",
1193    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_receive_listener.cpp",
1194    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_send_listener.cpp",
1195    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler.cpp",
1196    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler_asset.cpp",
1197    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_listener.cpp",
1198    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_pool.cpp",
1199    "network/softbus/softbus_handler_asset_test.cpp",
1200  ]
1201
1202  configs = [
1203    ":module_private_config",
1204    "${utils_path}:compiler_configs",
1205  ]
1206
1207  deps = [
1208    "${services_path}/distributedfiledaemon:libdistributedfiledaemon",
1209    "${utils_path}:libdistributedfileutils",
1210    "//third_party/googletest:gmock_main",
1211    "//third_party/googletest:gtest_main",
1212  ]
1213
1214  external_deps = [
1215    "access_token:libaccesstoken_sdk",
1216    "app_file_service:sandbox_helper_native",
1217    "c_utils:utils",
1218    "device_manager:devicemanagersdk",
1219    "dsoftbus:softbus_client",
1220    "hilog:libhilog",
1221    "hisysevent:libhisysevent",
1222    "ipc:ipc_core",
1223    "os_account:os_account_innerkits",
1224    "zlib:shared_libz",
1225  ]
1226
1227  defines = [ "private=public" ]
1228
1229  if (support_same_account) {
1230    defines += [ "SUPPORT_SAME_ACCOUNT" ]
1231  }
1232}
1233
1234ohos_unittest("softbus_handler_test") {
1235  branch_protector_ret = "pac_ret"
1236  sanitize = {
1237    integer_overflow = true
1238    cfi = true
1239    cfi_cross_dso = true
1240    debug = false
1241    blocklist = "${distributedfile_path}/cfi_blocklist.txt"
1242  }
1243
1244  module_out_path = module_output_path
1245
1246  include_dirs = [
1247    "${distributedfile_path}/services/distributedfiledaemon/include/network/softbus",
1248    "${distributedfile_path}/services/distributedfiledaemon/test/mock/include",
1249  ]
1250
1251  sources = [
1252    "${distributedfile_path}/test/mock/socket_mock.cpp",
1253    "${services_path}/distributedfiledaemon/src/ipc/trans_mananger.cpp",
1254    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_receive_listener.cpp",
1255    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_send_listener.cpp",
1256    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler.cpp",
1257    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_listener.cpp",
1258    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_pool.cpp",
1259    "${services_path}/distributedfiledaemon/test/mock/all_connect_manager_mock.cpp",
1260    "network/softbus/softbus_handler_test.cpp",
1261  ]
1262
1263  configs = [
1264    ":module_private_config",
1265    "${utils_path}:compiler_configs",
1266  ]
1267
1268  deps = [
1269    "${utils_path}:libdistributedfileutils",
1270    "//third_party/googletest:gmock_main",
1271    "//third_party/googletest:gtest_main",
1272  ]
1273
1274  external_deps = [
1275    "access_token:libaccesstoken_sdk",
1276    "app_file_service:sandbox_helper_native",
1277    "c_utils:utils",
1278    "device_manager:devicemanagersdk",
1279    "dsoftbus:softbus_client",
1280    "hilog:libhilog",
1281    "hisysevent:libhisysevent",
1282    "os_account:os_account_innerkits",
1283  ]
1284
1285  defines = [ "private=public" ]
1286
1287  if (support_same_account) {
1288    defines += [ "SUPPORT_SAME_ACCOUNT" ]
1289  }
1290}
1291
1292ohos_unittest("softbus_session_pool_test") {
1293  branch_protector_ret = "pac_ret"
1294  sanitize = {
1295    integer_overflow = true
1296    cfi = true
1297    cfi_cross_dso = true
1298    debug = false
1299  }
1300
1301  module_out_path = module_output_path
1302
1303  include_dirs = [ "${distributedfile_path}/services/distributedfiledaemon/include/network/softbus" ]
1304
1305  sources = [
1306    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_pool.cpp",
1307    "network/softbus/softbus_session_pool_test.cpp",
1308  ]
1309
1310  configs = [
1311    ":module_private_config",
1312    "${utils_path}:compiler_configs",
1313  ]
1314
1315  deps = [
1316    "${utils_path}:libdistributedfileutils",
1317    "//third_party/googletest:gtest_main",
1318  ]
1319
1320  external_deps = [
1321    "access_token:libaccesstoken_sdk",
1322    "c_utils:utils",
1323    "dsoftbus:softbus_client",
1324    "hilog:libhilog",
1325  ]
1326}
1327
1328ohos_unittest("softbus_session_listener_test") {
1329  branch_protector_ret = "pac_ret"
1330  sanitize = {
1331    integer_overflow = true
1332    cfi = true
1333    cfi_cross_dso = true
1334    debug = false
1335    blocklist = "${distributedfile_path}/cfi_blocklist.txt"
1336  }
1337
1338  module_out_path = module_output_path
1339
1340  include_dirs = [
1341    "${distributedfile_path}/services/distributedfiledaemon/include/network/softbus",
1342    "${distributedfile_path}/services/distributedfiledaemon/test/mock/include",
1343  ]
1344
1345  sources = [
1346    "${distributedfile_path}/test/mock/socket_mock.cpp",
1347    "${services_path}/distributedfiledaemon/src/ipc/trans_mananger.cpp",
1348    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_receive_listener.cpp",
1349    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_send_listener.cpp",
1350    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler.cpp",
1351    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_listener.cpp",
1352    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_pool.cpp",
1353    "${services_path}/distributedfiledaemon/test/mock/all_connect_manager_mock.cpp",
1354    "network/softbus/softbus_session_listener_test.cpp",
1355  ]
1356
1357  configs = [
1358    ":module_private_config",
1359    "${utils_path}:compiler_configs",
1360  ]
1361
1362  deps = [
1363    "${utils_path}:libdistributedfileutils",
1364    "//third_party/googletest:gmock_main",
1365    "//third_party/googletest:gtest_main",
1366  ]
1367
1368  external_deps = [
1369    "ability_base:zuri",
1370    "access_token:libaccesstoken_sdk",
1371    "app_file_service:sandbox_helper_native",
1372    "c_utils:utils",
1373    "device_manager:devicemanagersdk",
1374    "dsoftbus:softbus_client",
1375    "hilog:libhilog",
1376    "hisysevent:libhisysevent",
1377    "os_account:os_account_innerkits",
1378  ]
1379
1380  defines = [ "private=public" ]
1381}
1382
1383ohos_unittest("softbus_asset_recv_listener_test") {
1384  branch_protector_ret = "pac_ret"
1385  sanitize = {
1386    integer_overflow = true
1387    cfi = true
1388    cfi_cross_dso = true
1389    debug = false
1390  }
1391
1392  module_out_path = module_output_path
1393
1394  include_dirs = [
1395    "${distributedfile_path}/frameworks/native/distributed_file_inner/include/asset",
1396    "${distributedfile_path}/services/distributedfiledaemon/include/ipc",
1397    "${distributedfile_path}/services/distributedfiledaemon/include/network/softbus",
1398    "${distributedfile_path}/services/distributedfiledaemon/test/mock/include",
1399  ]
1400
1401  sources = [
1402    "${distributedfile_path}/frameworks/native/distributed_file_inner/src/asset/asset_obj.cpp",
1403    "${services_path}/distributedfiledaemon/src/ipc/asset_callback_manager.cpp",
1404    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_recv_listener.cpp",
1405    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_send_listener.cpp",
1406    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler_asset.cpp",
1407    "${services_path}/distributedfiledaemon/test/mock/all_connect_manager_mock.cpp",
1408    "network/softbus/softbus_asset_recv_listener_test.cpp",
1409  ]
1410
1411  configs = [
1412    ":module_private_config",
1413    "${utils_path}:compiler_configs",
1414  ]
1415
1416  deps = [
1417    "${utils_path}:libdistributedfileutils",
1418    "//third_party/googletest:gtest_main",
1419  ]
1420
1421  external_deps = [
1422    "access_token:libaccesstoken_sdk",
1423    "c_utils:utils",
1424    "device_manager:devicemanagersdk",
1425    "dsoftbus:softbus_client",
1426    "googletest:gmock_main",
1427    "hilog:libhilog",
1428    "os_account:os_account_innerkits",
1429    "zlib:shared_libz",
1430  ]
1431
1432  defines = [ "private=public" ]
1433}
1434
1435ohos_unittest("softbus_asset_send_listener_test") {
1436  branch_protector_ret = "pac_ret"
1437  sanitize = {
1438    integer_overflow = true
1439    cfi = true
1440    cfi_cross_dso = true
1441    debug = false
1442  }
1443
1444  module_out_path = module_output_path
1445
1446  include_dirs = [
1447    "${distributedfile_path}/frameworks/native/distributed_file_inner/include/asset",
1448    "${distributedfile_path}/services/distributedfiledaemon/include/ipc",
1449    "${distributedfile_path}/services/distributedfiledaemon/include/network/softbus",
1450    "${distributedfile_path}/services/distributedfiledaemon/test/mock/include",
1451  ]
1452
1453  sources = [
1454    "${distributedfile_path}/frameworks/native/distributed_file_inner/src/asset/asset_obj.cpp",
1455    "${services_path}/distributedfiledaemon/src/ipc/asset_callback_manager.cpp",
1456    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_recv_listener.cpp",
1457    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_send_listener.cpp",
1458    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler_asset.cpp",
1459    "${services_path}/distributedfiledaemon/test/mock/all_connect_manager_mock.cpp",
1460    "network/softbus/softbus_asset_send_listener_test.cpp",
1461  ]
1462
1463  configs = [
1464    ":module_private_config",
1465    "${utils_path}:compiler_configs",
1466  ]
1467
1468  deps = [
1469    "${utils_path}:libdistributedfileutils",
1470    "//third_party/googletest:gmock_main",
1471    "//third_party/googletest:gtest_main",
1472  ]
1473
1474  external_deps = [
1475    "access_token:libaccesstoken_sdk",
1476    "c_utils:utils",
1477    "device_manager:devicemanagersdk",
1478    "dsoftbus:softbus_client",
1479    "hilog:libhilog",
1480    "os_account:os_account_innerkits",
1481    "zlib:shared_libz",
1482  ]
1483
1484  defines = [ "private=public" ]
1485}
1486
1487group("unittest") {
1488  testonly = true
1489  deps = [
1490    ":device_info_test",
1491    ":device_manager_agent_sup_test",
1492    ":device_manager_agent_test",
1493    ":devsl_dispatcher_test",
1494    ":kernel_talker_test",
1495    ":os_account_observer_test",
1496    ":softbus_agent_sup_test",
1497    ":softbus_agent_test",
1498    ":softbus_asset_recv_listener_test",
1499    ":softbus_asset_send_listener_test",
1500    ":softbus_file_receive_listener_test",
1501    ":softbus_file_send_listener_test",
1502    ":softbus_handler_asset_test",
1503    ":softbus_handler_test",
1504    ":softbus_session_dispatcher_test",
1505    ":softbus_session_listener_test",
1506    ":softbus_session_pool_test",
1507    ":softbus_session_test",
1508  ]
1509}
1510