1b1b8bc3fSopenharmony_ci# Copyright (c) 2022-2024 Huawei Device Co., Ltd.
2b1b8bc3fSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
3b1b8bc3fSopenharmony_ci# you may not use this file except in compliance with the License.
4b1b8bc3fSopenharmony_ci# You may obtain a copy of the License at
5b1b8bc3fSopenharmony_ci#
6b1b8bc3fSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
7b1b8bc3fSopenharmony_ci#
8b1b8bc3fSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
9b1b8bc3fSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
10b1b8bc3fSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11b1b8bc3fSopenharmony_ci# See the License for the specific language governing permissions and
12b1b8bc3fSopenharmony_ci# limitations under the License.
13b1b8bc3fSopenharmony_ci
14b1b8bc3fSopenharmony_ciimport("//build/config/features.gni")
15b1b8bc3fSopenharmony_ci
16b1b8bc3fSopenharmony_ci#####################hydra-fuzz###################
17b1b8bc3fSopenharmony_ciimport("//build/test.gni")
18b1b8bc3fSopenharmony_ciimport("//foundation/communication/netmanager_base/netmanager_base_config.gni")
19b1b8bc3fSopenharmony_ci
20b1b8bc3fSopenharmony_ci##############################fuzztest##########################################
21b1b8bc3fSopenharmony_ciohos_fuzztest("NetConnClientFuzzTest") {
22b1b8bc3fSopenharmony_ci  module_out_path = fuzz_test_path
23b1b8bc3fSopenharmony_ci  fuzz_config_file = "$NETMANAGER_BASE_ROOT/test/fuzztest/netconnclient_fuzzer"
24b1b8bc3fSopenharmony_ci
25b1b8bc3fSopenharmony_ci  include_dirs = [
26b1b8bc3fSopenharmony_ci    "$INNERKITS_ROOT/include",
27b1b8bc3fSopenharmony_ci    "$INNERKITS_ROOT/netconnclient/include",
28b1b8bc3fSopenharmony_ci    "$INNERKITS_ROOT/netconnclient/include/proxy",
29b1b8bc3fSopenharmony_ci    "$INNERKITS_ROOT/netmanagernative/include",
30b1b8bc3fSopenharmony_ci    "$NETCONNMANAGER_SOURCE_DIR/include/stub",
31b1b8bc3fSopenharmony_ci    "$NETCONNMANAGER_SOURCE_DIR/include",
32b1b8bc3fSopenharmony_ci    "$SAMGR_MANAGER_ROOT/interfaces/innerkits/samgr_proxy/include",
33b1b8bc3fSopenharmony_ci    "$NETMANAGERNATIVE_ROOT/net_mgr_native/include",
34b1b8bc3fSopenharmony_ci    "$NETMANAGERNATIVE_ROOT/common/include",
35b1b8bc3fSopenharmony_ci    "$NETMANAGER_BASE_ROOT/services/common/include",
36b1b8bc3fSopenharmony_ci    "$NETMANAGER_BASE_ROOT/test/commonduplicatedcode",
37b1b8bc3fSopenharmony_ci    "$NETMANAGER_BASE_ROOT/test/security",
38b1b8bc3fSopenharmony_ci    "$NETSYSCONTROLLER_ROOT_DIR/include",
39b1b8bc3fSopenharmony_ci    "$THIRD_PARTY_ROOT/curl/include",
40b1b8bc3fSopenharmony_ci    "$NETPOLICYMANAGER_SOURCE_DIR/include",
41b1b8bc3fSopenharmony_ci    "$NETPOLICYMANAGER_SOURCE_DIR/include/stub",
42b1b8bc3fSopenharmony_ci  ]
43b1b8bc3fSopenharmony_ci
44b1b8bc3fSopenharmony_ci  cflags = [
45b1b8bc3fSopenharmony_ci    "-g",
46b1b8bc3fSopenharmony_ci    "-O0",
47b1b8bc3fSopenharmony_ci    "-Wno-unused-variable",
48b1b8bc3fSopenharmony_ci    "-fno-omit-frame-pointer",
49b1b8bc3fSopenharmony_ci  ]
50b1b8bc3fSopenharmony_ci
51b1b8bc3fSopenharmony_ci  sources = [
52b1b8bc3fSopenharmony_ci    "$NETMANAGER_BASE_ROOT/test/security/netmanager_base_test_security.cpp",
53b1b8bc3fSopenharmony_ci    "mock_net_conn_permission.cpp",
54b1b8bc3fSopenharmony_ci    "net_conn_client_fuzzer.cpp",
55b1b8bc3fSopenharmony_ci  ]
56b1b8bc3fSopenharmony_ci
57b1b8bc3fSopenharmony_ci  deps = [
58b1b8bc3fSopenharmony_ci    "$INNERKITS_ROOT/netconnclient:net_conn_manager_if",
59b1b8bc3fSopenharmony_ci    "$NETCONNMANAGER_SOURCE_DIR:net_conn_manager_static",
60b1b8bc3fSopenharmony_ci    "$NETMANAGER_BASE_ROOT/utils:net_manager_common",
61b1b8bc3fSopenharmony_ci    "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller",
62b1b8bc3fSopenharmony_ci    "$THIRD_PARTY_ROOT/curl:curl_shared",
63b1b8bc3fSopenharmony_ci  ]
64b1b8bc3fSopenharmony_ci
65b1b8bc3fSopenharmony_ci  defines = [
66b1b8bc3fSopenharmony_ci    "HI_LOG_ENABLE",
67b1b8bc3fSopenharmony_ci    "DH_LOG_TAG=\"NetConnClientFuzzTest\"",
68b1b8bc3fSopenharmony_ci    "LOG_DOMAIN=0xD004100",
69b1b8bc3fSopenharmony_ci  ]
70b1b8bc3fSopenharmony_ci
71b1b8bc3fSopenharmony_ci  external_deps = [
72b1b8bc3fSopenharmony_ci    "ability_base:want",
73b1b8bc3fSopenharmony_ci    "ability_base:zuri",
74b1b8bc3fSopenharmony_ci    "ability_runtime:ability_manager",
75b1b8bc3fSopenharmony_ci    "access_token:libaccesstoken_sdk",
76b1b8bc3fSopenharmony_ci    "access_token:libnativetoken",
77b1b8bc3fSopenharmony_ci    "access_token:libtoken_setproc",
78b1b8bc3fSopenharmony_ci    "bundle_framework:appexecfwk_base",
79b1b8bc3fSopenharmony_ci    "bundle_framework:appexecfwk_core",
80b1b8bc3fSopenharmony_ci    "cJSON:cjson",
81b1b8bc3fSopenharmony_ci    "data_share:datashare_common",
82b1b8bc3fSopenharmony_ci    "data_share:datashare_consumer",
83b1b8bc3fSopenharmony_ci    "eventhandler:libeventhandler",
84b1b8bc3fSopenharmony_ci    "ffrt:libffrt",
85b1b8bc3fSopenharmony_ci    "hilog:libhilog",
86b1b8bc3fSopenharmony_ci    "hitrace:hitrace_meter",
87b1b8bc3fSopenharmony_ci    "init:libbegetutil",
88b1b8bc3fSopenharmony_ci    "ipc:ipc_core",
89b1b8bc3fSopenharmony_ci    "os_account:os_account_innerkits",
90b1b8bc3fSopenharmony_ci    "safwk:system_ability_fwk",
91b1b8bc3fSopenharmony_ci    "samgr:samgr_proxy",
92b1b8bc3fSopenharmony_ci  ]
93b1b8bc3fSopenharmony_ci}
94b1b8bc3fSopenharmony_ci
95b1b8bc3fSopenharmony_ci###############################################################################
96b1b8bc3fSopenharmony_cigroup("fuzztest") {
97b1b8bc3fSopenharmony_ci  testonly = true
98b1b8bc3fSopenharmony_ci
99b1b8bc3fSopenharmony_ci  deps = [ ":NetConnClientFuzzTest" ]
100b1b8bc3fSopenharmony_ci}
101b1b8bc3fSopenharmony_ci
102b1b8bc3fSopenharmony_ci###############################################################################
103b1b8bc3fSopenharmony_ci
104