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_base/netmanager_base_config.gni")
16
17ohos_unittest("netsys_netfirewall_test") {
18  module_out_path = "netmanager_base/netsys_netfirewall_test"
19
20  sources = [
21    "bpf_netfirewall_test.cpp",
22    "netsys_netfirewall_test.cpp",
23  ]
24
25  include_dirs = [
26    "$NETSYSNATIVE_SOURCE_DIR/bpf/include",
27    "$NETMANAGER_BASE_ROOT/utils/log/include",
28    "$NETSYSNATIVE_SOURCE_DIR/include",
29    "$NETMANAGER_BASE_ROOT/interfaces/innerkits/include",
30    "$NETMANAGER_BASE_ROOT/interfaces/innerkits/netmanagernative/include",
31  ]
32
33  deps = [
34    "$INNERKITS_ROOT/netmanagernative:net_native_manager_if",
35    "$NETSYSNATIVE_SOURCE_DIR/bpf:netsys",
36    "$NETSYSNATIVE_SOURCE_DIR/bpf:netsys_bpf_utils",
37  ]
38
39  defines = [
40    "NETMGR_LOG_TAG = \"NetSysNetFirewallTest\"",
41    "LOG_DOMAIN = 0xD0015B0",
42  ]
43
44  if (enable_netmgr_debug) {
45    defines += [ "NETMGR_DEBUG" ]
46  }
47
48  external_deps = [
49    "c_utils:utils",
50    "hilog:libhilog",
51    "ipc:ipc_core",
52    "safwk:system_ability_fwk",
53  ]
54
55  public_configs = [ "$NETMANAGER_BASE_ROOT/resource:coverage_flags" ]
56  part_name = "netmanager_base"
57  subsystem_name = "communication"
58}
59
60ohos_unittest("suffix_match_trie_test") {
61  module_out_path = "netmanager_base/netsys_netfirewall_test"
62
63  include_dirs = [ "$NETMANAGER_BASE_ROOT/utils/common_utils/include" ]
64
65  sources = [ "suffix_match_trie_test.cpp" ]
66
67  external_deps = [ "c_utils:utils" ]
68
69  public_configs = [ "$NETMANAGER_BASE_ROOT/resource:coverage_flags" ]
70  part_name = "netmanager_base"
71  subsystem_name = "communication"
72}
73