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("KvdbServiceStubFuzzTest") { 20 module_out_path = "datamgr_service/datamgr_service" 21 22 include_dirs = [ 23 "${data_service_path}/adapter/include", 24 "${data_service_path}/app/src/checker", 25 "${data_service_path}/app/src", 26 "${data_service_path}/framework/include", 27 "${data_service_path}/service/backup/include", 28 "${data_service_path}/service/bootstrap/include", 29 "${data_service_path}/service/common/include", 30 "${data_service_path}/service/config/include", 31 "${data_service_path}/service/crypto/include", 32 "${data_service_path}/service/kvdb", 33 "${data_service_path}/service/matrix/include", 34 "${data_service_path}/service/permission/include", 35 "${kv_store_common_path}", 36 "${kv_store_path}/frameworks/innerkitsimpl/distributeddatafwk/include", 37 "${kv_store_path}/frameworks/innerkitsimpl/distributeddatasvc/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 "//third_party/json/single_include", 44 ] 45 46 fuzz_config_file = 47 "${data_service_path}/service/test/fuzztest/kvdbservicestub_fuzzer" 48 49 cflags = [ 50 "-g", 51 "-O0", 52 "-Wno-unused-variable", 53 "-fno-omit-frame-pointer", 54 ] 55 56 sources = [ 57 "${data_service_path}/app/src/checker/bundle_checker.cpp", 58 "${data_service_path}/app/src/checker/system_checker.cpp", 59 "${data_service_path}/service/backup/src/backup_manager.cpp", 60 "${data_service_path}/service/bootstrap/src/bootstrap.cpp", 61 "${data_service_path}/service/config/src/config_factory.cpp", 62 "${data_service_path}/service/config/src/model/backup_config.cpp", 63 "${data_service_path}/service/config/src/model/checker_config.cpp", 64 "${data_service_path}/service/config/src/model/component_config.cpp", 65 "${data_service_path}/service/config/src/model/directory_config.cpp", 66 "${data_service_path}/service/config/src/model/global_config.cpp", 67 "${data_service_path}/service/config/src/model/network_config.cpp", 68 "${data_service_path}/service/config/src/model/protocol_config.cpp", 69 "${data_service_path}/service/crypto/src/crypto_manager.cpp", 70 "${data_service_path}/service/kvdb/auth_delegate.cpp", 71 "${data_service_path}/service/kvdb/kvdb_exporter.cpp", 72 "${data_service_path}/service/kvdb/kvdb_service_impl.cpp", 73 "${data_service_path}/service/kvdb/kvdb_service_stub.cpp", 74 "${data_service_path}/service/kvdb/kvstore_sync_manager.cpp", 75 "${data_service_path}/service/kvdb/query_helper.cpp", 76 "${data_service_path}/service/kvdb/store_cache.cpp", 77 "${data_service_path}/service/kvdb/upgrade.cpp", 78 "${data_service_path}/service/kvdb/user_delegate.cpp", 79 "${data_service_path}/service/matrix/src/device_matrix.cpp", 80 "${data_service_path}/service/matrix/src/matrix_event.cpp", 81 "${data_service_path}/service/permission/src/permit_delegate.cpp", 82 "kvdbservicestub_fuzzer.cpp", 83 ] 84 85 deps = [ 86 "${data_service_path}/adapter:distributeddata_adapter", 87 "${data_service_path}/adapter/utils:distributeddata_utils_static", 88 "${data_service_path}/framework:distributeddatasvcfwk", 89 "${kv_store_distributeddb_path}:distributeddb", 90 ] 91 92 external_deps = [ 93 "ability_base:want", 94 "ability_base:zuri", 95 "ability_runtime:ability_manager", 96 "ability_runtime:dataobs_manager", 97 "access_token:libaccesstoken_sdk", 98 "access_token:libtokenid_sdk", 99 "c_utils:utils", 100 "device_auth:deviceauth_sdk", 101 "device_manager:devicemanagersdk", 102 "hilog:libhilog", 103 "huks:libhukssdk", 104 "ipc:ipc_core", 105 "kv_store:distributeddata_inner", 106 "kv_store:distributeddata_mgr", 107 ] 108} 109 110############################################################################### 111group("fuzztest") { 112 testonly = true 113 114 deps = [ ":KvdbServiceStubFuzzTest" ] 115} 116############################################################################### 117