• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
14import("//build/config/features.gni")
15import("//build/test.gni")
16import("//foundation/filemanagement/storage_service/storage_service_aafwk.gni")
17
18ohos_fuzztest("StorageDaemonCreateShareFileFuzzTest") {
19  module_out_path = "storage_service/storage_service"
20  fuzz_config_file = "${storage_service_path}/test/fuzztest/storagedaemoncreatesharefile_fuzzer"
21  include_dirs = [
22    "${storage_service_common_path}/include",
23    "${storage_daemon_path}/include",
24    "${storage_daemon_path}/include/ipc",
25    "${storage_daemon_path}/include/quota",
26    "${storage_daemon_path}/include/user",
27    "${storage_daemon_path}/include/utils",
28  ]
29  cflags = [
30    "-g",
31    "-O0",
32    "-Wno-unused-variable",
33    "-fno-omit-frame-pointer",
34  ]
35  sources = [
36    "${storage_daemon_path}/ipc/src/storage_daemon.cpp",
37    "${storage_daemon_path}/ipc/src/storage_daemon_stub.cpp",
38    "${storage_daemon_path}/quota/quota_manager.cpp",
39    "${storage_daemon_path}/user/src/mount_manager.cpp",
40    "${storage_daemon_path}/user/src/user_manager.cpp",
41    "${storage_daemon_path}/utils/file_utils.cpp",
42    "${storage_daemon_path}/utils/mount_argument_utils.cpp",
43    "${storage_daemon_path}/utils/string_utils.cpp",
44    "${storage_service_path}/test/fuzztest/storagedaemoncreatesharefile_fuzzer/storagedaemoncreatesharefile_fuzzer.cpp",
45  ]
46
47  defines = [
48    "STORAGE_LOG_TAG = \"storage_service\"",
49    "STORAGE_DAEMON_FUZZ_TEST",
50  ]
51  deps = [ "${bundlemanager_framework_path}/services/bundlemgr:libbms" ]
52
53  external_deps = [
54    "ability_runtime:abilitykit_native",
55    "app_file_service:fileshare_native",
56    "bundle_framework:appexecfwk_core",
57    "c_utils:utils",
58    "hilog:libhilog",
59    "init:libbegetutil",
60    "ipc:ipc_core",
61    "safwk:system_ability_fwk",
62    "samgr:samgr_proxy",
63  ]
64
65  if (storage_service_dfs_service) {
66    defines += [ "DFS_SERVICE" ]
67    external_deps += [ "dfs_service:cloud_daemon_kit_inner" ]
68  }
69
70  use_exceptions = true
71}
72
73group("fuzztest") {
74  testonly = true
75  deps = [ ":StorageDaemonCreateShareFileFuzzTest" ]
76}
77