• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-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("net_policy_service_test") {
18  module_out_path = "netmanager_base/netmanager_base/net_policy_service_test"
19  sanitize = {
20    cfi = true
21    cfi_cross_dso = true
22    debug = false
23  }
24
25  branch_protector_ret = "pac_ret"
26
27  sources = [
28    "$NETMANAGER_BASE_ROOT/test/security/netmanager_base_test_security.cpp",
29    "net_policy_service_test.cpp",
30    "$NETMANAGER_BASE_ROOT/test/netpolicymanager/mock/mock_net_policy_db_clone.cpp",
31  ]
32
33  include_dirs = [
34    "$INNERKITS_ROOT/netpolicyclient/include",
35    "$NETPOLICYMANAGER_SOURCE_DIR/include",
36    "$NETPOLICYMANAGER_SOURCE_DIR/include/stub",
37    "$INNERKITS_ROOT/netconnclient/include",
38    "$NETCONNMANAGER_COMMON_DIR/include",
39    "$NETSYSCONTROLLER_ROOT_DIR/include",
40    "$NETMANAGER_BASE_ROOT/test/commonduplicatedcode",
41    "$NETMANAGER_BASE_ROOT/test/security",
42    "$NETMANAGER_BASE_ROOT/test/netpolicymanager/mock",
43  ]
44
45  deps = [
46    "$INNERKITS_ROOT/netpolicyclient:net_policy_manager_if",
47    "$NETCONNMANAGER_COMMON_DIR:net_service_common",
48    "$NETMANAGER_BASE_ROOT/services/netpolicymanager:net_policy_manager_static",
49    "$NETMANAGER_BASE_ROOT/utils:net_manager_common",
50  ]
51
52  external_deps = [
53    "ability_base:want",
54    "ability_runtime:app_manager",
55    "ability_runtime:wantagent_innerkits",
56    "access_token:libaccesstoken_sdk",
57    "access_token:libnativetoken",
58    "access_token:libtoken_setproc",
59    "bundle_framework:appexecfwk_base",
60    "bundle_framework:appexecfwk_core",
61    "cJSON:cjson",
62    "common_event_service:cesfwk_core",
63    "common_event_service:cesfwk_innerkits",
64    "eventhandler:libeventhandler",
65    "ffrt:libffrt",
66    "googletest:gmock_main",
67    "hitrace:hitrace_meter",
68    "ipc:ipc_core",
69    "netmanager_base:net_conn_manager_if",
70    "netmanager_base:net_stats_manager_if",
71    "relational_store:native_rdb",
72    "safwk:system_ability_fwk",
73    "samgr:samgr_proxy",
74    "time_service:time_client",
75  ]
76
77  defines = [
78    "NETMGR_LOG_TAG = \"NetPolicyUT\"",
79    "LOG_DOMAIN = 0xD0015B0",
80    "private = public",
81    "protected = public",
82  ]
83
84  if (enable_netmgr_debug) {
85    defines += [ "NETMGR_DEBUG" ]
86  }
87
88  external_deps += [ "hilog:libhilog" ]
89
90  part_name = "netmanager_base"
91  subsystem_name = "communication"
92}
93