• 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("EthernetClientFuzzTest") {
20  module_out_path = "communication/netmanager_ext"
21  fuzz_config_file =
22      "$NETMANAGER_EXT_ROOT/test/ethernetmanager/fuzztest/ethernetclient_fuzzer"
23
24  include_dirs = [
25    "$EXT_INNERKITS_ROOT/include",
26    "$EXT_INNERKITS_ROOT/ethernetclient/include",
27    "$EXT_INNERKITS_ROOT/ethernetclient/include/proxy",
28    "$NETMANAGER_EXT_ROOT/utils/log/include",
29    "$ETHERNETMANAGER_SOURCE_DIR/include",
30    "$DHCP_MANAGER_ROOT/services/mgr_service/include",
31    "$DHCP_MANAGER_ROOT/interfaces/inner_api/include",
32    "$DHCP_MANAGER_ROOT/interfaces/inner_api/interfaces",
33    "$BASE_INNERKITS_ROOT/netmanagernative/include",
34    "$BASE_INNERKITS_ROOT/include",
35    "$BASE_INNERKITS_ROOT/dnsresolverclient/include",
36    "$BASE_INNERKITS_ROOT/netconnclient/include",
37    "$NETSYSCONTROLLER_ROOT_DIR/include",
38    "$NETCONNMANAGER_COMMON_DIR/include",
39    "$ETHERNETMANAGER_SOURCE_DIR/include/stub",
40  ]
41
42  cflags = [
43    "-g",
44    "-O0",
45    "-Wno-unused-variable",
46    "-fno-omit-frame-pointer",
47  ]
48
49  sources = [ "ethernet_client_fuzzer.cpp" ]
50
51  deps = [
52    "$DHCP_MANAGER_ROOT/services/mgr_service:dhcp_manager_service",
53    "$ETHERNETMANAGER_SOURCE_DIR:ethernet_manager",
54    "$EXT_INNERKITS_ROOT/ethernetclient:ethernet_manager_if",
55    "$NETMANAGER_EXT_ROOT/utils:net_manager_ext_common",
56    "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller",
57    "$THIRD_PARTY_ROOT/json:nlohmann_json_static",
58  ]
59
60  external_deps = [
61    "access_token:libaccesstoken_sdk",
62    "access_token:libtoken_setproc",
63    "ipc:ipc_core",
64  ]
65  if (is_standard_system) {
66    external_deps += [ "hiviewdfx_hilog_native:libhilog" ]
67  } else {
68    external_deps += [ "hilog:libhilog" ]
69  }
70
71  defines = [
72    "NETMGR_LOG_TAG = \"EthernetManager\"",
73    "LOG_DOMAIN = 0xD0015B0",
74  ]
75}
76
77###############################################################################
78group("fuzztest") {
79  testonly = true
80
81  deps = [ ":EthernetClientFuzzTest" ]
82}
83###############################################################################
84