1# Copyright (c) 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##############################hydra-fuzz######################################## 14import("//build/config/features.gni") 15import("//build/test.gni") 16import("//foundation/distributeddatamgr/datamgr_service/datamgr_service.gni") 17 18##############################fuzztest########################################## 19ohos_fuzztest("DataShareServiceStubFuzzTest") { 20 module_out_path = "datamgr_service/datamgr_service" 21 22 include_dirs = [ 23 "${data_service_path}/adapter/include", 24 "${data_service_path}/app/src", 25 "${data_service_path}/framework/include", 26 "${data_service_path}/service/common", 27 "${data_service_path}/service/crypto/include", 28 "${data_service_path}/service/data_share/common", 29 "${data_service_path}/service/data_share/data", 30 "${data_service_path}/service/data_share/dfx", 31 "${data_service_path}/service/data_share/strategies", 32 "${data_service_path}/service/data_share/subscriber_managers", 33 "${data_service_path}/service/data_share", 34 "${data_service_path}/service/kvdb", 35 "${data_service_path}/service/permission/include", 36 "${datashare_path}/frameworks/native/common/include", 37 "${datashare_path}/interfaces/inner_api/common/include", 38 "${datashare_path}/interfaces/inner_api/consumer/include", 39 "//third_party/json/single_include", 40 ] 41 42 fuzz_config_file = 43 "${data_service_path}/service/test/fuzztest/datashareservicestub_fuzzer" 44 45 cflags = [ 46 "-g", 47 "-O0", 48 "-Wno-unused-variable", 49 "-fno-omit-frame-pointer", 50 ] 51 52 sources = [ 53 "${data_service_path}/service/common/xcollie.cpp", 54 "${data_service_path}/service/crypto/src/crypto_manager.cpp", 55 "${data_service_path}/service/data_share/common/app_connect_manager.cpp", 56 "${data_service_path}/service/data_share/common/base64_utils.cpp", 57 "${data_service_path}/service/data_share/common/bundle_mgr_proxy.cpp", 58 "${data_service_path}/service/data_share/common/db_delegate.cpp", 59 "${data_service_path}/service/data_share/common/div_strategy.cpp", 60 "${data_service_path}/service/data_share/common/extension_ability_manager.cpp", 61 "${data_service_path}/service/data_share/common/extension_connect_adaptor.cpp", 62 "${data_service_path}/service/data_share/common/extension_mgr_proxy.cpp", 63 "${data_service_path}/service/data_share/common/kv_delegate.cpp", 64 "${data_service_path}/service/data_share/common/rdb_delegate.cpp", 65 "${data_service_path}/service/data_share/common/scheduler_manager.cpp", 66 "${data_service_path}/service/data_share/common/seq_strategy.cpp", 67 "${data_service_path}/service/data_share/common/uri_utils.cpp", 68 "${data_service_path}/service/data_share/data/published_data.cpp", 69 "${data_service_path}/service/data_share/data/resultset_json_formatter.cpp", 70 "${data_service_path}/service/data_share/data/template_data.cpp", 71 "${data_service_path}/service/data_share/data_provider_config.cpp", 72 "${data_service_path}/service/data_share/data_share_db_config.cpp", 73 "${data_service_path}/service/data_share/data_share_obs_proxy.cpp", 74 "${data_service_path}/service/data_share/data_share_profile_config.cpp", 75 "${data_service_path}/service/data_share/data_share_service_impl.cpp", 76 "${data_service_path}/service/data_share/data_share_service_stub.cpp", 77 "${data_service_path}/service/data_share/data_share_silent_config.cpp", 78 "${data_service_path}/service/data_share/data_share_types_util.cpp", 79 "${data_service_path}/service/data_share/dfx/hiview_adapter.cpp", 80 "${data_service_path}/service/data_share/dfx/hiview_fault_adapter.cpp", 81 "${data_service_path}/service/data_share/strategies/data_proxy/load_config_from_data_proxy_node_strategy.cpp", 82 "${data_service_path}/service/data_share/strategies/data_share/load_config_from_data_share_bundle_info_strategy.cpp", 83 "${data_service_path}/service/data_share/strategies/general/check_is_data_proxy_strategy.cpp", 84 "${data_service_path}/service/data_share/strategies/general/check_is_single_app_strategy.cpp", 85 "${data_service_path}/service/data_share/strategies/general/cross_permission_strategy.cpp", 86 "${data_service_path}/service/data_share/strategies/general/load_config_common_strategy.cpp", 87 "${data_service_path}/service/data_share/strategies/general/load_config_data_info_strategy.cpp", 88 "${data_service_path}/service/data_share/strategies/general/load_config_from_bundle_info_strategy.cpp", 89 "${data_service_path}/service/data_share/strategies/general/permission_strategy.cpp", 90 "${data_service_path}/service/data_share/strategies/get_data_strategy.cpp", 91 "${data_service_path}/service/data_share/strategies/publish_strategy.cpp", 92 "${data_service_path}/service/data_share/strategies/rdb_notify_strategy.cpp", 93 "${data_service_path}/service/data_share/strategies/subscribe_strategy.cpp", 94 "${data_service_path}/service/data_share/strategies/template_strategy.cpp", 95 "${data_service_path}/service/data_share/subscriber_managers/published_data_subscriber_manager.cpp", 96 "${data_service_path}/service/data_share/subscriber_managers/rdb_subscriber_manager.cpp", 97 "${data_service_path}/service/data_share/sys_event_subscriber.cpp", 98 "${data_service_path}/service/kvdb/user_delegate.cpp", 99 "${data_service_path}/service/permission/src/permit_delegate.cpp", 100 "datashareservicestub_fuzzer.cpp", 101 ] 102 103 deps = [ 104 "${data_service_path}/adapter:distributeddata_adapter", 105 "${data_service_path}/framework:distributeddatasvcfwk", 106 "${data_service_path}/service/data_share:data_share_service", 107 ] 108 109 external_deps = [ 110 "ability_base:base", 111 "ability_base:want", 112 "ability_base:zuri", 113 "ability_runtime:dataobs_manager", 114 "ability_runtime:extension_manager", 115 "ability_runtime:wantagent_innerkits", 116 "access_token:libaccesstoken_sdk", 117 "access_token:libtokenid_sdk", 118 "bundle_framework:appexecfwk_base", 119 "bundle_framework:appexecfwk_core", 120 "c_utils:utils", 121 "common_event_service:cesfwk_innerkits", 122 "data_share:datashare_common", 123 "device_manager:devicemanagersdk", 124 "hicollie:libhicollie", 125 "hilog:libhilog", 126 "hisysevent:libhisysevent", 127 "huks:libhukssdk", 128 "ipc:ipc_core", 129 "kv_store:distributeddb", 130 "relational_store:native_rdb", 131 "relational_store:rdb_data_share_adapter", 132 "resource_management:global_resmgr", 133 "samgr:samgr_proxy", 134 "time_service:time_client", 135 ] 136} 137 138############################################################################### 139group("fuzztest") { 140 testonly = true 141 142 deps = [ ":DataShareServiceStubFuzzTest" ] 143} 144############################################################################### 145