1# Copyright (c) 2022 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")
18
19##############################fuzztest##########################################
20ohos_fuzztest("UpdateActiveMachineFuzzTest") {
21  module_output_path = "cellular_data/cellular_data"
22  module_out_path = module_output_path
23  SOURCE_DIR = "../../.."
24  fuzz_config_file = "$SOURCE_DIR/test/fuzztest/updateactivemachine_fuzzer"
25  include_dirs = [
26    "$SOURCE_DIR/services/include",
27    "$SOURCE_DIR/services/include/apn_manager",
28    "$SOURCE_DIR/services/include/common",
29    "$SOURCE_DIR/services/include/state_machine",
30    "$SOURCE_DIR/services/include/utils",
31    "$SOURCE_DIR/test/fuzztest/common_fuzzer",
32  ]
33
34  deps = [
35    "$SOURCE_DIR:tel_cellular_data",
36    "$SOURCE_DIR/frameworks/native:tel_cellular_data_api",
37  ]
38
39  external_deps = [
40    "ability_runtime:ability_manager",
41    "ability_runtime:data_ability_helper",
42    "access_token:libaccesstoken_sdk",
43    "access_token:libnativetoken",
44    "access_token:libtoken_setproc",
45    "bundle_framework:appexecfwk_core",
46    "c_utils:utils",
47    "common_event_service:cesfwk_innerkits",
48    "core_service:libtel_common",
49    "core_service:tel_core_service_api",
50    "eventhandler:libeventhandler",
51    "hilog:libhilog",
52    "init:libbegetutil",
53    "netmanager_base:net_conn_manager_if",
54    "netmanager_base:net_policy_manager_if",
55    "netmanager_base:net_stats_manager_if",
56    "relational_store:native_rdb",
57    "telephony_data:tel_telephony_data",
58  ]
59
60  defines = [
61    "TELEPHONY_LOG_TAG = \"CellularDataFuzzTest\"",
62    "LOG_DOMAIN = 0xD000F00",
63  ]
64
65  cflags = [
66    "-g",
67    "-O0",
68    "-Wno-unused-variable",
69    "-fno-omit-frame-pointer",
70    "-flto",
71    "-fsanitize=cfi",
72    "-fsanitize-cfi-cross-dso",
73    "-fvisibility=hidden",
74  ]
75
76  ldflags = [
77    "-flto",
78    "-fsanitize=cfi",
79    "-fsanitize-cfi-cross-dso",
80  ]
81
82  sources = [
83    "$SOURCE_DIR/test/fuzztest/common_fuzzer/adddatatoken_fuzzer.cpp",
84    "$SOURCE_DIR/test/fuzztest/common_fuzzer/statemachine_fuzzer.cpp",
85    "updateactivemachine_fuzzer.cpp",
86  ]
87}
88
89###############################################################################
90group("fuzztest") {
91  testonly = true
92  deps = []
93  deps += [
94    # deps file
95    ":UpdateActiveMachineFuzzTest",
96  ]
97}
98###############################################################################
99