1# Copyright (c) 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/test.gni")
15import("//foundation/communication/netmanager_base/netmanager_base_config.gni")
16
17ohos_unittest("netsys_distributed_test") {
18  module_out_path = "netmanager_base/netsys_distributed_test"
19
20  sanitize = {
21    cfi = true
22    cfi_cross_dso = true
23    debug = false
24  }
25
26  branch_protector_ret = "pac_ret"
27
28  sources = [
29    "$NETMANAGER_BASE_ROOT/test/security/netmanager_base_test_security.cpp",
30    "distributed_manager_test.cpp",
31    "net_manager_native_test.cpp",
32    "netsys_controller_test.cpp",
33    "netsys_native_service_proxy_test.cpp",
34    "netsys_native_service_stub_test.cpp",
35    "netsys_native_service_test.cpp",
36    "route_manager_test.cpp",
37  ]
38
39  include_dirs = [
40    "$FWMARK_CLIENT_DIR/include",
41    "$INNERKITS_ROOT/netconnclient/include",
42    "$INNERKITS_ROOT/netconnclient/include/proxy",
43    "$INNERKITS_ROOT/netmanagernative/include",
44    "$NETMANAGER_BASE_ROOT/test/security",
45    "$NETMANAGERNATIVE_ROOT/include",
46    "$NETMANAGERNATIVE_ROOT/include/netsys/wrapper",
47    "$NETMANAGER_BASE_ROOT/services/common/include",
48    "$NETMANAGER_BASE_ROOT/services/netmanagernative/bpf/include",
49    "$NETMANAGER_BASE_ROOT/services/netmanagernative/src/netsys",
50    "$NETMANAGER_BASE_ROOT/test/commonduplicatedcode",
51    "$NETSYSCONTROLLER_ROOT_DIR/include",
52    "$NETSYSNATIVE_INNERKITS_SOURCE_DIR",
53    "$NETSYSNATIVE_SOURCE_DIR/include/manager",
54    "$NETSYSNATIVE_SOURCE_DIR/include/netsys",
55    "$THIRD_PARTY_ROOT/cJSON/include",
56  ]
57
58  deps = [
59    "$FWMARK_CLIENT_DIR:fwmark_client",
60    "$INNERKITS_ROOT/netconnclient:net_conn_manager_if",
61    "$NETMANAGERNATIVE_ROOT:netsys_client",
62    "$NETMANAGER_BASE_ROOT/services/netmanagernative:netsys_native_manager_static",
63    "$NETMANAGER_BASE_ROOT/services/netmanagernative/bpf:netsys_bpf_utils",
64    "$NETMANAGER_BASE_ROOT/services/netsyscontroller:netsys_controller",
65  ]
66
67  external_deps = [
68    "ability_base:want",
69    "access_token:libaccesstoken_sdk",
70    "access_token:libnativetoken",
71    "access_token:libtoken_setproc",
72    "bundle_framework:appexecfwk_base",
73    "bundle_framework:appexecfwk_core",
74    "c_utils:utils",
75    "dhcp:dhcp_sdk",
76    "ffrt:libffrt",
77    "init:libbegetutil",
78    "ipc:ipc_core",
79    "safwk:system_ability_fwk",
80    "samgr:samgr_proxy",
81  ]
82
83  defines = [
84    "NETMGRNATIVE_LOG_TAG = \"NetsysNativeService\"",
85    "LOG_DOMAIN = 0xD0015B0",
86    "SHARING_MANAGER_DEPS",
87  ]
88
89  if (netmanager_base_enable_feature_sysvpn) {
90    defines += [ "SUPPORT_SYSVPN" ]
91  }
92
93  external_deps += [ "hilog:libhilog" ]
94
95  part_name = "netmanager_base"
96  subsystem_name = "communication"
97}
98