1518678f8Sopenharmony_ci# Copyright (C) 2024 Huawei Device Co., Ltd. 2518678f8Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License"); 3518678f8Sopenharmony_ci# you may not use this file except in compliance with the License. 4518678f8Sopenharmony_ci# You may obtain a copy of the License at 5518678f8Sopenharmony_ci# 6518678f8Sopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0 7518678f8Sopenharmony_ci# 8518678f8Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software 9518678f8Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS, 10518678f8Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11518678f8Sopenharmony_ci# See the License for the specific language governing permissions and 12518678f8Sopenharmony_ci# limitations under the License. 13518678f8Sopenharmony_ci 14518678f8Sopenharmony_ci#####################hydra-fuzz################### 15518678f8Sopenharmony_ciimport("//build/config/features.gni") 16518678f8Sopenharmony_ciimport("//build/test.gni") 17518678f8Sopenharmony_ciimport("//foundation/communication/dhcp/dhcp.gni") 18518678f8Sopenharmony_ci 19518678f8Sopenharmony_ci##############################fuzztest########################################## 20518678f8Sopenharmony_ciohos_fuzztest("DhcpClientFunFuzzTest") { 21518678f8Sopenharmony_ci module_out_path = dhcp_fuzz_output_path 22518678f8Sopenharmony_ci fuzz_config_file = "$DHCP_ROOT_DIR/test/fuzztest/dhcpclientfun_fuzzer" 23518678f8Sopenharmony_ci 24518678f8Sopenharmony_ci include_dirs = [ 25518678f8Sopenharmony_ci "$DHCP_ROOT_DIR/frameworks/native/include", 26518678f8Sopenharmony_ci "$DHCP_ROOT_DIR/frameworks/native/interfaces", 27518678f8Sopenharmony_ci "$DHCP_ROOT_DIR/frameworks/native/src", 28518678f8Sopenharmony_ci "$DHCP_ROOT_DIR/frameworks/native/c_adapter/inc", 29518678f8Sopenharmony_ci "$DHCP_ROOT_DIR/interfaces", 30518678f8Sopenharmony_ci "$DHCP_ROOT_DIR/interfaces/inner_api", 31518678f8Sopenharmony_ci "$DHCP_ROOT_DIR/interfaces/inner_api/include", 32518678f8Sopenharmony_ci "$DHCP_ROOT_DIR/interfaces/kits/c", 33518678f8Sopenharmony_ci "$DHCP_ROOT_DIR/services", 34518678f8Sopenharmony_ci "$DHCP_ROOT_DIR/services/dhcp_client/include", 35518678f8Sopenharmony_ci "$DHCP_ROOT_DIR/test/fuzztest/fuzz_common_func", 36518678f8Sopenharmony_ci ] 37518678f8Sopenharmony_ci cflags = [ 38518678f8Sopenharmony_ci "-g", 39518678f8Sopenharmony_ci "-O0", 40518678f8Sopenharmony_ci "-Wno-unused-variable", 41518678f8Sopenharmony_ci "-fno-omit-frame-pointer", 42518678f8Sopenharmony_ci ] 43518678f8Sopenharmony_ci sources = [ 44518678f8Sopenharmony_ci "$DHCP_ROOT_DIR/services/dhcp_client/src/dhcp_client_callback_proxy.cpp", 45518678f8Sopenharmony_ci "$DHCP_ROOT_DIR/services/dhcp_client/src/dhcp_client_death_recipient.cpp", 46518678f8Sopenharmony_ci "$DHCP_ROOT_DIR/services/dhcp_client/src/dhcp_client_service_impl.cpp", 47518678f8Sopenharmony_ci "$DHCP_ROOT_DIR/services/dhcp_client/src/dhcp_client_state_machine.cpp", 48518678f8Sopenharmony_ci "$DHCP_ROOT_DIR/services/dhcp_client/src/dhcp_client_stub.cpp", 49518678f8Sopenharmony_ci "$DHCP_ROOT_DIR/services/dhcp_client/src/dhcp_function.cpp", 50518678f8Sopenharmony_ci "$DHCP_ROOT_DIR/services/dhcp_client/src/dhcp_ipv6_client.cpp", 51518678f8Sopenharmony_ci "$DHCP_ROOT_DIR/services/dhcp_client/src/dhcp_ipv6_event.cpp", 52518678f8Sopenharmony_ci "$DHCP_ROOT_DIR/services/dhcp_client/src/dhcp_options.cpp", 53518678f8Sopenharmony_ci "$DHCP_ROOT_DIR/services/dhcp_client/src/dhcp_result.cpp", 54518678f8Sopenharmony_ci "$DHCP_ROOT_DIR/services/dhcp_client/src/dhcp_result_store_manager.cpp", 55518678f8Sopenharmony_ci "$DHCP_ROOT_DIR/services/dhcp_client/src/dhcp_socket.cpp", 56518678f8Sopenharmony_ci "$DHCP_ROOT_DIR/services/dhcp_client/src/dhcp_thread.cpp", 57518678f8Sopenharmony_ci "$DHCP_ROOT_DIR/services/utils/src/dhcp_arp_checker.cpp", 58518678f8Sopenharmony_ci "dhcpclientfun_fuzzer.cpp", 59518678f8Sopenharmony_ci ] 60518678f8Sopenharmony_ci deps = [ "$DHCP_ROOT_DIR/services/utils:dhcp_utils" ] 61518678f8Sopenharmony_ci external_deps = [ 62518678f8Sopenharmony_ci "ability_runtime:wantagent_innerkits", 63518678f8Sopenharmony_ci "access_token:libaccesstoken_sdk", 64518678f8Sopenharmony_ci "access_token:libtokenid_sdk", 65518678f8Sopenharmony_ci "c_utils:utils", 66518678f8Sopenharmony_ci "hilog:libhilog", 67518678f8Sopenharmony_ci "ipc:ipc_single", 68518678f8Sopenharmony_ci "netmanager_base:net_native_manager_if", 69518678f8Sopenharmony_ci "netmanager_base:netsys_controller", 70518678f8Sopenharmony_ci "safwk:system_ability_fwk", 71518678f8Sopenharmony_ci "samgr:samgr_proxy", 72518678f8Sopenharmony_ci "time_service:time_client", 73518678f8Sopenharmony_ci ] 74518678f8Sopenharmony_ci defines = [ 75518678f8Sopenharmony_ci "DTFUZZ_TEST", 76518678f8Sopenharmony_ci "private = public", 77518678f8Sopenharmony_ci "protected = public", 78518678f8Sopenharmony_ci "VENDOR_NAME_PREFIX=\"$VENDOR_NAME\"", 79518678f8Sopenharmony_ci "DEFAULT_IPV4_DNS_PRI=\"$IPV4_DNS_PRI\"", 80518678f8Sopenharmony_ci "DEFAULT_IPV4_DNS_SEC=\"$IPV4_DNS_SEC\"", 81518678f8Sopenharmony_ci ] 82518678f8Sopenharmony_ci part_name = "dhcp" 83518678f8Sopenharmony_ci subsystem_name = "communication" 84518678f8Sopenharmony_ci} 85