• 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
14import("//build/config/features.gni")
15
16#####################hydra-fuzz###################
17import("//build/test.gni")
18import("//foundation/communication/netmanager_base/netmanager_base_config.gni")
19
20##############################fuzztest##########################################
21ohos_fuzztest("CommonFuzzTest") {
22  module_out_path = "netmanager_base/common_fuzz_client"
23  fuzz_config_file = "$NETMANAGER_BASE_ROOT/test/fuzztest/common_fuzzer"
24
25  include_dirs = [
26    "$ETHERNETMANAGER_SOURCE_DIR/include",
27    "$INNERKITS_ROOT/include",
28    "$INNERKITS_ROOT/netmanagernative/include",
29    "$INNERKITS_ROOT/netpolicyclient/include",
30    "$INNERKITS_ROOT/netpolicyclient/include/proxy",
31    "$INNERKITS_ROOT/netstatsclient/include",
32    "$NETCONNMANAGER_SOURCE_DIR/include",
33    "$NETMANAGER_BASE_ROOT/services/common/include",
34    "$NETPOLICYMANAGER_SOURCE_DIR/include",
35    "$NETPOLICYMANAGER_SOURCE_DIR/include/stub",
36    "$NETSYSCONTROLLER_ROOT_DIR/include",
37    "$NETSYSNATIVE_INNERKITS_SOURCE_DIR",
38  ]
39
40  cflags = [
41    "-g",
42    "-O0",
43    "-Wno-unused-variable",
44    "-fno-omit-frame-pointer",
45  ]
46  sources = [ "common_fuzzer.cpp" ]
47
48  deps = [
49    "$ETHERNETMANAGER_SOURCE_DIR:ethernet_manager",
50    "$INNERKITS_ROOT/netpolicyclient:net_policy_manager_if",
51    "$INNERKITS_ROOT/netstatsclient:net_stats_manager_if",
52    "$NETCONNMANAGER_COMMON_DIR:net_service_common",
53    "$NETCONNMANAGER_SOURCE_DIR:net_conn_manager",
54    "$NETMANAGER_BASE_ROOT/services/netpolicymanager:net_policy_manager",
55    "$NETMANAGER_BASE_ROOT/utils:net_manager_common",
56    "$THIRD_PARTY_ROOT/jsoncpp:jsoncpp",
57  ]
58
59  defines = [
60    "HI_LOG_ENABLE",
61    "DH_LOG_TAG=\"NetPolicyClientFuzzTest\"",
62    "LOG_DOMAIN=0xD004100",
63  ]
64
65  external_deps = [
66    "bundle_framework:appexecfwk_base",
67    "bundle_framework:appexecfwk_core",
68    "common_event_service:cesfwk_innerkits",
69    "eventhandler:libeventhandler",
70    "hitrace_native:hitrace_meter",
71    "hiviewdfx_hilog_native:libhilog",
72    "init:libbegetutil",
73    "ipc:ipc_core",
74    "safwk:system_ability_fwk",
75    "samgr:samgr_proxy",
76  ]
77}
78
79###############################################################################
80group("fuzztest") {
81  testonly = true
82
83  deps = [ ":CommonFuzzTest" ]
84}
85
86###############################################################################
87
88