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_native_service_stub_test.cpp", 33 "netsys_native_service_test.cpp", 34 "route_manager_test.cpp", 35 ] 36 37 include_dirs = [ 38 "$FWMARK_CLIENT_DIR/include", 39 "$INNERKITS_ROOT/netconnclient/include", 40 "$INNERKITS_ROOT/netconnclient/include/proxy", 41 "$INNERKITS_ROOT/netmanagernative/include", 42 "$NETMANAGER_BASE_ROOT/test/security", 43 "$NETMANAGERNATIVE_ROOT/include", 44 "$NETMANAGERNATIVE_ROOT/include/netsys/wrapper", 45 "$NETMANAGER_BASE_ROOT/services/common/include", 46 "$NETMANAGER_BASE_ROOT/services/netmanagernative/bpf/include", 47 "$NETMANAGER_BASE_ROOT/services/netmanagernative/src/netsys", 48 "$NETMANAGER_BASE_ROOT/test/commonduplicatedcode", 49 "$NETSYSCONTROLLER_ROOT_DIR/include", 50 "$NETSYSNATIVE_INNERKITS_SOURCE_DIR", 51 "$NETSYSNATIVE_SOURCE_DIR/include/manager", 52 "$NETSYSNATIVE_SOURCE_DIR/include/netsys", 53 "$THIRD_PARTY_ROOT/cJSON/include", 54 ] 55 56 deps = [ 57 "$FWMARK_CLIENT_DIR:fwmark_client", 58 "$INNERKITS_ROOT/netconnclient:net_conn_manager_if", 59 "$NETMANAGERNATIVE_ROOT:netsys_client", 60 "$NETMANAGER_BASE_ROOT/services/netmanagernative:netsys_native_manager_static", 61 "$NETMANAGER_BASE_ROOT/services/netmanagernative/bpf:netsys_bpf_utils", 62 ] 63 64 external_deps = [ 65 "ability_base:want", 66 "access_token:libaccesstoken_sdk", 67 "access_token:libnativetoken", 68 "access_token:libtoken_setproc", 69 "bundle_framework:appexecfwk_base", 70 "bundle_framework:appexecfwk_core", 71 "c_utils:utils", 72 "dhcp:dhcp_sdk", 73 "ffrt:libffrt", 74 "init:libbegetutil", 75 "ipc:ipc_core", 76 "safwk:system_ability_fwk", 77 "samgr:samgr_proxy", 78 ] 79 80 defines = [ 81 "NETMGRNATIVE_LOG_TAG = \"NetsysNativeService\"", 82 "LOG_DOMAIN = 0xD0015B0", 83 "SHARING_MANAGER_DEPS", 84 ] 85 86 if (netmanager_base_enable_feature_sysvpn) { 87 defines += [ "SUPPORT_SYSVPN" ] 88 } 89 90 external_deps += [ "hilog:libhilog" ] 91 92 part_name = "netmanager_base" 93 subsystem_name = "communication" 94} 95