• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-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("NetStatsClientFuzzTest") {
22  module_out_path = fuzz_test_path
23  fuzz_config_file = "$NETMANAGER_BASE_ROOT/test/fuzztest/netstatsclient_fuzzer"
24  _cfi_blocklist_path = "$NETMANAGER_BASE_ROOT/test/fuzztest/netstatsclient_fuzzer/cfi_blocklist.txt"
25
26  include_dirs = [
27    "$INNERKITS_ROOT/netstatsclient/include",
28    "$NETCONNMANAGER_COMMON_DIR/include",
29    "$NETMANAGER_BASE_ROOT/utils/bundle_utils/include",
30    "$NETSTATSMANAGER_SOURCE_DIR/include/stub",
31    "$NETSTATSMANAGER_SOURCE_DIR/include",
32    "$NETSYSCONTROLLER_ROOT_DIR/include",
33    "$NETSYSNATIVE_SOURCE_DIR/include/manager",
34    "$NETSYSNATIVE_SOURCE_DIR/include/netsys/wrapper",
35    "$NETMANAGERNATIVE_ROOT/netsys_bpf_map/include",
36  ]
37
38  cflags = [
39    "-g",
40    "-O0",
41    "-Wno-unused-variable",
42    "-fno-omit-frame-pointer",
43    "-flto",
44    "-fvisibility=hidden",
45  ]
46
47  ldflags = [ "-flto" ]
48
49  sources = [
50    "mock_net_permission.cpp",
51    "net_stats_client_fuzzer.cpp",
52  ]
53
54  deps = [
55    "$INNERKITS_ROOT/netconnclient:net_conn_manager_if",
56    "$INNERKITS_ROOT/netstatsclient:net_stats_manager_if",
57    "$NETMANAGER_BASE_ROOT/services/netstatsmanager:net_stats_manager_static",
58    "$NETMANAGER_BASE_ROOT/utils:net_manager_common",
59    "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller",
60  ]
61
62  defines = [
63    "HI_LOG_ENABLE",
64    "DH_LOG_TAG=\"NetStatsClientFuzzTest\"",
65    "LOG_DOMAIN=0xD004100",
66  ]
67
68  external_deps = [
69    "ability_runtime:ability_manager",
70    "ability_runtime:dataobs_manager",
71    "bundle_framework:appexecfwk_base",
72    "bundle_framework:appexecfwk_core",
73    "cJSON:cjson",
74    "c_utils:utils",
75    "data_share:datashare_consumer",
76    "distributed_notification_service:ans_innerkits",
77    "eventhandler:libeventhandler",
78    "ffrt:libffrt",
79    "hilog:libhilog",
80    "i18n:intl_util",
81    "init:libbegetutil",
82    "ipc:ipc_core",
83    "ipc:ipc_core",
84    "relational_store:native_rdb",
85    "safwk:system_ability_fwk",
86    "samgr:samgr_proxy",
87    "os_account:os_account_innerkits"
88  ]
89
90  if (netmanager_base_enable_traffic_statistic) {
91    external_deps += [
92      "cellular_data:tel_cellular_data_api",
93      "core_service:tel_core_service_api",
94    ]
95  }
96}
97
98###############################################################################
99group("fuzztest") {
100  testonly = true
101
102  deps = [ ":NetStatsClientFuzzTest" ]
103}
104
105###############################################################################
106
107