1# Copyright (c) 2022-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 14#####################hydra-fuzz################### 15import("//build/config/features.gni") 16import("//build/test.gni") 17import("//foundation/communication/netmanager_ext/netmanager_ext_config.gni") 18##############################fuzztest########################################## 19EXT_SECURITY_PATH = "../../.." 20 21ohos_fuzztest("EthernetClientFuzzTest") { 22 module_out_path = fuzz_test_path 23 fuzz_config_file = 24 "$NETMANAGER_EXT_ROOT/test/ethernetmanager/fuzztest/ethernetclient_fuzzer" 25 26 include_dirs = [ 27 "$EXT_INNERKITS_ROOT/include", 28 "$EXT_INNERKITS_ROOT/ethernetclient/include", 29 "$EXT_INNERKITS_ROOT/ethernetclient/include/proxy", 30 "$EXT_SECURITY_PATH/security", 31 "$NETMANAGER_EXT_ROOT/utils/log/include", 32 "$ETHERNETMANAGER_SOURCE_DIR/include", 33 "$BASE_INNERKITS_ROOT/netmanagernative/include", 34 "$BASE_INNERKITS_ROOT/include", 35 "$BASE_INNERKITS_ROOT/dnsresolverclient/include", 36 "$BASE_INNERKITS_ROOT/netconnclient/include", 37 "$NETSYSCONTROLLER_ROOT_DIR/include", 38 "$NETCONNMANAGER_COMMON_DIR/include", 39 "$ETHERNETMANAGER_SOURCE_DIR/include/stub", 40 ] 41 42 cflags = [ 43 "-g", 44 "-O0", 45 "-Wno-unused-variable", 46 "-fno-omit-frame-pointer", 47 ] 48 49 sources = [ 50 "$EXT_SECURITY_PATH/security/netmanager_ext_test_security.cpp", 51 "ethernet_client_fuzzer.cpp", 52 ] 53 54 deps = [ 55 "$ETHERNETMANAGER_SOURCE_DIR:ethernet_manager", 56 "$EXT_INNERKITS_ROOT/ethernetclient:ethernet_manager_if", 57 "$NETMANAGER_EXT_ROOT/utils:net_manager_ext_common", 58 "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller", 59 "$THIRD_PARTY_ROOT/json:nlohmann_json_static", 60 ] 61 62 external_deps = [ 63 "access_token:libaccesstoken_sdk", 64 "access_token:libnativetoken", 65 "access_token:libtoken_setproc", 66 "c_utils:utils", 67 "dhcp:dhcp_sdk", 68 "ipc:ipc_core", 69 ] 70 external_deps += [ "hilog:libhilog" ] 71 72 defines = [ 73 "NETMGR_LOG_TAG = \"EthernetManager\"", 74 "LOG_DOMAIN = 0xD0015B0", 75 ] 76} 77 78############################################################################### 79group("fuzztest") { 80 testonly = true 81 82 deps = [ ":EthernetClientFuzzTest" ] 83} 84############################################################################### 85