1# Copyright (c) 2022-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
14#####################hydra-fuzz###################
15SUBSYSTEM_DIR = "../../../.."
16import("//build/config/features.gni")
17import("//build/ohos.gni")
18import("//build/test.gni")
19
20##############################fuzztest##########################################
21ohos_fuzztest("GetSimEonsFuzzTest") {
22  module_output_path = "core_service/core_service"
23  module_out_path = module_output_path
24  fuzz_config_file =
25      "$SUBSYSTEM_DIR/core_service/test/fuzztest/getsimeons_fuzzer"
26
27  include_dirs = [
28    "$SUBSYSTEM_DIR/core_service/frameworks/js/napi/include",
29    "$SUBSYSTEM_DIR/core_service/frameworks/js/napi",
30    "$SUBSYSTEM_DIR/core_service/services/core/include",
31    "$SUBSYSTEM_DIR/core_service/services/network_search/include",
32    "$SUBSYSTEM_DIR/core_service/utils/common/include",
33    "$SUBSYSTEM_DIR/core_service/services/sim/include",
34    "$SUBSYSTEM_DIR/core_service/test/fuzztest/common_fuzzer",
35    "$SUBSYSTEM_DIR/core_service/services/tel_ril/include",
36  ]
37
38  configs = [ "$SUBSYSTEM_DIR/core_service/utils:telephony_log_config" ]
39
40  deps = [
41    "$SUBSYSTEM_DIR/core_service:tel_core_service",
42    "$SUBSYSTEM_DIR/core_service/interfaces/innerkits:tel_core_service_api",
43    "$SUBSYSTEM_DIR/core_service/utils:libtel_common",
44  ]
45
46  external_deps = [
47    "ability_runtime:ability_manager",
48    "ability_runtime:data_ability_helper",
49    "access_token:libaccesstoken_sdk",
50    "access_token:libnativetoken",
51    "access_token:libtoken_setproc",
52    "c_utils:utils",
53    "drivers_interface_ril:ril_idl_headers",
54    "hdf_core:libhdi",
55    "hilog:libhilog",
56    "init:libbegetutil",
57    "ipc:ipc_single",
58    "napi:ace_napi",
59    "netmanager_base:net_conn_manager_if",
60    "netmanager_ext:net_tether_manager_if",
61    "power_manager:powermgr_client",
62    "samgr:samgr_proxy",
63  ]
64  defines = [
65    "TELEPHONY_LOG_TAG = \"CoreServiceFuzzTest\"",
66    "LOG_DOMAIN = 0xD000F00",
67  ]
68
69  cflags = [
70    "-g",
71    "-O0",
72    "-Wno-unused-variable",
73    "-fno-omit-frame-pointer",
74    "-flto",
75    "-fsanitize=cfi",
76    "-fsanitize-cfi-cross-dso",
77    "-fvisibility=hidden",
78  ]
79
80  ldflags = [
81    "-flto",
82    "-fsanitize=cfi",
83    "-fsanitize-cfi-cross-dso",
84  ]
85
86  sources = [
87    "$SUBSYSTEM_DIR/core_service/frameworks/js/napi/napi_util.cpp",
88    "$SUBSYSTEM_DIR/core_service/test/fuzztest/common_fuzzer/addcoreservicetoken_fuzzer.cpp",
89    "getsimeons_fuzzer.cpp",
90  ]
91}
92
93###############################################################################
94group("fuzztest") {
95  testonly = true
96  deps = []
97  deps += [
98    # deps file
99    ":GetSimEonsFuzzTest",
100  ]
101}
102###############################################################################
103