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/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 "$NETFIREWALLMANAGER_SOURCE_DIR/include", 45 "$EXT_INNERKITS_ROOT/netfirewallclient/include", 46 "$NETMANAGER_EXT_ROOT/test/netmanager_ext_mock_test", 47 ] 48 49 deps = [ 50 "$EXT_INNERKITS_ROOT/netfirewallclient:netfirewall_manager_if", 51 "$EXT_INNERKITS_ROOT/netfirewallclient:netfirewall_parcel", 52 "$NETFIREWALLMANAGER_SOURCE_DIR:netfirewall_manager_static", 53 ] 54 55 external_deps = [ 56 "c_utils:utils", 57 "access_token:libaccesstoken_sdk", 58 "access_token:libnativetoken_shared", 59 "access_token:libtoken_setproc", 60 "bundle_framework:appexecfwk_base", 61 "bundle_framework:appexecfwk_core", 62 "cJSON:cjson", 63 "dhcp:dhcp_sdk", 64 "eventhandler:libeventhandler", 65 "ffrt:libffrt", 66 "hilog:libhilog", 67 "ipc:ipc_core", 68 "netmanager_base:netsys_controller", 69 "netmanager_base:net_conn_manager_if", 70 "netmanager_base:net_native_manager_if", 71 "netmanager_base:net_service_common", 72 "os_account:os_account_innerkits", 73 "relational_store:native_rdb", 74 ] 75 76 defines = [ 77 "NETMGR_LOG_TAG = \"NetFirewallManagerTest\"", 78 "LOG_DOMAIN = 0xD0015B0", 79 ] 80 81 if (enable_netmgr_ext_debug) { 82 defines += [ "NETMGR_DEBUG" ] 83 } 84 85 configs = [ "$NETMANAGER_EXT_ROOT/resource:coverage_flags" ] 86 87 part_name = "netmanager_ext" 88 subsystem_name = "communication" 89} 90 91group("unittest") { 92 testonly = true 93 deps = [ ":netfirewallmanager_test" ] 94} 95