1# Copyright (c) 2022-2023 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 14#####################hydra-fuzz################### 15import("//build/config/features.gni") 16import("//build/test.gni") 17import("//foundation/communication/netmanager_ext/netmanager_ext_config.gni") 18##############################fuzztest########################################## 19ohos_fuzztest("NetShareClientFuzzTest") { 20 module_out_path = "communication/netmanager_ext" 21 fuzz_config_file = "$NETMANAGER_EXT_ROOT/test/networksharemanager/fuzztest/netshareclient_fuzzer" 22 23 include_dirs = [ 24 "$DHCP_MANAGER_ROOT/services/mgr_service/include", 25 "$DHCP_MANAGER_ROOT/interfaces/inner_api/include", 26 "$DHCP_MANAGER_ROOT/interfaces/inner_api/interfaces", 27 "$DHCP_MANAGER_ROOT/interfaces/inner_api/interfaces", 28 "$DHCP_MANAGER_ROOT/interfaces/inner_api/include", 29 "$EXT_INNERKITS_ROOT/ethernetclient/include", 30 "$EXT_INNERKITS_ROOT/netshareclient/include", 31 "$EXT_INNERKITS_ROOT/netshareclient/include/proxy", 32 "$EXT_INNERKITS_ROOT/netshareclient/include/proxy/ipccallback", 33 "$EXT_INNERKITS_ROOT/include", 34 "$EXT_INNERKITS_ROOT/include/proxy", 35 "$NETMANAGER_EXT_ROOT/utils/log/include", 36 "$NETWORKSHAREMANAGER_SOURCE_DIR/include", 37 "$NETWORKSHAREMANAGER_SOURCE_DIR/include/stub", 38 "$NETWORKSHAREMANAGER_UTILS_DIR/event_report/include", 39 "$NETSYSCONTROLLER_ROOT_DIR/include", 40 "$WIFI_MANAGER_ROOT/interfaces/kits/c", 41 "$WIFI_MANAGER_ROOT/frameworks/native/interfaces", 42 ] 43 44 cflags = [ 45 "-g", 46 "-O0", 47 "-Wno-unused-variable", 48 "-fno-omit-frame-pointer", 49 ] 50 51 sources = [ "netshare_client_fuzzer.cpp" ] 52 53 deps = [ 54 "$BASE_INNERKITS_ROOT/netconnclient:net_conn_manager_if", 55 "$BLUETOOTH_ROOT/frameworks/inner:btframework", 56 "$DHCP_MANAGER_ROOT/services/mgr_service:dhcp_manager_service", 57 "$NETMANAGER_BASE_ROOT/utils:net_manager_common", 58 "$NETMANAGER_EXT_ROOT/services/networksharemanager:net_tether_manager_static", 59 "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller", 60 ] 61 62 external_deps = [ 63 "access_token:libaccesstoken_sdk", 64 "access_token:libtoken_setproc", 65 "c_utils:utils", 66 "ipc:ipc_core", 67 "safwk:system_ability_fwk", 68 "wifi:wifi_sdk", 69 ] 70 external_deps += [ "hilog:libhilog" ] 71 72 defines = [ 73 "NETMGR_LOG_TAG = \"NetShareManager\"", 74 "LOG_DOMAIN = 0xD0015B0", 75 ] 76 if (!defined(global_parts_info) || 77 defined(global_parts_info.communication_bluetooth)) { 78 defines += [ "BLUETOOTH_MODOULE=1" ] 79 external_deps += [ "bluetooth:btframework" ] 80 } 81} 82 83############################################################################### 84group("fuzztest") { 85 testonly = true 86 87 deps = [ ":NetShareClientFuzzTest" ] 88} 89############################################################################### 90