1# Copyright (c) 2024 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("NetBaseBranchFuzzTest") {
22  module_out_path = fuzz_test_path
23  fuzz_config_file = "$NETMANAGER_BASE_ROOT/test/fuzztest/netbasebranch_fuzzer"
24
25  include_dirs = [
26    "$INNERKITS_ROOT/include",
27    "$INNERKITS_ROOT/netconnclient/include",
28    "$INNERKITS_ROOT/netconnclient/include/proxy",
29    "$INNERKITS_ROOT/netmanagernative/include",
30    "$INNERKITS_ROOT/netpolicyclient/include",
31    "$INNERKITS_ROOT/netpolicyclient/include/proxy",
32    "$NETCONNMANAGER_SOURCE_DIR/include/stub",
33    "$NETCONNMANAGER_SOURCE_DIR/include",
34    "$SAMGR_MANAGER_ROOT/interfaces/innerkits/samgr_proxy/include",
35    "$NETMANAGERNATIVE_ROOT/net_mgr_native/include",
36    "$NETMANAGERNATIVE_ROOT/common/include",
37    "$NETMANAGER_BASE_ROOT/services/netpolicymanager/include",
38    "$NETMANAGER_BASE_ROOT/services/common/include",
39    "$NETMANAGER_BASE_ROOT/test/commonduplicatedcode",
40    "$NETMANAGER_BASE_ROOT/test/security",
41    "$NETSYSCONTROLLER_ROOT_DIR/include",
42    "$THIRD_PARTY_ROOT/curl/include",
43  ]
44
45  cflags = [
46    "-g",
47    "-O0",
48    "-Wno-unused-variable",
49    "-fno-omit-frame-pointer",
50  ]
51
52  sources = [ "net_base_branch_fuzzer.cpp" ]
53
54  deps = [
55    "$INNERKITS_ROOT/netconnclient:net_conn_manager_if",
56    "$NETCONNMANAGER_SOURCE_DIR:net_conn_manager_static",
57    "$NETMANAGER_BASE_ROOT/services/netpolicymanager:net_policy_manager_static",
58    "$NETMANAGER_BASE_ROOT/utils:net_manager_common",
59    "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller",
60    "$THIRD_PARTY_ROOT/curl:curl_shared",
61  ]
62
63  defines = [
64    "HI_LOG_ENABLE",
65    "DH_LOG_TAG=\"NetBaseBranchFuzzTest\"",
66    "LOG_DOMAIN=0xD004100",
67  ]
68
69  external_deps = [
70    "ability_base:zuri",
71    "ability_runtime:ability_manager",
72    "access_token:libaccesstoken_sdk",
73    "access_token:libnativetoken",
74    "access_token:libtoken_setproc",
75    "bundle_framework:appexecfwk_base",
76    "bundle_framework:appexecfwk_core",
77    "cJSON:cjson",
78    "common_event_service:cesfwk_innerkits",
79    "eventhandler:libeventhandler",
80    "ffrt:libffrt",
81    "hilog:libhilog",
82    "hitrace:hitrace_meter",
83    "init:libbegetutil",
84    "ipc:ipc_core",
85    "safwk:system_ability_fwk",
86    "samgr:samgr_proxy",
87  ]
88}
89
90###############################################################################
91group("fuzztest") {
92  testonly = true
93
94  deps = [ ":NetBaseBranchFuzzTest" ]
95}
96
97###############################################################################
98
99