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("ObjectServiceStubFuzzTest") { 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/config/include", 29 "${data_service_path}/service/crypto/include", 30 "${data_service_path}/service/object", 31 "${kv_store_common_path}", 32 "${kv_store_path}/frameworks/innerkitsimpl/distributeddatafwk/include", 33 "${kv_store_path}/frameworks/innerkitsimpl/kvdb/include", 34 "${kv_store_distributeddb_path}", 35 "${kv_store_distributeddb_path}/include/", 36 "${kv_store_distributeddb_path}/interfaces/include/", 37 "${kv_store_distributeddb_path}/interfaces/include/relational", 38 "${dataobject_path}/frameworks/innerkitsimpl/include", 39 "//third_party/json/single_include", 40 ] 41 42 fuzz_config_file = 43 "${data_service_path}/service/test/fuzztest/objectservicestub_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/backup/src/backup_manager.cpp", 54 "${data_service_path}/service/bootstrap/src/bootstrap.cpp", 55 "${data_service_path}/service/config/src/config_factory.cpp", 56 "${data_service_path}/service/config/src/model/backup_config.cpp", 57 "${data_service_path}/service/config/src/model/checker_config.cpp", 58 "${data_service_path}/service/config/src/model/component_config.cpp", 59 "${data_service_path}/service/config/src/model/directory_config.cpp", 60 "${data_service_path}/service/config/src/model/global_config.cpp", 61 "${data_service_path}/service/config/src/model/network_config.cpp", 62 "${data_service_path}/service/config/src/model/protocol_config.cpp", 63 "${data_service_path}/service/crypto/src/crypto_manager.cpp", 64 "${data_service_path}/service/object/object_callback_proxy.cpp", 65 "${data_service_path}/service/object/object_data_listener.cpp", 66 "${data_service_path}/service/object/object_manager.cpp", 67 "${data_service_path}/service/object/object_service_impl.cpp", 68 "${data_service_path}/service/object/object_service_stub.cpp", 69 "objectservicestub_fuzzer.cpp", 70 ] 71 72 deps = [ 73 "${data_service_path}/adapter:distributeddata_adapter", 74 "${data_service_path}/adapter/utils:distributeddata_utils_static", 75 "${data_service_path}/framework:distributeddatasvcfwk", 76 "${kv_store_distributeddb_path}:distributeddb", 77 ] 78 79 external_deps = [ 80 "ability_base:want", 81 "ability_base:zuri", 82 "ability_runtime:ability_manager", 83 "ability_runtime:dataobs_manager", 84 "access_token:libaccesstoken_sdk", 85 "access_token:libtokenid_sdk", 86 "c_utils:utils", 87 "device_auth:deviceauth_sdk", 88 "device_manager:devicemanagersdk", 89 "hilog:libhilog", 90 "huks:libhukssdk", 91 "ipc:ipc_core", 92 "kv_store:distributeddata_inner", 93 ] 94} 95 96############################################################################### 97group("fuzztest") { 98 testonly = true 99 100 deps = [ ":ObjectServiceStubFuzzTest" ] 101} 102############################################################################### 103