1# Copyright (c) 2025 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("DataShareServiceImplFuzzTest") { 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/config/include", 28 "${data_service_path}/service/crypto/include", 29 "${data_service_path}/service/data_share/common", 30 "${data_service_path}/service/data_share/data", 31 "${data_service_path}/service/data_share/dfx", 32 "${data_service_path}/service/data_share/strategies", 33 "${data_service_path}/service/data_share/subscriber_managers", 34 "${data_service_path}/service/data_share", 35 "${data_service_path}/service/kvdb", 36 "${data_service_path}/service/permission/include", 37 "${data_service_path}/adapter/include/communicator", 38 ] 39 40 fuzz_config_file = 41 "${data_service_path}/service/test/fuzztest/datashareserviceimpl_fuzzer" 42 43 cflags = [ 44 "-Dprivate=public", 45 "-Dprotected=public", 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/data_share/common/app_connect_manager.cpp", 55 "${data_service_path}/service/data_share/common/bundle_mgr_proxy.cpp", 56 "${data_service_path}/service/data_share/common/common_utils.cpp", 57 "${data_service_path}/service/data_share/common/db_delegate.cpp", 58 "${data_service_path}/service/data_share/common/div_strategy.cpp", 59 "${data_service_path}/service/data_share/common/extension_ability_manager.cpp", 60 "${data_service_path}/service/data_share/common/extension_connect_adaptor.cpp", 61 "${data_service_path}/service/data_share/common/extension_mgr_proxy.cpp", 62 "${data_service_path}/service/data_share/common/kv_delegate.cpp", 63 "${data_service_path}/service/data_share/common/proxy_data_manager.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/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/proxy_data_subscriber_manager.cpp", 96 "${data_service_path}/service/data_share/subscriber_managers/published_data_subscriber_manager.cpp", 97 "${data_service_path}/service/data_share/subscriber_managers/rdb_subscriber_manager.cpp", 98 "${data_service_path}/service/data_share/sys_event_subscriber.cpp", 99 "${data_service_path}/service/kvdb/user_delegate.cpp", 100 "${data_service_path}/service/permission/src/permit_delegate.cpp", 101 "${data_service_path}/service/permission/src/permission_validator.cpp", 102 "datashareserviceimpl_fuzzer.cpp", 103 ] 104 105 deps = [ 106 "${data_service_path}/adapter/account:distributeddata_account", 107 "${data_service_path}/adapter/communicator:distributeddata_communicator", 108 "${data_service_path}/framework:distributeddatasvcfwk", 109 "${data_service_path}/service:distributeddatasvc", 110 ] 111 112 external_deps = [ 113 "ability_base:base", 114 "ability_base:want", 115 "ability_base:zuri", 116 "ability_runtime:dataobs_manager", 117 "ability_runtime:extension_manager", 118 "ability_runtime:wantagent_innerkits", 119 "access_token:libaccesstoken_sdk", 120 "access_token:libtokenid_sdk", 121 "bundle_framework:appexecfwk_base", 122 "bundle_framework:appexecfwk_core", 123 "c_utils:utils", 124 "common_event_service:cesfwk_innerkits", 125 "data_share:datashare_common", 126 "data_share:datashare_consumer", 127 "device_manager:devicemanagersdk", 128 "hicollie:libhicollie", 129 "hilog:libhilog", 130 "hisysevent:libhisysevent", 131 "huks:libhukssdk", 132 "init:libbegetutil", 133 "ipc:ipc_core", 134 "kv_store:distributeddata_inner", 135 "kv_store:distributeddb", 136 "qos_manager:concurrent_task_client", 137 "qos_manager:qos", 138 "relational_store:native_rdb", 139 "relational_store:rdb_data_share_adapter", 140 "resource_management:global_resmgr", 141 "samgr:samgr_proxy", 142 "time_service:time_client", 143 ] 144} 145 146############################################################################### 147group("fuzztest") { 148 testonly = true 149 150 deps = [ ":DataShareServiceImplFuzzTest" ] 151} 152############################################################################### 153