1# Copyright (c) 2022-2024 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 = fuzz_test_path 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 "$INNERKITS_ROOT/netmanagernative/include", 30 "$NETCONNMANAGER_SOURCE_DIR/include/stub", 31 "$NETCONNMANAGER_SOURCE_DIR/include", 32 "$NETMANAGERNATIVE_ROOT/net_mgr_native/include", 33 "$NETMANAGERNATIVE_ROOT/common/include", 34 "$NETMANAGER_BASE_ROOT/services/common/include", 35 "$NETMANAGER_BASE_ROOT/test/commonduplicatedcode", 36 "$NETMANAGER_BASE_ROOT/test/security", 37 "$NETSYSCONTROLLER_ROOT_DIR/include", 38 "$NETPOLICYMANAGER_SOURCE_DIR/include", 39 "$NETPOLICYMANAGER_SOURCE_DIR/include/stub", 40 ] 41 42 cflags = [ 43 "-g", 44 "-O0", 45 "-Wno-unused-variable", 46 "-fno-omit-frame-pointer", 47 ] 48 49 sources = [ 50 "$NETMANAGER_BASE_ROOT/test/security/netmanager_base_test_security.cpp", 51 "mock_net_conn_permission.cpp", 52 "net_conn_client_fuzzer.cpp", 53 ] 54 55 deps = [ 56 "$INNERKITS_ROOT/netconnclient:net_conn_manager_if", 57 "$NETCONNMANAGER_SOURCE_DIR:net_conn_manager_static", 58 "$NETMANAGER_BASE_ROOT/utils:net_manager_common", 59 "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller", 60 ] 61 62 defines = [ 63 "HI_LOG_ENABLE", 64 "DH_LOG_TAG=\"NetConnClientFuzzTest\"", 65 "LOG_DOMAIN=0xD004100", 66 ] 67 68 external_deps = [ 69 "ability_base:want", 70 "ability_base:zuri", 71 "ability_runtime:ability_manager", 72 "access_token:libaccesstoken_sdk", 73 "access_token:libnativetoken", 74 "access_token:libtoken_setproc", 75 "bundle_framework:appexecfwk_base", 76 "bundle_framework:appexecfwk_core", 77 "cJSON:cjson", 78 "curl:curl_shared", 79 "data_share:datashare_common", 80 "data_share:datashare_consumer", 81 "eventhandler:libeventhandler", 82 "ffrt:libffrt", 83 "hilog:libhilog", 84 "hisysevent:libhisysevent", 85 "hitrace:hitrace_meter", 86 "init:libbegetutil", 87 "ipc:ipc_core", 88 "os_account:os_account_innerkits", 89 "safwk:system_ability_fwk", 90 "samgr:samgr_proxy", 91 ] 92} 93 94############################################################################### 95group("fuzztest") { 96 testonly = true 97 98 deps = [ ":NetConnClientFuzzTest" ] 99} 100 101############################################################################### 102 103