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_dnsresolv_test") { 18 module_out_path = "netmanager_base/netmanager_base/dnsresolv_test" 19 20 sanitize = { 21 debug = false 22 } 23 24 branch_protector_ret = "pac_ret" 25 26 sources = [ 27 "dns_proxy_request_socket_test.cpp", 28 "dns_quality_diag_test.cpp", 29 "dns_quality_event_handler_test.cpp", 30 "dns_resolv_listen_test.cpp", 31 "net_dns_health_callback_proxy_test.cpp", 32 "net_dns_result_callback_proxy_test.cpp", 33 ] 34 35 include_dirs = [ 36 "$NETSYSNATIVE_INNERKITS_SOURCE_DIR", 37 "$INNERKITS_ROOT/netmanagernative/include", 38 "$NETSYSNATIVE_SOURCE_DIR/include/manager", 39 "$NETSYSNATIVE_SOURCE_DIR/include/netsys", 40 "$FWMARK_CLIENT_DIR/include", 41 "$NETMANAGERNATIVE_ROOT/include", 42 "$NETMANAGERNATIVE_ROOT/include/netsys/wrapper", 43 "$NETMANAGER_BASE_ROOT/services/common/include", 44 "$NETMANAGER_BASE_ROOT/services/netmanagernative/bpf/include", 45 "$NETMANAGER_BASE_ROOT/services/netmanagernative/src/netsys", 46 "$NETMANAGER_BASE_ROOT/test/commonduplicatedcode", 47 "$NETSYSCONTROLLER_ROOT_DIR/include", 48 "$NETMANAGERNATIVE_ROOT/src/netsys/dnsresolv", 49 "$INNERKITS_ROOT/netconnclient/include", 50 "$INNERKITS_ROOT/netconnclient/include/proxy", 51 ] 52 53 deps = [ 54 "$FWMARK_CLIENT_DIR:fwmark_client", 55 "$NETMANAGERNATIVE_ROOT:netsys_client", 56 "$NETMANAGER_BASE_ROOT/services/netmanagernative:netsys_native_manager_static", 57 "$NETMANAGER_BASE_ROOT/services/netmanagernative/bpf:netsys_bpf_utils", 58 "$NETMANAGER_BASE_ROOT/services/netsyscontroller:netsys_controller_static", 59 ] 60 61 external_deps = [ 62 "ability_base:want", 63 "bundle_framework:appexecfwk_base", 64 "bundle_framework:appexecfwk_core", 65 "cJSON:cjson", 66 "c_utils:utils", 67 "dhcp:dhcp_sdk", 68 "eventhandler:libeventhandler", 69 "ffrt:libffrt", 70 "googletest:gmock_main", 71 "init:libbegetutil", 72 "ipc:ipc_core", 73 "safwk:system_ability_fwk", 74 "samgr:samgr_proxy", 75 ] 76 77 defines = [ 78 "NETMGRNATIVE_LOG_TAG = \"NetsysNativeService\"", 79 "LOG_DOMAIN = 0xD0015B0", 80 ] 81 82 external_deps += [ "hilog:libhilog" ] 83 84 part_name = "netmanager_base" 85 subsystem_name = "communication" 86} 87 88ohos_unittest("netsys_dnsresolv_mock_test") { 89 module_out_path = "netmanager_base/netmanager_base/dnsresolv_test" 90 91 sources = [ 92 "../mock/src/parcel.cpp", 93 "netsys_net_dns_health_data_test.cpp", 94 "netsys_net_dns_result_data_test.cpp", 95 ] 96 97 sources += [ 98 "$NETMANAGERNATIVE_ROOT/src/netsys/dnsresolv/netsys_net_dns_health_data.cpp", 99 "$NETMANAGERNATIVE_ROOT/src/netsys/dnsresolv/netsys_net_dns_result_data.cpp", 100 ] 101 102 include_dirs = [ 103 "$INNERKITS_ROOT/netmanagernative/include", 104 "$INNERKITS_ROOT/netconnclient/include", 105 "$INNERKITS_ROOT/netconnclient/include/proxy", 106 "$NETMANAGER_BASE_ROOT/test/commonduplicatedcode", 107 "$NETMANAGER_BASE_ROOT/test/netmanagernative/unittest/mock/include", 108 "$NETMANAGERNATIVE_ROOT/include/netsys", 109 ] 110 111 deps = [ 112 "$NETMANAGERNATIVE_ROOT:netsys_client", 113 "$NETMANAGER_BASE_ROOT/services/netmanagernative:netsys_native_manager_static", 114 ] 115 116 external_deps = [ 117 "ability_base:want", 118 "bundle_framework:appexecfwk_base", 119 "bundle_framework:appexecfwk_core", 120 "c_utils:utils", 121 "ffrt:libffrt", 122 "googletest:gmock_main", 123 "hilog:libhilog", 124 "ipc:ipc_core", 125 "safwk:system_ability_fwk", 126 "samgr:samgr_proxy", 127 ] 128 129 defines = [ 130 "NETMGRNATIVE_LOG_TAG = \"NetsysNativeService\"", 131 "LOG_DOMAIN = 0xD0015B0", 132 ] 133 134 part_name = "netmanager_base" 135 subsystem_name = "communication" 136} 137