• 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/communication/netmanager_ext/netmanager_ext_config.gni")
18##############################fuzztest##########################################
19ohos_fuzztest("NetShareClientFuzzTest") {
20  module_out_path = "communication/netmanager_ext"
21  fuzz_config_file = "$NETMANAGER_EXT_ROOT/test/networksharemanager/fuzztest/netshareclient_fuzzer"
22
23  include_dirs = [
24    "$DHCP_MANAGER_ROOT/services/mgr_service/include",
25    "$DHCP_MANAGER_ROOT/interfaces/inner_api/include",
26    "$DHCP_MANAGER_ROOT/interfaces/inner_api/interfaces",
27    "$DHCP_MANAGER_ROOT/interfaces/inner_api/interfaces",
28    "$DHCP_MANAGER_ROOT/interfaces/inner_api/include",
29    "$EXT_INNERKITS_ROOT/ethernetclient/include",
30    "$EXT_INNERKITS_ROOT/netshareclient/include",
31    "$EXT_INNERKITS_ROOT/netshareclient/include/proxy",
32    "$EXT_INNERKITS_ROOT/netshareclient/include/proxy/ipccallback",
33    "$EXT_INNERKITS_ROOT/include",
34    "$EXT_INNERKITS_ROOT/include/proxy",
35    "$NETMANAGER_EXT_ROOT/utils/log/include",
36    "$NETWORKSHAREMANAGER_SOURCE_DIR/include",
37    "$NETWORKSHAREMANAGER_SOURCE_DIR/include/stub",
38    "$NETWORKSHAREMANAGER_UTILS_DIR/event_report/include",
39    "$NETSYSCONTROLLER_ROOT_DIR/include",
40    "$WIFI_MANAGER_ROOT/frameworks/native/include",
41    "$WIFI_MANAGER_ROOT/frameworks/native/interfaces",
42  ]
43
44  cflags = [
45    "-g",
46    "-O0",
47    "-Wno-unused-variable",
48    "-fno-omit-frame-pointer",
49  ]
50
51  sources = [ "netshare_client_fuzzer.cpp" ]
52
53  deps = [
54    "$BASE_INNERKITS_ROOT/netconnclient:net_conn_manager_if",
55    "$DHCP_MANAGER_ROOT/services/mgr_service:dhcp_manager_service",
56    "$NETMANAGER_BASE_ROOT/utils:net_manager_common",
57    "$NETMANAGER_EXT_ROOT/services/networksharemanager:net_tether_manager",
58    "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller",
59  ]
60
61  external_deps = [
62    "access_token:libaccesstoken_sdk",
63    "access_token:libtoken_setproc",
64    "c_utils:utils",
65    "ipc:ipc_core",
66    "safwk:system_ability_fwk",
67    "wifi:wifi_sdk",
68  ]
69  if (is_standard_system) {
70    external_deps += [ "hiviewdfx_hilog_native:libhilog" ]
71  } else {
72    external_deps += [ "hilog:libhilog" ]
73  }
74
75  defines = [
76    "NETMGR_LOG_TAG = \"NetShareManager\"",
77    "LOG_DOMAIN = 0xD0015B0",
78  ]
79
80  if (!defined(global_parts_info) ||
81      defined(global_parts_info.communication_bluetooth)) {
82    defines += [ "BLUETOOTH_MODOULE=1" ]
83    external_deps += [ "bluetooth:btframework" ]
84  }
85
86}
87
88###############################################################################
89group("fuzztest") {
90  testonly = true
91
92  deps = [ ":NetShareClientFuzzTest" ]
93}
94###############################################################################
95