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 "$ETHERNETMANAGER_SOURCE_DIR/include/stub", 34 ] 35 36 cflags = [ 37 "-g", 38 "-O0", 39 "-Wno-unused-variable", 40 "-fno-omit-frame-pointer", 41 "-flto", 42 "-fsanitize=cfi", 43 "-fsanitize-cfi-cross-dso", 44 "-fvisibility=hidden", 45 ] 46 47 ldflags = [ 48 "-flto", 49 "-fsanitize=cfi", 50 "-fsanitize-cfi-cross-dso", 51 ] 52 53 sources = [ 54 "$EXT_SECURITY_PATH/security/netmanager_ext_test_security.cpp", 55 "ethernet_client_fuzzer.cpp", 56 ] 57 58 deps = [ 59 "$ETHERNETMANAGER_SOURCE_DIR:ethernet_manager", 60 "$EXT_INNERKITS_ROOT/ethernetclient:ethernet_manager_if", 61 62 ] 63 64 external_deps = [ 65 "access_token:libaccesstoken_sdk", 66 "access_token:libnativetoken_shared", 67 "access_token:libtoken_setproc", 68 "cJSON:cjson", 69 "c_utils:utils", 70 "dhcp:dhcp_sdk", 71 "eventhandler:libeventhandler", 72 "ffrt:libffrt", 73 "ipc:ipc_core", 74 "netmanager_base:netsys_controller", 75 "netmanager_base:net_manager_common", 76 "netmanager_base:net_native_manager_if", 77 "netmanager_base:net_service_common", 78 "netmanager_base:net_conn_manager_if", 79 "safwk:system_ability_fwk", 80 "samgr:samgr_proxy", 81 ] 82 external_deps += [ "hilog:libhilog" ] 83 84 defines = [ 85 "NETMGR_LOG_TAG = \"EthernetManager\"", 86 "LOG_DOMAIN = 0xD0015B0", 87 ] 88} 89 90############################################################################### 91group("fuzztest") { 92 testonly = true 93 94 deps = [ ":EthernetClientFuzzTest" ] 95} 96############################################################################### 97