1# Copyright (c) 2021-2022 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("net_policy_manager_test") { 18 module_out_path = "netmanager_base/net_policy_manager_test" 19 20 sources = [ 21 "net_policy_callback_test.cpp", 22 "net_policy_manager_test.cpp", 23 "ut_firewall_rule.cpp", 24 "ut_net_policy_base.cpp", 25 "ut_net_policy_callback.cpp", 26 "ut_net_policy_callback_ipc.cpp", 27 "ut_net_policy_client.cpp", 28 "ut_net_policy_core.cpp", 29 "ut_net_policy_event_handler.cpp", 30 "ut_net_policy_file.cpp", 31 "ut_net_policy_firewall.cpp", 32 "ut_net_policy_rule.cpp", 33 "ut_net_policy_service_common.cpp", 34 "ut_net_policy_traffic.cpp", 35 "ut_net_quota_policy.cpp", 36 "ut_netsys_policy_wrapper.cpp", 37 ] 38 39 include_dirs = [ 40 "$INNERKITS_ROOT/netpolicyclient/include", 41 "$INNERKITS_ROOT/netpolicyclient/include/proxy", 42 "$NETPOLICYMANAGER_SOURCE_DIR/include", 43 "$NETPOLICYMANAGER_SOURCE_DIR/include/stub", 44 "$INNERKITS_ROOT/netconnclient/include", 45 "$NETCONNMANAGER_COMMON_DIR/include", 46 "$NETSYSCONTROLLER_ROOT_DIR/include", 47 ] 48 49 deps = [ 50 "$INNERKITS_ROOT/netpolicyclient:net_policy_manager_if", 51 "$NETCONNMANAGER_COMMON_DIR:net_service_common", 52 "$NETMANAGER_BASE_ROOT/services/netpolicymanager:net_policy_manager", 53 "$NETMANAGER_BASE_ROOT/utils:net_manager_common", 54 ] 55 56 external_deps = [ 57 "ability_base:want", 58 "access_token:libaccesstoken_sdk", 59 "access_token:libnativetoken", 60 "access_token:libtoken_setproc", 61 "common_event_service:cesfwk_core", 62 "common_event_service:cesfwk_innerkits", 63 "eventhandler:libeventhandler", 64 "hitrace_native:hitrace_meter", 65 "ipc:ipc_core", 66 "netmanager_base:net_conn_manager_if", 67 "netmanager_base:net_stats_manager_if", 68 "safwk:system_ability_fwk", 69 "samgr:samgr_proxy", 70 ] 71 72 defines = [ 73 "NETMGR_LOG_TAG = \"NetPolicyUT\"", 74 "LOG_DOMAIN = 0xD0015B0", 75 ] 76 77 if (enable_netmgr_debug) { 78 defines += [ "NETMGR_DEBUG" ] 79 } 80 81 if (is_standard_system) { 82 external_deps += [ "hiviewdfx_hilog_native:libhilog" ] 83 } else { 84 external_deps += [ "hilog:libhilog" ] 85 } 86 87 part_name = "netmanager_base" 88 subsystem_name = "communication" 89} 90