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 "$BASE_INNERKITS_ROOT/netmanagernative/include", 29 "$BASE_INNERKITS_ROOT/include", 30 "$BASE_INNERKITS_ROOT/dnsresolverclient/include", 31 "$BASE_INNERKITS_ROOT/netconnclient/include", 32 "$NETSYSCONTROLLER_ROOT_DIR/include", 33 "$NETCONNMANAGER_COMMON_DIR/include", 34 "$NETFIREWALLMANAGER_SOURCE_DIR/include", 35 "$EXT_INNERKITS_ROOT/netfirewallclient/include", 36 ] 37 38 cflags = [ 39 "-g", 40 "-O0", 41 "-Wno-unused-variable", 42 "-fno-omit-frame-pointer", 43 ] 44 45 sources = [ "netfirewall_client_test.cpp" ] 46 47 deps = [ 48 "$BASE_INNERKITS_ROOT/netconnclient:net_conn_parcel", 49 "$EXT_INNERKITS_ROOT/netfirewallclient:netfirewall_manager_if", 50 "$EXT_INNERKITS_ROOT/netfirewallclient:netfirewall_parcel", 51 "$NETCONNMANAGER_COMMON_DIR:net_service_common", 52 "$NETFIREWALLMANAGER_SOURCE_DIR:netfirewall_manager_static", 53 "$NETMANAGER_EXT_ROOT/utils:net_manager_ext_common", 54 "$NETMANAGER_EXT_ROOT/utils:net_manager_ext_common", 55 "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller", 56 "$THIRD_PARTY_ROOT/json:nlohmann_json_static", 57 ] 58 59 external_deps = [ 60 "access_token:libaccesstoken_sdk", 61 "access_token:libnativetoken", 62 "access_token:libtoken_setproc", 63 "bundle_framework:appexecfwk_base", 64 "bundle_framework:appexecfwk_core", 65 "c_utils:utils", 66 "dhcp:dhcp_sdk", 67 "eventhandler:libeventhandler", 68 "hilog:libhilog", 69 "hilog:libhilog", 70 "ipc:ipc_core", 71 "netmanager_base:net_native_manager_if", 72 "os_account:os_account_innerkits", 73 ] 74 75 defines = [ 76 "NETMGR_LOG_TAG = \"NetFirewallManager\"", 77 "LOG_DOMAIN = 0xD0015B0", 78 ] 79 80 if (enable_netmgr_ext_debug) { 81 defines += [ "NETMGR_DEBUG" ] 82 } 83 84 part_name = "netmanager_ext" 85 subsystem_name = "communication" 86} 87 88############################################################################### 89group("fuzztest") { 90 testonly = true 91 deps = [ ":netfirewallclient_fuzzer_test" ] 92} 93############################################################################### 94