1# Copyright (c) 2021-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("NetStatsClientFuzzTest") { 22 module_out_path = fuzz_test_path 23 fuzz_config_file = "$NETMANAGER_BASE_ROOT/test/fuzztest/netstatsclient_fuzzer" 24 25 include_dirs = [ 26 "$INNERKITS_ROOT/netstatsclient/include", 27 "$NETCONNMANAGER_COMMON_DIR/include", 28 "$NETSTATSMANAGER_SOURCE_DIR/include/stub", 29 "$NETSTATSMANAGER_SOURCE_DIR/include", 30 "$NETSYSCONTROLLER_ROOT_DIR/include", 31 "$NETSYSNATIVE_SOURCE_DIR/include/manager", 32 "$NETSYSNATIVE_SOURCE_DIR/include/netsys/wrapper", 33 "$NETMANAGERNATIVE_ROOT/netsys_bpf_map/include", 34 ] 35 36 cflags = [ 37 "-g", 38 "-O0", 39 "-Wno-unused-variable", 40 "-fno-omit-frame-pointer", 41 ] 42 43 sources = [ 44 "mock_net_permission.cpp", 45 "net_stats_client_fuzzer.cpp", 46 ] 47 48 deps = [ 49 "$INNERKITS_ROOT/netstatsclient:net_stats_manager_if", 50 "$NETMANAGER_BASE_ROOT/services/netstatsmanager:net_stats_manager_static", 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=\"NetStatsClientFuzzTest\"", 58 "LOG_DOMAIN=0xD004100", 59 ] 60 61 external_deps = [ 62 "bundle_framework:appexecfwk_base", 63 "bundle_framework:appexecfwk_core", 64 "c_utils:utils", 65 "eventhandler:libeventhandler", 66 "hilog:libhilog", 67 "init:libbegetutil", 68 "ipc:ipc_core", 69 "ipc:ipc_core", 70 "safwk:system_ability_fwk", 71 "samgr:samgr_proxy", 72 ] 73} 74 75############################################################################### 76group("fuzztest") { 77 testonly = true 78 79 deps = [ ":NetStatsClientFuzzTest" ] 80} 81 82############################################################################### 83 84