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("CloudServiceStubFuzzTest") { 20 module_out_path = "datamgr_service/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/backup/include", 27 "${data_service_path}/service/bootstrap/include", 28 "${data_service_path}/service/cloud", 29 "${data_service_path}/service/config/include", 30 "${data_service_path}/service/crypto/include", 31 "${data_service_path}/service/kvdb", 32 "${data_service_path}/service/matrix/include", 33 "${data_service_path}/service/object", 34 "${data_service_path}/service/permission/include", 35 "${data_service_path}/service/rdb", 36 "${kv_store_common_path}", 37 "${kv_store_path}/frameworks/innerkitsimpl/distributeddatafwk/include", 38 "${kv_store_path}/frameworks/innerkitsimpl/kvdb/include", 39 "${kv_store_distributeddb_path}", 40 "${kv_store_distributeddb_path}/include/", 41 "${kv_store_distributeddb_path}/interfaces/include/", 42 "${kv_store_distributeddb_path}/interfaces/include/relational", 43 "${dataobject_path}/frameworks/innerkitsimpl/include", 44 "${relational_store_path}/interfaces/inner_api/cloud_data/include", 45 "${relational_store_path}/interfaces/inner_api/rdb/include", 46 "//third_party/json/single_include", 47 ] 48 49 fuzz_config_file = 50 "${data_service_path}/service/test/fuzztest/cloudservicestub_fuzzer" 51 52 cflags = [ 53 "-g", 54 "-O0", 55 "-Wno-unused-variable", 56 "-fno-omit-frame-pointer", 57 ] 58 59 sources = [ 60 "${data_service_path}/service/cloud/cloud_service_impl.cpp", 61 "${data_service_path}/service/cloud/cloud_service_stub.cpp", 62 "${data_service_path}/service/cloud/sync_manager.cpp", 63 "${data_service_path}/service/rdb/rdb_asset_loader.cpp", 64 "${data_service_path}/service/rdb/rdb_cloud.cpp", 65 "${data_service_path}/service/rdb/rdb_cloud_data_translate.cpp", 66 "${data_service_path}/service/rdb/rdb_cursor.cpp", 67 "${data_service_path}/service/rdb/rdb_general_store.cpp", 68 "${data_service_path}/service/rdb/rdb_notifier_proxy.cpp", 69 "${data_service_path}/service/rdb/rdb_query.cpp", 70 "${data_service_path}/service/rdb/rdb_result_set_impl.cpp", 71 "${data_service_path}/service/rdb/rdb_result_set_stub.cpp", 72 "${data_service_path}/service/rdb/rdb_service_impl.cpp", 73 "${data_service_path}/service/rdb/rdb_service_stub.cpp", 74 "${data_service_path}/service/rdb/rdb_watcher.cpp", 75 "${data_service_path}/service/rdb/value_proxy.cpp", 76 "cloudservicestub_fuzzer.cpp", 77 ] 78 79 deps = [ 80 "${data_service_path}/adapter:distributeddata_adapter", 81 "${data_service_path}/adapter/utils:distributeddata_utils_static", 82 "${data_service_path}/framework:distributeddatasvcfwk", 83 "${data_service_path}/service:distributeddatasvc", 84 "${kv_store_distributeddb_path}:distributeddb", 85 ] 86 87 external_deps = [ 88 "ability_base:want", 89 "ability_base:zuri", 90 "ability_runtime:ability_manager", 91 "ability_runtime:dataobs_manager", 92 "access_token:libaccesstoken_sdk", 93 "access_token:libtoken_setproc", 94 "access_token:libtokenid_sdk", 95 "c_utils:utils", 96 "device_auth:deviceauth_sdk", 97 "device_manager:devicemanagersdk", 98 "hilog:libhilog", 99 "huks:libhukssdk", 100 "ipc:ipc_core", 101 "kv_store:distributeddata_inner", 102 "relational_store:native_rdb", 103 ] 104} 105 106############################################################################### 107group("fuzztest") { 108 testonly = true 109 110 deps = [ ":CloudServiceStubFuzzTest" ] 111} 112############################################################################### 113