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