diff --git a/test/fuzztest/BUILD.gn b/test/fuzztest/BUILD.gn index 7d9ac4bb529990d744d8b90048f4fb590436cdc8..9b8fa3a211b84602bf7a3da106261ae77668dc1b 100644 --- a/test/fuzztest/BUILD.gn +++ b/test/fuzztest/BUILD.gn @@ -3086,6 +3086,56 @@ ohos_fuzztest("OnStopFuzzTest") { } } +ohos_fuzztest("ProcessWatcherMessageFuzzTest") { + module_out_path = module_output_path + fuzz_config_file = "//base/startup/init/test/fuzztest/processwatchermessage_fuzzer" + + sources = [ + "//base/startup/init/services/param/linux/param_message.c", + "//base/startup/init/services/param/watcher/proxy/watcher_manager.cpp", + ] + include_dirs = [ + "//base/startup/init/interfaces/innerkits/include", + "//base/startup/init/test/fuzztest/utils/include", + "//base/startup/init/services/param/watcher/proxy", + "//base/startup/init/services/param/watcher/include", + "//base/startup/init/services/param/include", + "//base/startup/init/interfaces/innerkits/include/param", + "//base/startup/init/services/param/linux", + "//base/startup/init/services/loopevent/include", + "//base/startup/init/services/param/watcher/agent", + ] + + deps = [ + "//base/startup/init/interfaces/innerkits:libbegetutil", + "//base/startup/init/interfaces/innerkits/:param_watcher_stub", + "//base/startup/init/services/log:agent_log", + ] + external_deps = [ + "bounds_checking_function:libsec_static", + "c_utils:utils", + "hilog:libhilog", + "ipc:ipc_single", + "safwk:system_ability_fwk", + "samgr:samgr_proxy", + ] + if (init_paramwatcher_hicollie_enable) { + external_deps += [ "hicollie:libhicollie" ] + } + + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + sources += [ "processwatchermessage_fuzzer/processwatchermessage_fuzzer.cpp" ] + defines = [ "STARTUP_INIT_TEST" ] + if (init_paramwatcher_hicollie_enable) { + defines += [ "HICOLLIE_ENABLE" ] + } +} + ohos_fuzztest("GetBuildVersionFuzzTest") { module_out_path = module_output_path fuzz_config_file = "//base/startup/init/test/fuzztest/getbuildversion_fuzzer" @@ -4177,6 +4227,7 @@ group("fuzztest") { ":ParseFstabPerLineFuzzTest", ":ParseUeventConfigFuzzTest", ":ParseUeventdConfigFileFuzzTest", + ":ProcessWatcherMessageFuzzTest", ":ReadFileInDirFuzzTest", ":ReadFileToBufFuzzTest", ":ReadFstabFromFileFuzzTest", diff --git a/test/fuzztest/addparamentry_fuzzer/addparamentry_fuzzer.cpp b/test/fuzztest/addparamentry_fuzzer/addparamentry_fuzzer.cpp index 700afbbb37e858f8c6c907029a582e37b34dc70a..9a9400ef5a251afe5f7e461f887a6eba5aae9055 100644 --- a/test/fuzztest/addparamentry_fuzzer/addparamentry_fuzzer.cpp +++ b/test/fuzztest/addparamentry_fuzzer/addparamentry_fuzzer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2025 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 diff --git a/test/fuzztest/addparamentry_fuzzer/addparamentry_fuzzer.h b/test/fuzztest/addparamentry_fuzzer/addparamentry_fuzzer.h index 72d69b470c74eac4ac96ff9f2ff4f56b4f700e8e..69b165b366611b151ff5e29075cf58c1e3e07c14 100644 --- a/test/fuzztest/addparamentry_fuzzer/addparamentry_fuzzer.h +++ b/test/fuzztest/addparamentry_fuzzer/addparamentry_fuzzer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2025 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 diff --git a/test/fuzztest/addparamentry_fuzzer/corpus/init b/test/fuzztest/addparamentry_fuzzer/corpus/init index 8eb5a7d6eb6b7d71f0c70c244e5768d62bee6ac5..7ade8a0faafeaedba7241e7d4a97b8e1f9691932 100644 --- a/test/fuzztest/addparamentry_fuzzer/corpus/init +++ b/test/fuzztest/addparamentry_fuzzer/corpus/init @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2025 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 diff --git a/test/fuzztest/addparamentry_fuzzer/project.xml b/test/fuzztest/addparamentry_fuzzer/project.xml index 949d03efd7477905377ac79f3b0bb374c8ac2e9a..b39473f2f6776874287a2de22477705b1b60385c 100644 --- a/test/fuzztest/addparamentry_fuzzer/project.xml +++ b/test/fuzztest/addparamentry_fuzzer/project.xml @@ -1,5 +1,5 @@ - + + + + 100 + + 30 + + 3072 + + \ No newline at end of file