# Copyright (c) 2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ##############################hydra-fuzz######################################## import("//build/config/features.gni") import("//build/test.gni") import("//foundation/distributeddatamgr/datamgr_service/datamgr_service.gni") ##############################fuzztest########################################## ohos_fuzztest("DataServiceStubFuzzTest") { module_out_path = "datamgr_service/datamgr_service" include_dirs = [ "${kv_store_common_path}", "${kv_store_path}/frameworks/innerkitsimpl/distributeddatafwk/include", "${kv_store_path}/frameworks/innerkitsimpl/distributeddatasvc/include", "${data_service_path}/service/bootstrap/include", "${data_service_path}/service/config/include", "${data_service_path}/service/crypto/include", "${data_service_path}/service/directory/include", "${data_service_path}/service/permission/include", "${data_service_path}/service/matrix/include", "${data_service_path}/app/src", "${data_service_path}/app/src/backup_rule/include", "${data_service_path}/app/src/checker", "${data_service_path}/app/src/flowctrl_manager", "${data_service_path}/app/src/security", "${data_service_path}/app/src/session_manager", "${data_service_path}/app/src/installer", "${data_service_path}/framework/include", "${data_service_path}/service/backup/include", "${data_service_path}/service/common", "${data_service_path}/service/dumper/include", "${data_service_path}/service/kvdb", "${data_service_path}/service/waterversion", "${data_service_path}/adapter/include/account", "${data_service_path}/adapter/include/permission", "${data_service_path}/adapter/include/installer", "${data_service_path}/adapter/include/broadcaster", "${data_service_path}/adapter/include/utils", "${data_service_path}/adapter/include/dfx", "${data_service_path}/adapter/include", "${device_manager_path}/interfaces/inner_kits/native_cpp/include", "//third_party/json/single_include", ] fuzz_config_file = "${data_service_path}/app/test/fuzztest/dataservicestub_fuzzer" cflags = [ "-g", "-O0", "-Wno-unused-variable", "-fno-omit-frame-pointer", ] sources = [ "${data_service_path}/app/src/db_info_handle_impl.cpp", "${data_service_path}/app/src/feature_stub_impl.cpp", "${data_service_path}/app/src/kvstore_account_observer.cpp", "${data_service_path}/app/src/kvstore_data_service.cpp", "${data_service_path}/app/src/kvstore_data_service_stub.cpp", "${data_service_path}/app/src/kvstore_device_listener.cpp", "${data_service_path}/app/src/kvstore_meta_manager.cpp", "${data_service_path}/app/src/security/security.cpp", "${data_service_path}/app/src/security/sensitive.cpp", "${data_service_path}/app/src/session_manager/route_head_handler_impl.cpp", "${data_service_path}/app/src/session_manager/session_manager.cpp", "${data_service_path}/app/src/session_manager/upgrade_manager.cpp", "${data_service_path}/app/src/task_manager.cpp", "${data_service_path}/service/common/xcollie.cpp", "dataservicestub_fuzzer.cpp", ] deps = [ "${data_service_path}/adapter:distributeddata_adapter", "${data_service_path}/adapter/broadcaster:distributeddata_broadcaster_static", "${data_service_path}/adapter/utils:distributeddata_utils_static", "${data_service_path}/app/src/checker:distributeddata_checker_static", "${data_service_path}/app/src/flowctrl_manager:distributeddata_flowctrl_static", "${data_service_path}/app/src/installer:distributeddata_installer_static", "${data_service_path}/framework:distributeddatasvcfwk", "${data_service_path}/service:distributeddatasvc", "${kv_store_distributeddb_path}:distributeddb", ] external_deps = [ "ability_base:base", "ability_base:want", "access_token:libaccesstoken_sdk", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "dataclassification:data_transit_mgr", "file_api:securitylabel", "hicollie:libhicollie", "hilog:libhilog", "hisysevent:libhisysevent", "hitrace:hitrace_meter", "hitrace:libhitracechain", "ipc:ipc_core", "kv_store:distributeddata_inner", "kv_store:distributeddata_mgr", "memmgr:memmgrclient", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] } ############################################################################### group("fuzztest") { testonly = true deps = [ ":DataServiceStubFuzzTest" ] } ###############################################################################