1# Copyright (c) 2024 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("//base/security/security_guard/security_guard.gni") 15import("//build/config/features.gni") 16import("//build/test.gni") 17 18ohos_fuzztest("DataCollectFuzzTest") { 19 module_out_path = fuzz_test_output_path 20 fuzz_config_file = 21 "${sg_root_dir}/test/fuzztest/data_collect/datacollect_fuzzer" 22 23 include_dirs = [ 24 "${sg_root_dir}/services/risk_classify/model_manager/include", 25 "${sg_root_dir}/services/config_manager/include", 26 "${sg_root_dir}/interfaces/inner_api/common/include", 27 "${sg_root_dir}/interfaces/inner_api/collect/include", 28 "${sg_root_dir}/frameworks/common/collect/include", 29 "${sg_root_dir}/interfaces/inner_api/collector/include", 30 "${sg_root_dir}/frameworks/common/collector/include", 31 "${sg_root_dir}/services/bigdata/include", 32 "${sg_root_dir}/services/config_manager/include", 33 "${sg_root_dir}/services/data_collect/sa/include", 34 "${sg_root_dir}/services/data_collect/store/include", 35 "${sg_root_dir}/services/risk_collect/include", 36 "${sg_root_dir}/frameworks/common/constants/include", 37 "${sg_root_dir}/frameworks/common/json/include", 38 "${sg_root_dir}/frameworks/common/task_handler/include", 39 "${sg_root_dir}/frameworks/common/database/include", 40 "${sg_root_dir}/frameworks/common/log/include", 41 "${sg_root_dir}/frameworks/common/utils/include", 42 "${sg_root_dir}/services/collector_manager/include", 43 "${sg_root_dir}/services/risk_classify/model_manager/include", 44 "${sg_root_dir}/interfaces/inner_api/classify/include", 45 "${sg_root_dir}/frameworks/common/classify/include", 46 ] 47 cflags = [ 48 "-g", 49 "-O0", 50 "-Wno-unused-variable", 51 "-fno-omit-frame-pointer", 52 ] 53 54 defines = [] 55 defines += [ 56 "SECURITY_GUARD_EVENT_CFG_SOURCE = \"${security_guard_event_cfg_source}\"", 57 "SECURITY_GUARD_MODEL_CFG_SOURCE = \"${security_guard_model_cfg_source}\"", 58 "SECURITY_GUARD_EVENT_GROUP_CFG_SOURCE = \"${security_guard_event_group_cfg_source}\"", 59 "SECURITY_GUARD_CONFIG_UPDATE_TRUST_LIST_SOURCE = \"${security_guard_config_update_trust_list_source}\"", 60 "SECURITY_GUARD_COLLECTOR_CFG_SOURCE = \"${security_guard_collector_cfg_source}\"", 61 ] 62 63 sources = [ 64 "${sg_root_dir}/frameworks/common/collector/src/security_collector_event_filter.cpp", 65 "${sg_root_dir}/frameworks/common/collector/src/security_collector_subscribe_info.cpp", 66 "${sg_root_dir}/frameworks/common/json/src/json_cfg.cpp", 67 "${sg_root_dir}/frameworks/common/utils/src/security_guard_utils.cpp", 68 "${sg_root_dir}/services/data_collect/sa/acquire_data_callback_proxy.cpp", 69 "${sg_root_dir}/services/data_collect/sa/acquire_data_subscribe_manager.cpp", 70 "${sg_root_dir}/services/data_collect/sa/data_collect_manager_callback_proxy.cpp", 71 "${sg_root_dir}/services/data_collect/sa/data_collect_manager_service.cpp", 72 "${sg_root_dir}/services/data_collect/sa/data_collect_manager_stub.cpp", 73 "${sg_root_dir}/services/data_collect/sa/data_format.cpp", 74 "${sg_root_dir}/services/data_collect/sa/security_event_query_callback_proxy.cpp", 75 "${sg_root_dir}/services/data_collect/store/src/database_helper.cpp", 76 "${sg_root_dir}/services/data_collect/store/src/database_manager.cpp", 77 "${sg_root_dir}/services/data_collect/store/src/file_system_store_helper.cpp", 78 "${sg_root_dir}/services/data_collect/store/src/rdb_event_store_callback.cpp", 79 "${sg_root_dir}/services/data_collect/store/src/risk_event_rdb_helper.cpp", 80 "data_collect_fuzzer.cpp", 81 "database_mock.cpp", 82 ] 83 84 deps = [ 85 "${sg_root_dir}/frameworks/common/collect:libsg_collect_sdk", 86 "${sg_root_dir}/frameworks/common/collector:libsg_collector_sdk", 87 "${sg_root_dir}/services/bigdata:sg_bigdata_stamp", 88 "${sg_root_dir}/services/collector_manager:security_collector_manager", 89 "${sg_root_dir}/services/config_manager:sg_config_manager", 90 "${sg_root_dir}/services/data_collect:sg_collect_service_database", 91 "${sg_root_dir}/services/risk_classify/model_manager:sg_model_manager_stamp", 92 ] 93 94 external_deps = [ 95 "access_token:libaccesstoken_sdk", 96 "access_token:libtokenid_sdk", 97 "c_utils:utils", 98 "common_event_service:cesfwk_innerkits", 99 "ffrt:libffrt", 100 "hilog:libhilog", 101 "hisysevent:libhisysevent", 102 "hisysevent:libhisyseventmanager", 103 "ipc:ipc_core", 104 "json:nlohmann_json_static", 105 "relational_store:native_rdb", 106 "safwk:system_ability_fwk", 107 "samgr:samgr_proxy", 108 "zlib:libz", 109 ] 110} 111