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("NetConnClientFuzzTest") { 22 module_out_path = "netmanager_base/net_conn_client" 23 fuzz_config_file = "$NETMANAGER_BASE_ROOT/test/fuzztest/netconnclient_fuzzer" 24 25 include_dirs = [ 26 "$INNERKITS_ROOT/include", 27 "$INNERKITS_ROOT/netconnclient/include", 28 "$INNERKITS_ROOT/netconnclient/include/proxy", 29 "$NETCONNMANAGER_SOURCE_DIR/include/stub", 30 "$NETCONNMANAGER_SOURCE_DIR/include", 31 "$SAMGR_MANAGER_ROOT/interfaces/innerkits/samgr_proxy/include", 32 "$NETMANAGERNATIVE_ROOT/net_mgr_native/include", 33 "$NETMANAGERNATIVE_ROOT/common/include", 34 "$NETMANAGER_BASE_ROOT/services/common/include", 35 "$NETSYSCONTROLLER_ROOT_DIR/include", 36 ] 37 38 cflags = [ 39 "-g", 40 "-O0", 41 "-Wno-unused-variable", 42 "-fno-omit-frame-pointer", 43 "-flto", 44 "-fsanitize=cfi", 45 "-fsanitize-cfi-cross-dso", 46 "-fvisibility=hidden", 47 ] 48 ldflags = [ 49 "-flto", 50 "-fsanitize=cfi", 51 "-fsanitize-cfi-cross-dso", 52 ] 53 sources = [ 54 "mock_net_conn_permission.cpp", 55 "net_conn_client_fuzzer.cpp", 56 ] 57 58 deps = [ 59 "$INNERKITS_ROOT/netconnclient:net_conn_manager_if", 60 "$NETCONNMANAGER_SOURCE_DIR:net_conn_manager_static", 61 "$NETMANAGER_BASE_ROOT/utils:net_manager_common", 62 "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller", 63 ] 64 65 defines = [ 66 "HI_LOG_ENABLE", 67 "DH_LOG_TAG=\"NetConnClientFuzzTest\"", 68 "LOG_DOMAIN=0xD004100", 69 ] 70 71 external_deps = [ 72 "ability_base:zuri", 73 "ability_runtime:ability_manager", 74 "access_token:libaccesstoken_sdk", 75 "access_token:libnativetoken", 76 "access_token:libtoken_setproc", 77 "bundle_framework:appexecfwk_base", 78 "bundle_framework:appexecfwk_core", 79 "data_share:datashare_common", 80 "data_share:datashare_consumer", 81 "eventhandler:libeventhandler", 82 "hilog:libhilog", 83 "init:libbegetutil", 84 "ipc:ipc_core", 85 "safwk:system_ability_fwk", 86 "samgr:samgr_proxy", 87 ] 88} 89 90############################################################################### 91group("fuzztest") { 92 testonly = true 93 94 deps = [ ":NetConnClientFuzzTest" ] 95} 96 97############################################################################### 98 99