1# Copyright (c) 2022-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("NetConnClientFuzzTest") {
22  module_out_path = fuzz_test_path
23  fuzz_config_file = "$NETMANAGER_BASE_ROOT/test/fuzztest/netconnclient_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    "$NETCONNMANAGER_SOURCE_DIR/include/stub",
31    "$NETCONNMANAGER_SOURCE_DIR/include",
32    "$SAMGR_MANAGER_ROOT/interfaces/innerkits/samgr_proxy/include",
33    "$NETMANAGERNATIVE_ROOT/net_mgr_native/include",
34    "$NETMANAGERNATIVE_ROOT/common/include",
35    "$NETMANAGER_BASE_ROOT/services/common/include",
36    "$NETMANAGER_BASE_ROOT/test/commonduplicatedcode",
37    "$NETMANAGER_BASE_ROOT/test/security",
38    "$NETSYSCONTROLLER_ROOT_DIR/include",
39    "$THIRD_PARTY_ROOT/curl/include",
40  ]
41
42  cflags = [
43    "-g",
44    "-O0",
45    "-Wno-unused-variable",
46    "-fno-omit-frame-pointer",
47  ]
48
49  sources = [
50    "$NETMANAGER_BASE_ROOT/test/security/netmanager_base_test_security.cpp",
51    "mock_net_conn_permission.cpp",
52    "net_conn_client_fuzzer.cpp",
53  ]
54
55  deps = [
56    "$INNERKITS_ROOT/netconnclient:net_conn_manager_if",
57    "$NETCONNMANAGER_SOURCE_DIR:net_conn_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=\"NetConnClientFuzzTest\"",
66    "LOG_DOMAIN=0xD004100",
67  ]
68
69  external_deps = [
70    "ability_base:want",
71    "ability_base:zuri",
72    "ability_runtime:ability_manager",
73    "access_token:libaccesstoken_sdk",
74    "access_token:libnativetoken",
75    "access_token:libtoken_setproc",
76    "bundle_framework:appexecfwk_base",
77    "bundle_framework:appexecfwk_core",
78    "data_share:datashare_common",
79    "data_share:datashare_consumer",
80    "eventhandler:libeventhandler",
81    "ffrt:libffrt",
82    "hilog:libhilog",
83    "init:libbegetutil",
84    "ipc:ipc_core",
85    "os_account:os_account_innerkits",
86    "safwk:system_ability_fwk",
87    "samgr:samgr_proxy",
88  ]
89}
90
91###############################################################################
92group("fuzztest") {
93  testonly = true
94
95  deps = [ ":NetConnClientFuzzTest" ]
96}
97
98###############################################################################
99
100