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 14import("//build/config/features.gni") 15 16#####################hydra-fuzz################### 17import("//build/test.gni") 18import("//foundation/communication/netmanager_base/netmanager_base_config.gni") 19 20##############################fuzztest########################################## 21ohos_fuzztest("NetSysClientNetDiagFuzzTest") { 22 module_out_path = fuzz_test_path 23 fuzz_config_file = 24 "$NETMANAGER_BASE_ROOT/test/fuzztest/netsysclientnetdiag_fuzzer" 25 26 include_dirs = [ 27 "$NETCONNMANAGER_COMMON_DIR/include", 28 "$NETCONNMANAGER_SOURCE_DIR/include", 29 "$NETMANAGER_BASE_ROOT/services/netmanagernative/bpf/include", 30 "$NETMANAGER_BASE_ROOT/utils/log/include", 31 "$NETSYSNATIVE_INNERKITS_SOURCE_DIR", 32 "$INNERKITS_ROOT/netmanagernative/include", 33 "$NETSYSCONTROLLER_ROOT_DIR/include", 34 "$NETSYSNATIVE_SOURCE_DIR/include", 35 "$NETSYSNATIVE_SOURCE_DIR/include/manager", 36 "$NETSYSNATIVE_SOURCE_DIR/include/netsys", 37 "$NETSYSNATIVE_SOURCE_DIR/include/netsys/wrapper", 38 ] 39 40 cflags = [ 41 "-g", 42 "-O0", 43 "-Wno-unused-variable", 44 "-fno-omit-frame-pointer", 45 ] 46 sources = [ "net_sys_client_netdiag_fuzzer.cpp" ] 47 48 deps = [ 49 "$NETMANAGER_BASE_ROOT/services/netmanagernative:netsys_native_manager_static", 50 "$NETMANAGER_BASE_ROOT/services/netmanagernative/bpf:netsys_bpf_utils", 51 "$NETMANAGER_BASE_ROOT/utils:net_manager_common", 52 "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller", 53 ] 54 55 defines = [ 56 "HI_LOG_ENABLE", 57 "DH_LOG_TAG=\"NetSysClientNetDiagFuzzTest\"", 58 "LOG_DOMAIN=0xD004100", 59 ] 60 61 external_deps = [ 62 "access_token:libaccesstoken_sdk", 63 "access_token:libnativetoken", 64 "access_token:libtoken_setproc", 65 "bundle_framework:appexecfwk_base", 66 "bundle_framework:appexecfwk_core", 67 "c_utils:utils", 68 "dhcp:dhcp_sdk", 69 "eventhandler:libeventhandler", 70 "hilog:libhilog", 71 "init:libbegetutil", 72 "ipc:ipc_core", 73 "safwk:system_ability_fwk", 74 "samgr:samgr_proxy", 75 ] 76} 77 78############################################################################### 79group("fuzztest") { 80 testonly = true 81 82 deps = [ ":NetSysClientNetDiagFuzzTest" ] 83} 84 85############################################################################### 86 87