• 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("NetStatsClientFuzzTest") {
22  module_out_path = "netmanager_base/net_stats_client"
23  fuzz_config_file = "$NETMANAGER_BASE_ROOT/test/fuzztest/netstatsclient_fuzzer"
24
25  include_dirs = [
26    "$INNERKITS_ROOT/netstatsclient/include",
27    "$NETCONNMANAGER_COMMON_DIR/include",
28    "$NETSTATSMANAGER_SOURCE_DIR/include/stub",
29    "$NETSTATSMANAGER_SOURCE_DIR/include",
30    "$NETSYSCONTROLLER_ROOT_DIR/include",
31    "$NETSTATSMANAGER_BPFLIB_DIR/include",
32    "$NETMANAGERNATIVE_ROOT/netsys_bpf_map/include",
33  ]
34
35  cflags = [
36    "-g",
37    "-O0",
38    "-Wno-unused-variable",
39    "-fno-omit-frame-pointer",
40  ]
41  sources = [ "net_stats_client_fuzzer.cpp" ]
42
43  deps = [
44    "$HILOG_ROOT/interfaces/native/innerkits:libhilog",
45    "$INNERKITS_ROOT/netstatsclient:net_stats_manager_if",
46    "$NETMANAGER_BASE_ROOT/services/netstatsmanager:net_stats_manager",
47    "$NETMANAGER_BASE_ROOT/utils:net_manager_common",
48    "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller",
49  ]
50
51  defines = [
52    "HI_LOG_ENABLE",
53    "DH_LOG_TAG=\"NetStatsClientFuzzTest\"",
54    "LOG_DOMAIN=0xD004100",
55  ]
56
57  external_deps = [
58    "bundle_framework:appexecfwk_base",
59    "bundle_framework:appexecfwk_core",
60    "c_utils:utils",
61    "eventhandler:libeventhandler",
62    "hiviewdfx_hilog_native:libhilog",
63    "init:libbegetutil",
64    "ipc:ipc_core",
65    "ipc:ipc_core",
66    "safwk:system_ability_fwk",
67    "samgr:samgr_proxy",
68  ]
69}
70
71###############################################################################
72group("fuzztest") {
73  testonly = true
74
75  deps = [ ":NetStatsClientFuzzTest" ]
76}
77
78###############################################################################
79
80