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 14import("//build/config/features.gni") 15import("//build/test.gni") 16import("//foundation/communication/netmanager_ext/netmanager_ext_config.gni") 17 18EXT_SECURITY_PATH = "../../.." 19 20ohos_fuzztest("netfirewallclient_fuzzer_test") { 21 module_out_path = fuzz_test_path 22 fuzz_config_file = "$NETMANAGER_EXT_ROOT/test/netfirewallmanager/fuzztest/netfirewallclient_fuzzer" 23 24 include_dirs = [ 25 "$EXT_INNERKITS_ROOT/include", 26 "$EXT_SECURITY_PATH/security", 27 "$NETMANAGER_EXT_ROOT/utils/log/include", 28 "$NETSYSCONTROLLER_ROOT_DIR/include", 29 "$NETCONNMANAGER_COMMON_DIR/include", 30 "$NETFIREWALLMANAGER_SOURCE_DIR/include", 31 "$EXT_INNERKITS_ROOT/netfirewallclient/include", 32 ] 33 34 cflags = [ 35 "-g", 36 "-O0", 37 "-Wno-unused-variable", 38 "-fno-omit-frame-pointer", 39 "-flto", 40 "-fsanitize=cfi", 41 "-fsanitize-cfi-cross-dso", 42 "-fvisibility=hidden", 43 ] 44 45 ldflags = [ 46 "-flto", 47 "-fsanitize=cfi", 48 "-fsanitize-cfi-cross-dso", 49 ] 50 51 sources = [ "netfirewall_client_test.cpp" ] 52 53 deps = [ 54 "$EXT_INNERKITS_ROOT/netfirewallclient:netfirewall_manager_if", 55 "$EXT_INNERKITS_ROOT/netfirewallclient:netfirewall_parcel", 56 "$NETCONNMANAGER_COMMON_DIR:net_service_common", 57 "$NETFIREWALLMANAGER_SOURCE_DIR:netfirewall_manager_static", 58 "$NETMANAGER_EXT_ROOT/utils:net_manager_ext_common", 59 "$NETMANAGER_EXT_ROOT/utils:net_manager_ext_common", 60 "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller", 61 ] 62 63 external_deps = [ 64 "access_token:libaccesstoken_sdk", 65 "access_token:libnativetoken", 66 "access_token:libtoken_setproc", 67 "bundle_framework:appexecfwk_base", 68 "bundle_framework:appexecfwk_core", 69 "c_utils:utils", 70 "dhcp:dhcp_sdk", 71 "eventhandler:libeventhandler", 72 "ffrt:libffrt", 73 "hilog:libhilog", 74 "ipc:ipc_core", 75 "json:nlohmann_json_static", 76 "netmanager_base:net_conn_parcel", 77 "netmanager_base:net_manager_common", 78 "netmanager_base:net_native_manager_if", 79 "netmanager_base:net_native_manager_if", 80 "os_account:os_account_innerkits", 81 ] 82 83 defines = [ 84 "NETMGR_LOG_TAG = \"NetFirewallManager\"", 85 "LOG_DOMAIN = 0xD0015B0", 86 ] 87 88 if (enable_netmgr_ext_debug) { 89 defines += [ "NETMGR_DEBUG" ] 90 } 91 92 part_name = "netmanager_ext" 93 subsystem_name = "communication" 94} 95 96############################################################################### 97group("fuzztest") { 98 testonly = true 99 deps = [ ":netfirewallclient_fuzzer_test" ] 100} 101############################################################################### 102