# Copyright (c) 2021-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/config/features.gni") #####################hydra-fuzz################### import("//build/test.gni") import("//foundation/communication/netmanager_base/netmanager_base_config.gni") ##############################fuzztest########################################## ohos_fuzztest("NetStatsClientFuzzTest") { module_out_path = fuzz_test_path fuzz_config_file = "$NETMANAGER_BASE_ROOT/test/fuzztest/netstatsclient_fuzzer" _cfi_blocklist_path = "$NETMANAGER_BASE_ROOT/test/fuzztest/netstatsclient_fuzzer/cfi_blocklist.txt" include_dirs = [ "$INNERKITS_ROOT/netstatsclient/include", "$NETCONNMANAGER_COMMON_DIR/include", "$NETSTATSMANAGER_SOURCE_DIR/include/stub", "$NETSTATSMANAGER_SOURCE_DIR/include", "$NETSYSCONTROLLER_ROOT_DIR/include", "$NETSYSNATIVE_SOURCE_DIR/include/manager", "$NETSYSNATIVE_SOURCE_DIR/include/netsys/wrapper", "$NETMANAGERNATIVE_ROOT/netsys_bpf_map/include", ] cflags = [ "-g", "-O0", "-Wno-unused-variable", "-fno-omit-frame-pointer", "-flto", "-fsanitize=cfi", "-fsanitize-cfi-cross-dso", "-fvisibility=hidden", "-fsanitize-blacklist=" + rebase_path(_cfi_blocklist_path, root_build_dir), ] ldflags = [ "-flto", "-fsanitize=cfi", "-fsanitize-cfi-cross-dso", ] sources = [ "mock_net_permission.cpp", "net_stats_client_fuzzer.cpp", ] deps = [ "$INNERKITS_ROOT/netstatsclient:net_stats_manager_if", "$NETMANAGER_BASE_ROOT/services/netstatsmanager:net_stats_manager_static", "$NETMANAGER_BASE_ROOT/utils:net_manager_common", "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller", ] defines = [ "HI_LOG_ENABLE", "DH_LOG_TAG=\"NetStatsClientFuzzTest\"", "LOG_DOMAIN=0xD004100", ] external_deps = [ "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_core", "ipc:ipc_core", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] } ############################################################################### group("fuzztest") { testonly = true deps = [ ":NetStatsClientFuzzTest" ] } ###############################################################################