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_ext/netmanager_ext_config.gni") 16 17EXT_SECURITY_PATH = "../../.." 18 19ohos_unittest("sys_vpn_manager_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 = [ 29 "$EXT_SECURITY_PATH/security/netmanager_ext_test_security.cpp", 30 "ipsec_vpn_config_test.cpp", 31 "ipsec_vpn_ctl_test.cpp", 32 "l2tp_vpn_config_test.cpp", 33 "l2tp_vpn_ctl_test.cpp", 34 "multi_vpn_helper_test.cpp", 35 "net_vpn_impl_test.cpp", 36 "networkvpn_client_test.cpp", 37 "networkvpn_service_test.cpp", 38 "open_vpn_ctl_test.cpp", 39 "openvpn_config_test.cpp", 40 "sysvpn_config_test.cpp", 41 "vpn_data_bean_test.cpp", 42 "vpn_database_helper_test.cpp", 43 "vpn_template_processor_test.cpp", 44 "vpn_ut_config_test.cpp", 45 "extended_vpn_ctl_test.cpp", 46 ] 47 48 include_dirs = [ 49 "$EXT_INNERKITS_ROOT/include", 50 "$EXT_INNERKITS_ROOT/netshareclient/include/proxy", 51 "$EXT_INNERKITS_ROOT/netshareclient/include/proxy/ipccallback", 52 "$EXT_INNERKITS_ROOT/netvpnclient/include", 53 "$EXT_INNERKITS_ROOT/netvpnclient/include/ipc", 54 "$EXT_SECURITY_PATH/security", 55 "$NETMANAGER_EXT_ROOT/utils/event_report/include", 56 "$NETMANAGER_EXT_ROOT/services/vpnmanager/include", 57 "$NETMANAGER_EXT_ROOT/services/vpnmanager/include/ipc", 58 "$NETMANAGER_EXT_ROOT/test/netmanager_ext_mock_test", 59 ] 60 61 deps = [ 62 "$EXT_INNERKITS_ROOT/netvpnclient:net_vpn_manager_if", 63 "$EXT_INNERKITS_ROOT/netvpnclient:networkvpn_interface_stub", 64 "$NETMANAGER_EXT_ROOT/services/vpnmanager:net_vpn_manager_static", 65 ] 66 67 external_deps = [ 68 "c_utils:utils", 69 "ability_runtime:app_manager", 70 "access_token:libaccesstoken_sdk", 71 "access_token:libnativetoken_shared", 72 "access_token:libtoken_setproc", 73 "bundle_framework:appexecfwk_base", 74 "bundle_framework:appexecfwk_core", 75 "cJSON:cjson", 76 "eventhandler:libeventhandler", 77 "ffrt:libffrt", 78 "hilog:libhilog", 79 "hisysevent:libhisysevent", 80 "init:libbegetutil", 81 "ipc:ipc_core", 82 "netmanager_base:fwmark_client", 83 "netmanager_base:net_conn_manager_if", 84 "netmanager_base:net_data_share", 85 "netmanager_base:net_manager_common", 86 "netmanager_base:netsys_controller", 87 "os_account:os_account_innerkits", 88 "relational_store:native_rdb", 89 "safwk:system_ability_fwk", 90 ] 91 92 defines = [ 93 "NETMGR_LOG_TAG = \"NetworkVpnManager\"", 94 "LOG_DOMAIN = 0xD0015B0", 95 ] 96 97 if (enable_netmgr_ext_debug) { 98 defines += [ "NETMGR_DEBUG" ] 99 } 100 101 subsystem_name = "communication" 102 part_name = "netmanager_ext" 103 module_out_path = "netmanager_ext/netmanager_ext/sys_vpn_manager_test" 104} 105 106group("unittest") { 107 testonly = true 108 deps = [ ":sys_vpn_manager_test" ] 109} 110