• 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")
15import("//build/test.gni")
16import("//foundation/communication/netmanager_ext/netmanager_ext_config.gni")
17
18EXT_SECURITY_PATH = "../../.."
19
20ohos_fuzztest("netfirewallclient_fuzzer_test") {
21  module_out_path = fuzz_test_path
22  fuzz_config_file = "$NETMANAGER_EXT_ROOT/test/netfirewallmanager/fuzztest/netfirewallclient_fuzzer"
23
24  include_dirs = [
25    "$EXT_INNERKITS_ROOT/include",
26    "$EXT_SECURITY_PATH/security",
27    "$NETMANAGER_EXT_ROOT/utils/log/include",
28    "$NETFIREWALLMANAGER_SOURCE_DIR/include",
29    "$EXT_INNERKITS_ROOT/netfirewallclient/include",
30  ]
31
32  cflags = [
33    "-g",
34    "-O0",
35    "-Wno-unused-variable",
36    "-fno-omit-frame-pointer",
37    "-flto",
38    "-fsanitize=cfi",
39    "-fsanitize-cfi-cross-dso",
40    "-fvisibility=hidden",
41  ]
42
43  ldflags = [
44    "-flto",
45    "-fsanitize=cfi",
46    "-fsanitize-cfi-cross-dso",
47  ]
48
49  sources = [ "netfirewall_client_test.cpp" ]
50
51  deps = [
52    "$EXT_INNERKITS_ROOT/netfirewallclient:netfirewall_manager_if",
53    "$EXT_INNERKITS_ROOT/netfirewallclient:netfirewall_parcel",
54    "$NETFIREWALLMANAGER_SOURCE_DIR:netfirewall_manager_static",
55  ]
56
57  external_deps = [
58    "access_token:libaccesstoken_sdk",
59    "access_token:libnativetoken_shared",
60    "access_token:libtoken_setproc",
61    "bundle_framework:appexecfwk_base",
62    "bundle_framework:appexecfwk_core",
63    "c_utils:utils",
64    "dhcp:dhcp_sdk",
65    "eventhandler:libeventhandler",
66    "ffrt:libffrt",
67    "hilog:libhilog",
68    "ipc:ipc_core",
69    "json:nlohmann_json_static",
70    "netmanager_base:netsys_controller",
71    "netmanager_base:net_conn_manager_if",
72    "netmanager_base:net_manager_common",
73    "netmanager_base:net_native_manager_if",
74    "netmanager_base:net_service_common",
75    "os_account:os_account_innerkits",
76  ]
77
78  defines = [
79    "NETMGR_LOG_TAG = \"NetFirewallManager\"",
80    "LOG_DOMAIN = 0xD0015B0",
81  ]
82
83  if (enable_netmgr_ext_debug) {
84    defines += [ "NETMGR_DEBUG" ]
85  }
86
87  part_name = "netmanager_ext"
88  subsystem_name = "communication"
89}
90
91###############################################################################
92group("fuzztest") {
93  testonly = true
94  deps = [ ":netfirewallclient_fuzzer_test" ]
95}
96###############################################################################
97