1# Copyright (c) 2025 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 14#####################hydra-fuzz################### 15import("//build/config/features.gni") 16import("//build/ohos.gni") 17import("//build/test.gni") 18import("../../../../appexecfwk.gni") 19import("../../../../services/bundlemgr/appexecfwk_bundlemgr.gni") 20module_output_path = fuzz_test_path 21 22##############################fuzztest########################################## 23ohos_fuzztest("BMSDeleteFirstInstallBundleInfoFuzzTest") { 24 use_exceptions = true 25 module_out_path = module_output_path 26 fuzz_config_file = 27 "../../../fuzztest/fuzztest_bundlemanager/bmsdeletefirstinstallbundleinfo_fuzzer" 28 29 cflags = [ 30 "-g", 31 "-O0", 32 "-Wno-unused-variable", 33 "-fno-omit-frame-pointer", 34 ] 35 36 sources = [ 37 "${services_path}/bundlemgr/src/rdb/bms_rdb_open_callback.cpp", 38 "${services_path}/bundlemgr/src/rdb/rdb_data_manager.cpp", 39 "${services_path}/bundlemgr/src/bundle_data_storage_rdb.cpp", 40 "${services_path}/bundlemgr/src/preinstall_data_storage_rdb.cpp", 41 "bmsdeletefirstinstallbundleinfo_fuzzer.cpp", 42 ] 43 sources += bundle_install_sources 44 sources += bundle_mgr_source 45 46 deps = [ 47 "${base_path}:appexecfwk_base", 48 "${common_path}:libappexecfwk_common", 49 "${core_path}:appexecfwk_core", 50 "${services_path}/bundlemgr:libbms", 51 ] 52 deps += bundle_install_deps 53 54 include_dirs = [ 55 "${services_path}/bundlemgr/include/first_install_data_mgr", 56 "${services_path}/bundlemgr/include/rdb", 57 "${services_path}/bundlemgr/include/common", 58 "${services_path}/bundlemgr/include/inner_bundle_info.h", 59 "${test_path}/fuzztest", 60 ] 61 62 external_deps = [ 63 "ability_base:want", 64 "c_utils:utils", 65 "ipc:ipc_core", 66 "hilog:libhilog", 67 "ability_runtime:app_manager", 68 "access_token:el5_filekey_manager_sdk", 69 "access_token:libaccesstoken_sdk", 70 "access_token:libprivacy_sdk", 71 "access_token:libtokenid_sdk", 72 "appverify:libhapverify", 73 "common_event_service:cesfwk_innerkits", 74 "eventhandler:libeventhandler", 75 "hitrace:hitrace_meter", 76 "init:libbegetutil", 77 "kv_store:distributeddata_inner", 78 "relational_store:native_rdb", 79 "safwk:system_ability_fwk", 80 "samgr:samgr_proxy", 81 "selinux_adapter:librestorecon", 82 "syscap_codec:syscap_interface_shared", 83 ] 84 external_deps += bundle_install_external_deps 85}