1# Copyright (C) 2021 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 "${services_path}/distributedfiledaemon/include", 23 "//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp/include", 24 "//base/security/device_auth/interfaces/innerkits", 25 "//third_party/json/include", 26 ] 27} 28 29ohos_unittest("device_manager_agent_test") { 30 module_out_path = module_output_path 31 32 sources = [ 33 "${services_path}/distributedfiledaemon/src/device/device_info.cpp", 34 "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp", 35 "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp", 36 "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp", 37 "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp", 38 "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp", 39 "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp", 40 "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp", 41 "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp", 42 "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp", 43 "${services_path}/distributedfiledaemon/src/network/session_pool.cpp", 44 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp", 45 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp", 46 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp", 47 ] 48 49 sources += [ "device/device_manager_agent_test.cpp" ] 50 51 configs = [ 52 ":module_private_config", 53 "${utils_path}:compiler_configs", 54 ] 55 56 deps = [ 57 "${utils_path}:libdistributedfileutils", 58 "//base/security/device_auth/services:deviceauth_sdk", 59 "//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp:devicemanagersdk", 60 "//third_party/googletest:gtest_main", 61 ] 62 63 external_deps = [ 64 "ability_base:want", 65 "common_event_service:cesfwk_innerkits", 66 "dataclassification:data_transit_mgr", 67 "dsoftbus:softbus_client", 68 "init:libbegetutil", 69 "ipc:ipc_core", 70 "safwk:system_ability_fwk", 71 "samgr:samgr_proxy", 72 ] 73 74 defines = [ "private=public" ] 75} 76 77ohos_unittest("daemon_stub_test") { 78 module_out_path = module_output_path 79 80 sources = [ 81 "${services_path}/distributedfiledaemon/src/device/device_info.cpp", 82 "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp", 83 "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp", 84 "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp", 85 "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp", 86 "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp", 87 "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp", 88 "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp", 89 "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp", 90 "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp", 91 "${services_path}/distributedfiledaemon/src/network/session_pool.cpp", 92 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp", 93 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp", 94 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp", 95 ] 96 97 sources += [ "ipc/daemon_stub_test.cpp" ] 98 99 configs = [ 100 ":module_private_config", 101 "${utils_path}:compiler_configs", 102 ] 103 104 deps = [ 105 "${utils_path}:libdistributedfileutils", 106 "//base/security/device_auth/services:deviceauth_sdk", 107 "//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp:devicemanagersdk", 108 "//third_party/googletest:gmock_main", 109 "//third_party/googletest:gtest_main", 110 ] 111 112 external_deps = [ 113 "ability_base:want", 114 "common_event_service:cesfwk_innerkits", 115 "dataclassification:data_transit_mgr", 116 "dsoftbus:softbus_client", 117 "init:libbegetutil", 118 "ipc:ipc_core", 119 "safwk:system_ability_fwk", 120 "samgr:samgr_proxy", 121 ] 122 123 defines = [ "private=public" ] 124} 125 126ohos_unittest("daemon_test") { 127 module_out_path = module_output_path 128 129 sources = [ 130 "${services_path}/distributedfiledaemon/src/device/device_info.cpp", 131 "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp", 132 "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp", 133 "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp", 134 "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp", 135 "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp", 136 "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp", 137 "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp", 138 "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp", 139 "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp", 140 "${services_path}/distributedfiledaemon/src/network/session_pool.cpp", 141 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp", 142 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp", 143 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp", 144 ] 145 146 sources += [ "ipc/daemon_test.cpp" ] 147 148 configs = [ 149 ":module_private_config", 150 "${utils_path}:compiler_configs", 151 ] 152 153 deps = [ 154 "${utils_path}:libdistributedfileutils", 155 "//base/security/device_auth/services:deviceauth_sdk", 156 "//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp:devicemanagersdk", 157 "//third_party/googletest:gtest_main", 158 ] 159 160 external_deps = [ 161 "ability_base:want", 162 "common_event_service:cesfwk_innerkits", 163 "dataclassification:data_transit_mgr", 164 "dsoftbus:softbus_client", 165 "init:libbegetutil", 166 "ipc:ipc_core", 167 "safwk:system_ability_fwk", 168 "samgr:samgr_proxy", 169 ] 170 171 defines = [ "private=public" ] 172} 173 174ohos_unittest("os_account_observer_test") { 175 module_out_path = module_output_path 176 177 sources = [ 178 "${services_path}/distributedfiledaemon/src/device/device_info.cpp", 179 "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp", 180 "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp", 181 "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp", 182 "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp", 183 "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp", 184 "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp", 185 "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp", 186 "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp", 187 "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp", 188 "${services_path}/distributedfiledaemon/src/network/session_pool.cpp", 189 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp", 190 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp", 191 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp", 192 ] 193 194 sources += [ "multiuser/os_account_observer_test.cpp" ] 195 196 configs = [ 197 ":module_private_config", 198 "${utils_path}:compiler_configs", 199 ] 200 201 deps = [ 202 "${utils_path}:libdistributedfileutils", 203 "//base/security/device_auth/services:deviceauth_sdk", 204 "//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp:devicemanagersdk", 205 "//third_party/googletest:gtest_main", 206 ] 207 208 external_deps = [ 209 "ability_base:want", 210 "common_event_service:cesfwk_innerkits", 211 "dataclassification:data_transit_mgr", 212 "dsoftbus:softbus_client", 213 "init:libbegetutil", 214 "ipc:ipc_core", 215 "safwk:system_ability_fwk", 216 "samgr:samgr_proxy", 217 ] 218 219 defines = [ "private=public" ] 220} 221 222ohos_unittest("devsl_dispatcher_test") { 223 module_out_path = module_output_path 224 225 sources = [ 226 "${services_path}/distributedfiledaemon/src/device/device_info.cpp", 227 "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp", 228 "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp", 229 "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp", 230 "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp", 231 "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp", 232 "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp", 233 "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp", 234 "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp", 235 "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp", 236 "${services_path}/distributedfiledaemon/src/network/session_pool.cpp", 237 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp", 238 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp", 239 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp", 240 "network/devsl_dispatcher_test.cpp", 241 ] 242 243 configs = [ 244 ":module_private_config", 245 "${utils_path}:compiler_configs", 246 ] 247 248 deps = [ 249 "${utils_path}:libdistributedfileutils", 250 "//base/security/device_auth/services:deviceauth_sdk", 251 "//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp:devicemanagersdk", 252 "//third_party/googletest:gtest_main", 253 ] 254 255 external_deps = [ 256 "ability_base:want", 257 "common_event_service:cesfwk_innerkits", 258 "dataclassification:data_transit_mgr", 259 "dsoftbus:softbus_client", 260 "init:libbegetutil", 261 "ipc:ipc_core", 262 "safwk:system_ability_fwk", 263 "samgr:samgr_proxy", 264 ] 265 266 defines = [ "private=public" ] 267} 268 269ohos_unittest("kernel_talker_test") { 270 module_out_path = module_output_path 271 272 sources = [ 273 "${services_path}/distributedfiledaemon/src/device/device_info.cpp", 274 "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp", 275 "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp", 276 "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp", 277 "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp", 278 "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp", 279 "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp", 280 "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp", 281 "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp", 282 "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp", 283 "${services_path}/distributedfiledaemon/src/network/session_pool.cpp", 284 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp", 285 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp", 286 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp", 287 "network/kernel_talker_test.cpp", 288 ] 289 290 configs = [ 291 ":module_private_config", 292 "${utils_path}:compiler_configs", 293 ] 294 295 deps = [ 296 "${utils_path}:libdistributedfileutils", 297 "//base/security/device_auth/services:deviceauth_sdk", 298 "//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp:devicemanagersdk", 299 "//third_party/googletest:gtest_main", 300 ] 301 302 external_deps = [ 303 "ability_base:want", 304 "common_event_service:cesfwk_innerkits", 305 "dataclassification:data_transit_mgr", 306 "dsoftbus:softbus_client", 307 "init:libbegetutil", 308 "ipc:ipc_core", 309 "safwk:system_ability_fwk", 310 "samgr:samgr_proxy", 311 ] 312 313 defines = [ "private=public" ] 314} 315 316ohos_unittest("session_pool_test") { 317 module_out_path = module_output_path 318 319 sources = [ 320 "${services_path}/distributedfiledaemon/src/device/device_info.cpp", 321 "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp", 322 "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp", 323 "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp", 324 "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp", 325 "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp", 326 "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp", 327 "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp", 328 "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp", 329 "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp", 330 "${services_path}/distributedfiledaemon/src/network/session_pool.cpp", 331 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp", 332 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp", 333 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp", 334 "network/session_pool_test.cpp", 335 ] 336 337 configs = [ 338 ":module_private_config", 339 "${utils_path}:compiler_configs", 340 ] 341 342 deps = [ 343 "${utils_path}:libdistributedfileutils", 344 "//base/security/device_auth/services:deviceauth_sdk", 345 "//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp:devicemanagersdk", 346 "//third_party/googletest:gtest_main", 347 ] 348 349 external_deps = [ 350 "ability_base:want", 351 "common_event_service:cesfwk_innerkits", 352 "dataclassification:data_transit_mgr", 353 "dsoftbus:softbus_client", 354 "init:libbegetutil", 355 "ipc:ipc_core", 356 "safwk:system_ability_fwk", 357 "samgr:samgr_proxy", 358 ] 359 360 defines = [ "private=public" ] 361} 362 363ohos_unittest("softbus_agent_test") { 364 module_out_path = module_output_path 365 366 sources = [ 367 "${services_path}/distributedfiledaemon/src/device/device_info.cpp", 368 "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp", 369 "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp", 370 "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp", 371 "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp", 372 "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp", 373 "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp", 374 "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp", 375 "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp", 376 "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp", 377 "${services_path}/distributedfiledaemon/src/network/session_pool.cpp", 378 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp", 379 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp", 380 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp", 381 "network/softbus_agent_test.cpp", 382 ] 383 384 configs = [ 385 ":module_private_config", 386 "${utils_path}:compiler_configs", 387 ] 388 389 deps = [ 390 "${utils_path}:libdistributedfileutils", 391 "//base/security/device_auth/services:deviceauth_sdk", 392 "//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp:devicemanagersdk", 393 "//third_party/googletest:gtest_main", 394 ] 395 396 external_deps = [ 397 "ability_base:want", 398 "common_event_service:cesfwk_innerkits", 399 "dataclassification:data_transit_mgr", 400 "dsoftbus:softbus_client", 401 "init:libbegetutil", 402 "ipc:ipc_core", 403 "safwk:system_ability_fwk", 404 "samgr:samgr_proxy", 405 ] 406 407 defines = [ "private=public" ] 408} 409 410ohos_unittest("softbus_session_dispatcher_test") { 411 module_out_path = module_output_path 412 413 sources = [ 414 "${services_path}/distributedfiledaemon/src/device/device_info.cpp", 415 "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp", 416 "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp", 417 "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp", 418 "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp", 419 "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp", 420 "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp", 421 "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp", 422 "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp", 423 "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp", 424 "${services_path}/distributedfiledaemon/src/network/session_pool.cpp", 425 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp", 426 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp", 427 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp", 428 "network/softbus_session_dispatcher_test.cpp", 429 ] 430 431 configs = [ 432 ":module_private_config", 433 "${utils_path}:compiler_configs", 434 ] 435 436 deps = [ 437 "${utils_path}:libdistributedfileutils", 438 "//base/security/device_auth/services:deviceauth_sdk", 439 "//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp:devicemanagersdk", 440 "//third_party/googletest:gtest_main", 441 ] 442 443 external_deps = [ 444 "ability_base:want", 445 "common_event_service:cesfwk_innerkits", 446 "dataclassification:data_transit_mgr", 447 "dsoftbus:softbus_client", 448 "init:libbegetutil", 449 "ipc:ipc_core", 450 "safwk:system_ability_fwk", 451 "samgr:samgr_proxy", 452 ] 453 454 defines = [ "private=public" ] 455} 456 457ohos_unittest("softbus_session_test") { 458 module_out_path = module_output_path 459 460 sources = [ 461 "${services_path}/distributedfiledaemon/src/device/device_info.cpp", 462 "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp", 463 "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp", 464 "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp", 465 "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp", 466 "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp", 467 "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp", 468 "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp", 469 "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp", 470 "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp", 471 "${services_path}/distributedfiledaemon/src/network/session_pool.cpp", 472 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp", 473 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp", 474 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp", 475 "network/softbus_session_test.cpp", 476 ] 477 478 configs = [ 479 ":module_private_config", 480 "${utils_path}:compiler_configs", 481 ] 482 483 deps = [ 484 "${utils_path}:libdistributedfileutils", 485 "//base/security/device_auth/services:deviceauth_sdk", 486 "//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp:devicemanagersdk", 487 "//third_party/googletest:gtest_main", 488 ] 489 490 external_deps = [ 491 "ability_base:want", 492 "common_event_service:cesfwk_innerkits", 493 "dataclassification:data_transit_mgr", 494 "dsoftbus:softbus_client", 495 "init:libbegetutil", 496 "ipc:ipc_core", 497 "safwk:system_ability_fwk", 498 "samgr:samgr_proxy", 499 ] 500 501 defines = [ "private=public" ] 502} 503 504group("unittest") { 505 testonly = true 506 deps = [ 507 ":daemon_stub_test", 508 ":daemon_test", 509 ":device_manager_agent_test", 510 ":devsl_dispatcher_test", 511 ":kernel_talker_test", 512 ":os_account_observer_test", 513 ":session_pool_test", 514 ":softbus_session_dispatcher_test", 515 ":softbus_session_test", 516 ] 517} 518