1# Copyright (c) 2022-2023 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/test.gni") 15import("//third_party/wpa_supplicant/wpa_supplicant-2.9_standard/wpa.gni") 16import("../../../../../hdf_core/adapter/uhdf2/uhdf.gni") 17 18TEST_ROOT_DIR = "../../.." 19 20module_output_path = "drivers_peripheral_wlan/drivers_peripheral_wlan" 21 22ohos_fuzztest("WpaFuzzTest") { 23 module_out_path = module_output_path 24 25 fuzz_config_file = "$TEST_ROOT_DIR/test/fuzztest/wpa_fuzzer" 26 27 include_dirs = [ 28 "$TEST_ROOT_DIR/interfaces/include", 29 "$TEST_ROOT_DIR/test/fuzztest", 30 "$TEST_ROOT_DIR/wpa/interfaces/hdi_service", 31 "$TEST_ROOT_DIR/wpa/interfaces/hdi_service/service_common", 32 "./service_common", 33 "../../client/include", 34 "//third_party/wpa_supplicant/wpa_supplicant-2.9_standard", 35 "//third_party/wpa_supplicant/wpa_supplicant-2.9_standard/src", 36 "//third_party/wpa_supplicant/wpa_supplicant-2.9_standard/src/utils", 37 "//third_party/wpa_supplicant/wpa_supplicant-2.9_standard/wpa_supplicant", 38 "//third_party/wpa_supplicant/wpa_supplicant-2.9_standard/wpa_supplicant_lib", 39 ] 40 41 deps = [ "$TEST_ROOT_DIR/hdi_service:hdi_wlan_service" ] 42 43 defines = [ "__OHOS__USER__" ] 44 45 external_deps = [ 46 "c_utils:utils", 47 "drivers_interface_wlan:libwlan_proxy_1.3", 48 "drivers_interface_wlan:libwpa_proxy_1.1", 49 "drivers_interface_wlan:libwpa_stub_1.0", 50 "hdf_core:libhdf_host", 51 "hdf_core:libhdf_ipc_adapter", 52 "hdf_core:libhdf_utils", 53 "hdf_core:libhdi", 54 "hdf_core:libpub_utils", 55 "hilog:libhilog", 56 "wpa_supplicant:wpa", 57 ] 58 59 cflags = [ 60 "-g", 61 "-O0", 62 "-Wno-unused-variable", 63 "-fno-omit-frame-pointer", 64 "-fno-strict-aliasing", 65 "-DCONFIG_CTRL_IFACE", 66 "-DCONFIG_WEP", 67 "-DCONFIG_WPS", 68 ] 69 70 public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ] 71 72 sources = [ 73 "$TEST_ROOT_DIR/test/fuzztest/wpa_common_fuzzer.cpp", 74 "wpa_fuzzer.cpp", 75 ] 76} 77 78group("wpa_fuzztest") { 79 testonly = true 80 deps = [ ":WpaFuzzTest" ] 81} 82