• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2023 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    "$NETSYSNATIVE_SOURCE_DIR/include/manager",
32    "$NETSYSNATIVE_SOURCE_DIR/include/netsys/wrapper",
33    "$NETMANAGERNATIVE_ROOT/netsys_bpf_map/include",
34  ]
35
36  cflags = [
37    "-g",
38    "-O0",
39    "-Wno-unused-variable",
40    "-fno-omit-frame-pointer",
41    "-flto",
42    "-fsanitize=cfi",
43    "-fsanitize-cfi-cross-dso",
44    "-fvisibility=hidden",
45  ]
46  ldflags = [
47    "-flto",
48    "-fsanitize=cfi",
49    "-fsanitize-cfi-cross-dso",
50  ]
51  sources = [
52    "mock_net_permission.cpp",
53    "net_stats_client_fuzzer.cpp",
54  ]
55
56  deps = [
57    "$INNERKITS_ROOT/netstatsclient:net_stats_manager_if",
58    "$NETMANAGER_BASE_ROOT/services/netstatsmanager:net_stats_manager_static",
59    "$NETMANAGER_BASE_ROOT/utils:net_manager_common",
60    "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller",
61  ]
62
63  defines = [
64    "HI_LOG_ENABLE",
65    "DH_LOG_TAG=\"NetStatsClientFuzzTest\"",
66    "LOG_DOMAIN=0xD004100",
67  ]
68
69  external_deps = [
70    "bundle_framework:appexecfwk_base",
71    "bundle_framework:appexecfwk_core",
72    "c_utils:utils",
73    "eventhandler:libeventhandler",
74    "hilog:libhilog",
75    "init:libbegetutil",
76    "ipc:ipc_core",
77    "ipc:ipc_core",
78    "safwk:system_ability_fwk",
79    "samgr:samgr_proxy",
80  ]
81}
82
83###############################################################################
84group("fuzztest") {
85  testonly = true
86
87  deps = [ ":NetStatsClientFuzzTest" ]
88}
89
90###############################################################################
91
92