• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  _cfi_blocklist_path =
25      "$NETMANAGER_BASE_ROOT/test/fuzztest/netconnclient_fuzzer/cfi_blocklist.txt"
26
27  include_dirs = [
28    "$INNERKITS_ROOT/include",
29    "$INNERKITS_ROOT/netconnclient/include",
30    "$INNERKITS_ROOT/netconnclient/include/proxy",
31    "$INNERKITS_ROOT/netmanagernative/include",
32    "$NETCONNMANAGER_SOURCE_DIR/include/stub",
33    "$NETCONNMANAGER_SOURCE_DIR/include",
34    "$NETMANAGERNATIVE_ROOT/net_mgr_native/include",
35    "$NETMANAGERNATIVE_ROOT/common/include",
36    "$NETMANAGER_BASE_ROOT/services/common/include",
37    "$NETMANAGER_BASE_ROOT/test/commonduplicatedcode",
38    "$NETMANAGER_BASE_ROOT/test/security",
39    "$NETSYSCONTROLLER_ROOT_DIR/include",
40    "$NETPOLICYMANAGER_SOURCE_DIR/include",
41    "$NETPOLICYMANAGER_SOURCE_DIR/include/stub",
42  ]
43
44  cflags = [
45    "-g",
46    "-O0",
47    "-Wno-unused-variable",
48    "-fno-omit-frame-pointer",
49    "-flto",
50    "-fvisibility=hidden",
51  ]
52
53  ldflags = [ "-flto" ]
54
55  sources = [
56    "$NETMANAGER_BASE_ROOT/test/security/netmanager_base_test_security.cpp",
57    "mock_net_conn_permission.cpp",
58    "net_conn_client_fuzzer.cpp",
59  ]
60
61  deps = [
62    "$INNERKITS_ROOT/netconnclient:net_conn_manager_if",
63    "$NETCONNMANAGER_SOURCE_DIR:net_conn_manager_static",
64    "$NETMANAGER_BASE_ROOT/utils:net_manager_common",
65    "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller",
66  ]
67
68  defines = [
69    "HI_LOG_ENABLE",
70    "DH_LOG_TAG=\"NetConnClientFuzzTest\"",
71    "LOG_DOMAIN=0xD004100",
72  ]
73
74  external_deps = [
75    "ability_base:want",
76    "ability_base:zuri",
77    "ability_runtime:ability_manager",
78    "access_token:libaccesstoken_sdk",
79    "access_token:libnativetoken",
80    "access_token:libtoken_setproc",
81    "bundle_framework:appexecfwk_base",
82    "bundle_framework:appexecfwk_core",
83    "cJSON:cjson",
84    "curl:curl_shared",
85    "data_share:datashare_common",
86    "data_share:datashare_consumer",
87    "eventhandler:libeventhandler",
88    "ffrt:libffrt",
89    "hilog:libhilog",
90    "hisysevent:libhisysevent",
91    "hitrace:hitrace_meter",
92    "init:libbegetutil",
93    "ipc:ipc_core",
94    "os_account:os_account_innerkits",
95    "safwk:system_ability_fwk",
96    "samgr:samgr_proxy",
97  ]
98}
99
100###############################################################################
101group("fuzztest") {
102  testonly = true
103
104  deps = [ ":NetConnClientFuzzTest" ]
105}
106
107###############################################################################
108
109