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_ext/netmanager_ext_config.gni") 16 17EXT_SECURITY_PATH = "../../.." 18 19ohos_unittest("ethernet_manager_test") { 20 sanitize = { 21 cfi = true 22 cfi_cross_dso = true 23 blocklist = "./cfi_blocklist.txt" 24 debug = false 25 } 26 27 branch_protector_ret = "pac_ret" 28 29 module_out_path = "netmanager_ext/netmanager_ext/ethernet_manager_test" 30 31 sources = [ 32 "$EXT_SECURITY_PATH/security/netmanager_ext_test_security.cpp", 33 "dev_interface_state_test.cpp", 34 "ethernet_client_test.cpp", 35 "ethernet_configuration_test.cpp", 36 "ethernet_lan_management_test.cpp", 37 "ethernet_manager_test.cpp", 38 "ethernet_service_proxy_test.cpp", 39 "ethernet_service_stub_test.cpp", 40 "ethernet_service_test.cpp", 41 "mac_address_info_test.cpp", 42 "ethernet_device_info_test.cpp", 43 "net_eap_callback_stub_test.cpp", 44 "net_eap_handler_test.cpp", 45 "eth_eap_profile_test.cpp", 46 ] 47 48 include_dirs = [ 49 "$EXT_INNERKITS_ROOT/include", 50 "$EXT_INNERKITS_ROOT/ethernetclient/include", 51 "$EXT_INNERKITS_ROOT/ethernetclient/include/proxy", 52 "$EXT_SECURITY_PATH/security", 53 "$ETHERNETMANAGER_SOURCE_DIR/include", 54 "$ETHERNETMANAGER_SOURCE_DIR/include/stub", 55 ] 56 57 deps = [ 58 "$ETHERNETMANAGER_SOURCE_DIR:ethernet_manager", 59 "$EXT_INNERKITS_ROOT/ethernetclient:ethernet_manager_if", 60 ] 61 62 external_deps = [ 63 "c_utils:utils", 64 "access_token:libaccesstoken_sdk", 65 "access_token:libnativetoken_shared", 66 "access_token:libtoken_setproc", 67 "bounds_checking_function:libsec_shared", 68 "cJSON:cjson", 69 "dhcp:dhcp_sdk", 70 "eventhandler:libeventhandler", 71 "ffrt:libffrt", 72 "init:libbegetutil", 73 "ipc:ipc_core", 74 "netmanager_base:netsys_controller", 75 "netmanager_base:net_conn_manager_if", 76 "netmanager_base:net_service_common", 77 "safwk:system_ability_fwk", 78 "samgr:samgr_proxy", 79 ] 80 81 defines = [ 82 "NETMGR_LOG_TAG = \"EthernetManager\"", 83 "LOG_DOMAIN = 0xD0015B0", 84 "private = public", 85 ] 86 87 if (enable_netmgr_ext_debug) { 88 defines += [ "NETMGR_DEBUG" ] 89 } 90 91 if (netmanager_ext_extensible_authentication) { 92 defines += [ "NET_EXTENSIBLE_AUTHENTICATION" ] 93 external_deps += [ 94 "drivers_interface_ethernet:libethernet_proxy_1.0", 95 "hdf_core:libhdf_ipc_adapter", 96 "hdf_core:libhdi", 97 ] 98 sources += [ 99 "eap_hdi_wpa_manager_test.cpp" 100 ] 101 } 102 103 external_deps += [ "hilog:libhilog" ] 104 105 part_name = "netmanager_ext" 106 subsystem_name = "communication" 107} 108 109group("unittest") { 110 testonly = true 111 deps = [ ":ethernet_manager_test" ] 112} 113