• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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("netfirewallmanager_test") {
20  sanitize = {
21    cfi = true
22    cfi_cross_dso = true
23    debug = false
24  }
25
26  module_out_path = "netmanager_ext/netfirewallmanager_test"
27
28  sources = [
29    "$EXT_SECURITY_PATH/security/netmanager_ext_test_security.cpp",
30    "netfirewall_client_test.cpp",
31    "netfirewall_common_test.cpp",
32    "netfirewall_default_rule_parser_test.cpp",
33    "netfirewall_hisysevent_test.cpp",
34    "netfirewall_rule_manager_test.cpp",
35    "netfirewall_rule_native_helper_test.cpp",
36    "netfirewall_service_proxy_test.cpp",
37    "netfirewall_service_stub_test.cpp",
38    "netfirewall_service_test.cpp",
39  ]
40
41  include_dirs = [
42    "$EXT_INNERKITS_ROOT/include",
43    "$EXT_SECURITY_PATH/security",
44    "$NETSYSCONTROLLER_ROOT_DIR/include",
45    "$NETCONNMANAGER_COMMON_DIR/include",
46    "$NETFIREWALLMANAGER_SOURCE_DIR/include",
47    "$EXT_INNERKITS_ROOT/netfirewallclient/include",
48    "$NETMANAGER_EXT_ROOT/test/netmanager_ext_mock_test",
49  ]
50
51  deps = [
52    "$EXT_INNERKITS_ROOT/netfirewallclient:netfirewall_manager_if",
53    "$EXT_INNERKITS_ROOT/netfirewallclient:netfirewall_parcel",
54    "$NETCONNMANAGER_COMMON_DIR:net_service_common",
55    "$NETFIREWALLMANAGER_SOURCE_DIR:netfirewall_manager_static",
56    "$NETMANAGER_EXT_ROOT/utils:net_manager_ext_common",
57    "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller",
58  ]
59
60  external_deps = [
61    "access_token:libaccesstoken_sdk",
62    "access_token:libnativetoken",
63    "access_token:libtoken_setproc",
64    "bundle_framework:appexecfwk_base",
65    "bundle_framework:appexecfwk_core",
66    "cJSON:cjson",
67    "dhcp:dhcp_sdk",
68    "eventhandler:libeventhandler",
69    "ffrt:libffrt",
70    "hilog:libhilog",
71    "ipc:ipc_core",
72    "netmanager_base:net_conn_parcel",
73    "netmanager_base:net_native_manager_if",
74    "os_account:os_account_innerkits",
75    "relational_store:native_rdb",
76  ]
77
78  defines = [
79    "NETMGR_LOG_TAG = \"NetFirewallManagerTest\"",
80    "LOG_DOMAIN = 0xD0015B0",
81  ]
82
83  if (enable_netmgr_ext_debug) {
84    defines += [ "NETMGR_DEBUG" ]
85  }
86
87  configs = [ "$NETMANAGER_EXT_ROOT/resource:coverage_flags" ]
88
89  part_name = "netmanager_ext"
90  subsystem_name = "communication"
91}
92
93group("unittest") {
94  testonly = true
95  deps = [ ":netfirewallmanager_test" ]
96}
97