1# Copyright (c) 2023-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_ext/netmanager_ext_config.gni") 16 17EXT_SECURITY_PATH = "../../.." 18 19ohos_unittest("vpn_manager_ext_test") { 20 sanitize = { 21 cfi = true 22 cfi_cross_dso = true 23 debug = false 24 } 25 26 branch_protector_ret = "pac_ret" 27 28 sources = [ "networkvpn_service_ext_test.cpp" ] 29 30 include_dirs = [ 31 "$EXT_INNERKITS_ROOT/include", 32 "$EXT_INNERKITS_ROOT/netshareclient/include/proxy", 33 "$EXT_INNERKITS_ROOT/netvpnclient/include", 34 "$EXT_INNERKITS_ROOT/netvpnclient/include/ipc", 35 "$EXT_SECURITY_PATH/security", 36 "$NETMANAGER_EXT_ROOT/utils/event_report/include", 37 "$NETMANAGER_EXT_ROOT/services/vpnmanager/include", 38 "$NETMANAGER_EXT_ROOT/services/vpnmanager/include/ipc", 39 "$NETMANAGER_EXT_ROOT/test/netmanager_ext_mock_test", 40 ] 41 42 deps = [ 43 "$EXT_INNERKITS_ROOT/netvpnclient:net_vpn_manager_if", 44 "$NETMANAGER_EXT_ROOT/services/vpnmanager:net_vpn_manager_static", 45 ] 46 47 external_deps = [ 48 "c_utils:utils", 49 "ability_runtime:app_manager", 50 "access_token:libaccesstoken_sdk", 51 "access_token:libnativetoken_shared", 52 "access_token:libtoken_setproc", 53 "bundle_framework:appexecfwk_base", 54 "bundle_framework:appexecfwk_core", 55 "cJSON:cjson", 56 "eventhandler:libeventhandler", 57 "ffrt:libffrt", 58 "hilog:libhilog", 59 "hisysevent:libhisysevent", 60 "netmanager_base:net_conn_manager_if", 61 "netmanager_base:net_manager_common", 62 "os_account:os_account_innerkits", 63 "safwk:system_ability_fwk", 64 ] 65 66 defines = [ 67 "NETMGR_LOG_TAG = \"NetworkVpnManager\"", 68 "LOG_DOMAIN = 0xD0015B0", 69 ] 70 71 if (enable_netmgr_ext_debug) { 72 defines += [ "NETMGR_DEBUG" ] 73 } 74 75 subsystem_name = "communication" 76 part_name = "netmanager_ext" 77 module_out_path = "netmanager_ext/vpn_manager_test" 78} 79 80group("unittest") { 81 testonly = true 82 deps = [ ":vpn_manager_ext_test" ] 83} 84