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