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 14import("//build/config/features.gni") 15import("//build/test.gni") 16import("//foundation/filemanagement/storage_service/storage_service_aafwk.gni") 17 18ohos_fuzztest("StorageManagerProviderFuzzTest") { 19 module_out_path = "storage_service/storage_service" 20 fuzz_config_file = 21 "${storage_service_path}/test/fuzztest/storagemanagerprovider_fuzzer" 22 include_dirs = [ 23 "${storage_service_common_path}/include", 24 "${storage_manager_path}/include", 25 "${storage_manager_path}/include/ipc", 26 "${storage_daemon_path}/include", 27 "${storage_interface_path}/innerkits/storage_manager/native", 28 "${storage_interface_path}/innerkits/storage_manager/native", 29 ] 30 cflags = [ 31 "-g", 32 "-O0", 33 "-Wno-unused-variable", 34 "-fno-omit-frame-pointer", 35 ] 36 sources = [ "storagemanagerprovider_fuzzer.cpp" ] 37 38 defines = [ 39 "STORAGE_LOG_TAG = \"storage_service\"", 40 "private=public", 41 ] 42 deps = [ 43 "${storage_daemon_path}:storage_common_utils", 44 "${storage_daemon_path}:storage_daemon_header", 45 "${storage_daemon_path}/libfscrypt:libfscryptutils", 46 "${storage_interface_path}/innerkits/storage_manager/native:storage_manager_header", 47 "${storage_interface_path}/innerkits/storage_manager/native:storage_manager_sa_proxy", 48 "${storage_manager_path}:storage_manager", 49 ] 50 external_deps = [ 51 "ability_base:want", 52 "access_token:libaccesstoken_sdk", 53 "appspawn:appspawn_client", 54 "bundle_framework:appexecfwk_core", 55 "hilog:libhilog", 56 "hisysevent:libhisysevent", 57 "os_account:os_account_innerkits", 58 "safwk:system_ability_fwk", 59 ] 60 if (storage_service_user_crypto_manager) { 61 defines += [ "USER_CRYPTO_MANAGER" ] 62 sources += [ "${storage_manager_path}/crypto/filesystem_crypto.cpp" ] 63 external_deps += [ "data_share:datashare_consumer" ] 64 } 65 66 if (storage_service_media_fuse) { 67 defines += [ "STORAGE_SERVICE_MEDIA_FUSE" ] 68 } 69} 70 71group("fuzztest") { 72 testonly = true 73 deps = [ ":StorageManagerProviderFuzzTest" ] 74} 75