• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 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.
13
14#####################hydra-fuzz###################
15import("//build/config/features.gni")
16import("//build/test.gni")
17import("//foundation/distributedhardware/device_manager/device_manager.gni")
18
19##############################fuzztest##########################################
20ohos_fuzztest("IpcClientManagerFuzzTest") {
21  module_out_path = "device_manager/devicemanager"
22  fuzz_config_file = "//foundation/distributedhardware/device_manager/test/fuzztest/ipcclientmanager_fuzzer"
23
24  include_dirs = [
25    "//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp/include",
26    "//third_party/node/src",
27    "//foundation/arkui/napi/native_engine",
28    "//foundation/arkui/napi/interfaces/kits",
29    "//commonlibrary/c_utils/base/include",
30    "//utils/system/safwk/native/include",
31    "${innerkits_path}/native_cpp/include",
32    "${innerkits_path}/native_cpp/include/ipc/standard",
33    "${innerkits_path}/native_cpp/include/ipc",
34    "${innerkits_path}/native_cpp/include/notify",
35    "//third_party/json/include",
36    "${common_path}/include",
37    "${common_path}/include/ipc",
38    "${common_path}/include/ipc/model",
39    "${utils_path}/include",
40    "${utils_path}/include/ipc/standard",
41    "${servicesimpl_path}/include/dependency/timer",
42    "${servicesimpl_path}/include/dependency/softbus",
43    "${servicesimpl_path}/include/authentication",
44    "${servicesimpl_path}/include/adapter",
45    "${servicesimpl_path}/include",
46    "${services_path}/include/ipc/standard",
47    "${servicesimpl_path}/include/discovery",
48    "${servicesimpl_path}/include/dependency/hichain",
49    "${servicesimpl_path}/include/deviceinfo",
50    "${servicesimpl_path}/include/devicestate",
51    "//foundation/communication/dsoftbus/interfaces/kits/bus_center",
52    "//foundation/communication/softbus_lite/interfaces/kits/transport",
53    "//foundation/communication/dsoftbus/interfaces/kits/common",
54    "//foundation/communication/dsoftbus/interfaces/kits/discovery",
55    "//foundation/communication/dsoftbus/interfaces/inner_kits/transport",
56    "//foundation/distributedhardware/device_manager/test/unittest/mock",
57    "//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk",
58    "//base/security/device_auth/interfaces/innerkits",
59    "${servicesimpl_path}/include/ability",
60    "${servicesimpl_path}/include/config",
61    "//commonlibrary/utils_lite/include",
62    "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits/hilog",
63    "//third_party/bounds_checking_function/include",
64    "//foundation/systemabilitymgr/samgr_lite/interfaces/kits/samgr",
65    "//foundation/systemabilitymgr/samgr_lite/interfaces/kits/registry",
66    "//third_party/json/include",
67    "//foundation/arkui/napi/interfaces/inner_api/napi",
68    "//foundation/arkui/napi/interfaces/inner_api",
69    "//third_party/jsframework/runtime/main/extend",
70    "//third_party/jsframework/runtime/main/extend/systemplugin",
71    "//third_party/node/benchmark",
72    "//third_party/libuv/include",
73    "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include/",
74  ]
75  cflags = [
76    "-g",
77    "-O0",
78    "-Wno-unused-variable",
79    "-fno-omit-frame-pointer",
80  ]
81  sources = [
82    "${innerkits_path}/native_cpp/src/ipc/standard/ipc_client_manager.cpp",
83    "ipc_client_manager_fuzzer.cpp",
84  ]
85
86  deps = [
87    "${ability_runtime_services_path}/abilitymgr:abilityms",
88    "${innerkits_path}/native_cpp:devicemanagersdk",
89    "${utils_path}:devicemanagerutils",
90    "//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp:devicemanagersdk",
91  ]
92
93  defines = [
94    "HI_LOG_ENABLE",
95    "DH_LOG_TAG=\"IpcClientManagerFuzzTest\"",
96    "LOG_DOMAIN=0xD004100",
97  ]
98
99  external_deps = [
100    "ipc:ipc_core",
101    "samgr:samgr_proxy",
102  ]
103
104  public_deps = [
105    "${innerkits_path}/native_cpp:devicemanagersdk",
106    "//commonlibrary/c_utils/base:utils",
107    "//foundation/communication/ipc/interfaces/innerkits/ipc_core:ipc_core",
108    "//foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy",
109    "//third_party/googletest:gmock",
110    "//third_party/googletest:gtest",
111  ]
112}
113
114###############################################################################
115group("fuzztest") {
116  testonly = true
117
118  deps = [ ":IpcClientManagerFuzzTest" ]
119}
120###############################################################################
121