From 19e7b542be1a567f7e7bdd66aacab6328d57626a Mon Sep 17 00:00:00 2001 From: chenhantao Date: Thu, 14 Nov 2024 09:40:05 +0800 Subject: [PATCH] Remove Fuzz Issue:https://gitee.com/openharmony/arkcompiler_toolchain/issues/IB47K5 Signed-off-by: chenhantao Change-Id: I83e4241e8e58edc3765476d682868a0622e86cae --- test/fuzztest/BUILD.gn | 5 -- test/fuzztest/connectserver_fuzzer/BUILD.gn | 51 ------------------ .../connectserver_fuzzer.cpp | 47 ----------------- .../connectserver_fuzzer.h | 21 -------- .../fuzztest/connectserver_fuzzer/corpus/init | 14 ----- .../fuzztest/connectserver_fuzzer/project.xml | 25 --------- .../connectserverrunserver_fuzzer/BUILD.gn | 52 ------------------- .../connectserverrunserver_fuzzer.cpp | 48 ----------------- .../connectserverrunserver_fuzzer.h | 21 -------- .../connectserverrunserver_fuzzer/corpus/init | 14 ----- .../connectserverrunserver_fuzzer/project.xml | 25 --------- .../BUILD.gn | 52 ------------------- ...connectserverrunserversocketfd1_fuzzer.cpp | 49 ----------------- .../connectserverrunserversocketfd1_fuzzer.h | 21 -------- .../corpus/init | 14 ----- .../project.xml | 25 --------- .../connectserverstopserver_fuzzer/BUILD.gn | 52 ------------------- .../connectserverstopserver_fuzzer.cpp | 48 ----------------- .../connectserverstopserver_fuzzer.h | 21 -------- .../corpus/init | 14 ----- .../project.xml | 25 --------- test/fuzztest/wsserver/BUILD.gn | 6 +-- .../wsserver/wsserver_fuzzer/BUILD.gn | 52 ------------------- .../wsserver/wsserver_fuzzer/corpus/init | 14 ----- .../wsserver/wsserver_fuzzer/project.xml | 25 --------- .../wsserver_fuzzer/wsserver_fuzzer.cpp | 51 ------------------ .../wsserver_fuzzer/wsserver_fuzzer.h | 21 -------- .../BUILD.gn | 52 ------------------- .../corpus/init | 14 ----- .../project.xml | 25 --------- .../wsservernotifydisconnectevent_fuzzer.cpp | 52 ------------------- .../wsservernotifydisconnectevent_fuzzer.h | 21 -------- 32 files changed, 1 insertion(+), 976 deletions(-) delete mode 100644 test/fuzztest/connectserver_fuzzer/BUILD.gn delete mode 100644 test/fuzztest/connectserver_fuzzer/connectserver_fuzzer.cpp delete mode 100644 test/fuzztest/connectserver_fuzzer/connectserver_fuzzer.h delete mode 100644 test/fuzztest/connectserver_fuzzer/corpus/init delete mode 100644 test/fuzztest/connectserver_fuzzer/project.xml delete mode 100644 test/fuzztest/connectserverrunserver_fuzzer/BUILD.gn delete mode 100644 test/fuzztest/connectserverrunserver_fuzzer/connectserverrunserver_fuzzer.cpp delete mode 100644 test/fuzztest/connectserverrunserver_fuzzer/connectserverrunserver_fuzzer.h delete mode 100644 test/fuzztest/connectserverrunserver_fuzzer/corpus/init delete mode 100644 test/fuzztest/connectserverrunserver_fuzzer/project.xml delete mode 100644 test/fuzztest/connectserverrunserversocketfd1_fuzzer/BUILD.gn delete mode 100644 test/fuzztest/connectserverrunserversocketfd1_fuzzer/connectserverrunserversocketfd1_fuzzer.cpp delete mode 100644 test/fuzztest/connectserverrunserversocketfd1_fuzzer/connectserverrunserversocketfd1_fuzzer.h delete mode 100644 test/fuzztest/connectserverrunserversocketfd1_fuzzer/corpus/init delete mode 100644 test/fuzztest/connectserverrunserversocketfd1_fuzzer/project.xml delete mode 100644 test/fuzztest/connectserverstopserver_fuzzer/BUILD.gn delete mode 100644 test/fuzztest/connectserverstopserver_fuzzer/connectserverstopserver_fuzzer.cpp delete mode 100644 test/fuzztest/connectserverstopserver_fuzzer/connectserverstopserver_fuzzer.h delete mode 100644 test/fuzztest/connectserverstopserver_fuzzer/corpus/init delete mode 100644 test/fuzztest/connectserverstopserver_fuzzer/project.xml delete mode 100644 test/fuzztest/wsserver/wsserver_fuzzer/BUILD.gn delete mode 100644 test/fuzztest/wsserver/wsserver_fuzzer/corpus/init delete mode 100644 test/fuzztest/wsserver/wsserver_fuzzer/project.xml delete mode 100644 test/fuzztest/wsserver/wsserver_fuzzer/wsserver_fuzzer.cpp delete mode 100644 test/fuzztest/wsserver/wsserver_fuzzer/wsserver_fuzzer.h delete mode 100644 test/fuzztest/wsserver/wsservernotifydisconnectevent_fuzzer/BUILD.gn delete mode 100644 test/fuzztest/wsserver/wsservernotifydisconnectevent_fuzzer/corpus/init delete mode 100644 test/fuzztest/wsserver/wsservernotifydisconnectevent_fuzzer/project.xml delete mode 100644 test/fuzztest/wsserver/wsservernotifydisconnectevent_fuzzer/wsservernotifydisconnectevent_fuzzer.cpp delete mode 100644 test/fuzztest/wsserver/wsservernotifydisconnectevent_fuzzer/wsservernotifydisconnectevent_fuzzer.h diff --git a/test/fuzztest/BUILD.gn b/test/fuzztest/BUILD.gn index 453a71d3..e79944a8 100644 --- a/test/fuzztest/BUILD.gn +++ b/test/fuzztest/BUILD.gn @@ -19,11 +19,7 @@ group("fuzztest") { "agent:fuzztest", "backend:fuzztest", "base:fuzztest", - "connectserver_fuzzer:fuzztest", - "connectserverrunserver_fuzzer:fuzztest", - "connectserverrunserversocketfd1_fuzzer:fuzztest", "connectserversendmessage_fuzzer:fuzztest", - "connectserverstopserver_fuzzer:fuzztest", "dispatcher:fuzztest", "dispatchprotocolmessage_fuzzer:fuzztest", "initializedebugger_fuzzer:fuzztest", @@ -79,6 +75,5 @@ group("fuzztest") { "pttypesremoteobjectunserializablevalue_fuzzer:fuzztest", "pttypesstringremoteobject_fuzzer:fuzztest", "pttypessymbolremoteobject_fuzzer:fuzztest", - "wsserver:fuzztest", ] } diff --git a/test/fuzztest/connectserver_fuzzer/BUILD.gn b/test/fuzztest/connectserver_fuzzer/BUILD.gn deleted file mode 100644 index 7493bf05..00000000 --- a/test/fuzztest/connectserver_fuzzer/BUILD.gn +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (c) 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("//arkcompiler/toolchain/test/test_helper.gni") -import("//build/config/features.gni") -import("//build/ohos.gni") -import("//build/test.gni") - -####################################fuzztest################################## -ohos_fuzztest("ConnectServerFuzzTest") { - module_out_path = toolchain_output_path - - fuzz_config_file = "$toolchain_root/test/fuzztest/connectserver_fuzzer" - - resource_config_file = "$toolchain_root/test/resource/tooling/ohos_test.xml" - - sources = [ "connectserver_fuzzer.cpp" ] - - configs = [ "$toolchain_root:toolchain_test_config" ] - - deps = [ - "../../../inspector:connectserver_debugger", - "../../../tooling:libark_ecma_debugger_set", - ] - - # hiviewdfx libraries - external_deps = hiviewdfx_ext_deps - external_deps += [ - "cJSON:cjson", - "ets_runtime:libark_jsruntime", - "libuv:uv", - sdk_libc_secshared_dep, - ] - deps += hiviewdfx_deps -} - -group("fuzztest") { - testonly = true - deps = [] - deps += [ ":ConnectServerFuzzTest" ] -} diff --git a/test/fuzztest/connectserver_fuzzer/connectserver_fuzzer.cpp b/test/fuzztest/connectserver_fuzzer/connectserver_fuzzer.cpp deleted file mode 100644 index 482ec4a5..00000000 --- a/test/fuzztest/connectserver_fuzzer/connectserver_fuzzer.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2023 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. - */ - -#include "connectserver_fuzzer.h" -#include "ecmascript/napi/include/jsnapi.h" -#include "inspector/connect_server.h" - -using namespace panda; -using namespace panda::ecmascript; -using namespace OHOS::ArkCompiler::Toolchain; - -namespace OHOS { - void TestFun([[maybe_unused]]std::string &&message) - { - return; - } - void ConnectServerFuzzTest([[maybe_unused]]const uint8_t* data, size_t size) - { - if (size <= 0) { - return; - } - RuntimeOption option; - option.SetLogLevel(RuntimeOption::LOG_LEVEL::ERROR); - std::function fun = TestFun; - ConnectServer connectServer("com.example.myapplication", fun); - } -} - -// Fuzzer entry point. -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) -{ - // Run your code on data. - OHOS::ConnectServerFuzzTest(data, size); - return 0; -} \ No newline at end of file diff --git a/test/fuzztest/connectserver_fuzzer/connectserver_fuzzer.h b/test/fuzztest/connectserver_fuzzer/connectserver_fuzzer.h deleted file mode 100644 index ccfaaa3c..00000000 --- a/test/fuzztest/connectserver_fuzzer/connectserver_fuzzer.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2023 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. - */ - -#ifndef CONNECTSERVER_FUZZER_H -#define CONNECTSERVER_FUZZER_H - -#define FUZZ_PROJECT_NAME "connectserver_fuzzer" - -#endif \ No newline at end of file diff --git a/test/fuzztest/connectserver_fuzzer/corpus/init b/test/fuzztest/connectserver_fuzzer/corpus/init deleted file mode 100644 index 69c57917..00000000 --- a/test/fuzztest/connectserver_fuzzer/corpus/init +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2023 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. - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/connectserver_fuzzer/project.xml b/test/fuzztest/connectserver_fuzzer/project.xml deleted file mode 100644 index a9516ff6..00000000 --- a/test/fuzztest/connectserver_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 1000 - - 300 - - 4096 - - \ No newline at end of file diff --git a/test/fuzztest/connectserverrunserver_fuzzer/BUILD.gn b/test/fuzztest/connectserverrunserver_fuzzer/BUILD.gn deleted file mode 100644 index 78298bdb..00000000 --- a/test/fuzztest/connectserverrunserver_fuzzer/BUILD.gn +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (c) 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("//arkcompiler/toolchain/test/test_helper.gni") -import("//build/config/features.gni") -import("//build/ohos.gni") -import("//build/test.gni") - -####################################fuzztest################################## -ohos_fuzztest("ConnectServerRunServerFuzzTest") { - module_out_path = toolchain_output_path - - fuzz_config_file = - "$toolchain_root/test/fuzztest/connectserverrunserver_fuzzer" - - resource_config_file = "$toolchain_root/test/resource/tooling/ohos_test.xml" - - sources = [ "connectserverrunserver_fuzzer.cpp" ] - - configs = [ "../../../:toolchain_test_config" ] - - deps = [ - "../../../inspector:connectserver_debugger", - "../../../tooling:libark_ecma_debugger_set", - ] - - # hiviewdfx libraries - external_deps = hiviewdfx_ext_deps - external_deps += [ - "cJSON:cjson", - "ets_runtime:libark_jsruntime", - "libuv:uv", - sdk_libc_secshared_dep, - ] - deps += hiviewdfx_deps -} - -group("fuzztest") { - testonly = true - deps = [] - deps += [ ":ConnectServerRunServerFuzzTest" ] -} diff --git a/test/fuzztest/connectserverrunserver_fuzzer/connectserverrunserver_fuzzer.cpp b/test/fuzztest/connectserverrunserver_fuzzer/connectserverrunserver_fuzzer.cpp deleted file mode 100644 index a609200a..00000000 --- a/test/fuzztest/connectserverrunserver_fuzzer/connectserverrunserver_fuzzer.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2023 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. - */ - -#include "connectserverrunserver_fuzzer.h" -#include "ecmascript/napi/include/jsnapi.h" -#include "inspector/connect_server.h" - -using namespace panda; -using namespace panda::ecmascript; -using namespace OHOS::ArkCompiler::Toolchain; - -namespace OHOS { - void TestFunction([[maybe_unused]]std::string &&message) - { - return; - } - void ConnectServerRunServerFuzzTest([[maybe_unused]]const uint8_t* data, size_t size) - { - RuntimeOption option; - option.SetLogLevel(RuntimeOption::LOG_LEVEL::ERROR); - if (size <= 0) { - return; - } - std::function testFunction = TestFunction; - ConnectServer connectServer("com.example.myapplication", testFunction); - connectServer.RunServer(); - } -} - -// Fuzzer entry point. -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) -{ - // Run your code on data. - OHOS::ConnectServerRunServerFuzzTest(data, size); - return 0; -} \ No newline at end of file diff --git a/test/fuzztest/connectserverrunserver_fuzzer/connectserverrunserver_fuzzer.h b/test/fuzztest/connectserverrunserver_fuzzer/connectserverrunserver_fuzzer.h deleted file mode 100644 index 7211812e..00000000 --- a/test/fuzztest/connectserverrunserver_fuzzer/connectserverrunserver_fuzzer.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2023 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. - */ - -#ifndef CONNECTSERVER_FUZZER_H -#define CONNECTSERVER_FUZZER_H - -#define FUZZ_PROJECT_NAME "connectserverrunserver_fuzzer" - -#endif \ No newline at end of file diff --git a/test/fuzztest/connectserverrunserver_fuzzer/corpus/init b/test/fuzztest/connectserverrunserver_fuzzer/corpus/init deleted file mode 100644 index 69c57917..00000000 --- a/test/fuzztest/connectserverrunserver_fuzzer/corpus/init +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2023 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. - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/connectserverrunserver_fuzzer/project.xml b/test/fuzztest/connectserverrunserver_fuzzer/project.xml deleted file mode 100644 index a9516ff6..00000000 --- a/test/fuzztest/connectserverrunserver_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 1000 - - 300 - - 4096 - - \ No newline at end of file diff --git a/test/fuzztest/connectserverrunserversocketfd1_fuzzer/BUILD.gn b/test/fuzztest/connectserverrunserversocketfd1_fuzzer/BUILD.gn deleted file mode 100644 index 223ba4d9..00000000 --- a/test/fuzztest/connectserverrunserversocketfd1_fuzzer/BUILD.gn +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (c) 2023 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("//arkcompiler/toolchain/test/test_helper.gni") -import("//build/config/features.gni") -import("//build/ohos.gni") -import("//build/test.gni") - -####################################fuzztest################################## -ohos_fuzztest("ConnectServerRunServerSocketfd1FuzzTest") { - module_out_path = toolchain_output_path - - fuzz_config_file = - "$toolchain_root/test/fuzztest/connectserverrunserversocketfd1_fuzzer" - - resource_config_file = "$toolchain_root/test/resource/tooling/ohos_test.xml" - - sources = [ "connectserverrunserversocketfd1_fuzzer.cpp" ] - - configs = [ "../../../:toolchain_test_config" ] - - deps = [ - "../../../inspector:connectserver_debugger", - "../../../tooling:libark_ecma_debugger_set", - ] - - # hiviewdfx libraries - external_deps = hiviewdfx_ext_deps - external_deps += [ - "cJSON:cjson", - "ets_runtime:libark_jsruntime", - "libuv:uv", - sdk_libc_secshared_dep, - ] - deps += hiviewdfx_deps -} - -group("fuzztest") { - testonly = true - deps = [] - deps += [ ":ConnectServerRunServerSocketfd1FuzzTest" ] -} diff --git a/test/fuzztest/connectserverrunserversocketfd1_fuzzer/connectserverrunserversocketfd1_fuzzer.cpp b/test/fuzztest/connectserverrunserversocketfd1_fuzzer/connectserverrunserversocketfd1_fuzzer.cpp deleted file mode 100644 index a74ac3d2..00000000 --- a/test/fuzztest/connectserverrunserversocketfd1_fuzzer/connectserverrunserversocketfd1_fuzzer.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2023 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. - */ - -#include "connectserverrunserversocketfd1_fuzzer.h" -#include "ecmascript/napi/include/jsnapi.h" -#include "inspector/connect_server.h" - -using namespace panda; -using namespace panda::ecmascript; -using namespace OHOS::ArkCompiler::Toolchain; - -namespace OHOS { - void TestFunction([[maybe_unused]]std::string &&message) - { - return; - } - void ConnectServerRunServerSocketfd1FuzzTest([[maybe_unused]]const uint8_t* data, size_t size) - { - RuntimeOption option; - option.SetLogLevel(RuntimeOption::LOG_LEVEL::ERROR); - if (size <= 0) { - return; - } - std::function testFunction = TestFunction; - int socketfd = 1; // 1 : set socketfd_ - ConnectServer connectServer(socketfd, testFunction); - connectServer.RunServer(); - } -} - -// Fuzzer entry point. -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) -{ - // Run your code on data. - OHOS::ConnectServerRunServerSocketfd1FuzzTest(data, size); - return 0; -} \ No newline at end of file diff --git a/test/fuzztest/connectserverrunserversocketfd1_fuzzer/connectserverrunserversocketfd1_fuzzer.h b/test/fuzztest/connectserverrunserversocketfd1_fuzzer/connectserverrunserversocketfd1_fuzzer.h deleted file mode 100644 index d217d0a3..00000000 --- a/test/fuzztest/connectserverrunserversocketfd1_fuzzer/connectserverrunserversocketfd1_fuzzer.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2023 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. - */ - -#ifndef CONNECTSERVER_FUZZER_H -#define CONNECTSERVER_FUZZER_H - -#define FUZZ_PROJECT_NAME "connectserverrunserversocketfd1_fuzzer" - -#endif \ No newline at end of file diff --git a/test/fuzztest/connectserverrunserversocketfd1_fuzzer/corpus/init b/test/fuzztest/connectserverrunserversocketfd1_fuzzer/corpus/init deleted file mode 100644 index 69c57917..00000000 --- a/test/fuzztest/connectserverrunserversocketfd1_fuzzer/corpus/init +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2023 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. - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/connectserverrunserversocketfd1_fuzzer/project.xml b/test/fuzztest/connectserverrunserversocketfd1_fuzzer/project.xml deleted file mode 100644 index a9516ff6..00000000 --- a/test/fuzztest/connectserverrunserversocketfd1_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 1000 - - 300 - - 4096 - - \ No newline at end of file diff --git a/test/fuzztest/connectserverstopserver_fuzzer/BUILD.gn b/test/fuzztest/connectserverstopserver_fuzzer/BUILD.gn deleted file mode 100644 index 2518953e..00000000 --- a/test/fuzztest/connectserverstopserver_fuzzer/BUILD.gn +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (c) 2023 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("//arkcompiler/toolchain/test/test_helper.gni") -import("//build/config/features.gni") -import("//build/ohos.gni") -import("//build/test.gni") - -####################################fuzztest################################## -ohos_fuzztest("ConnectServerStopServerFuzzTest") { - module_out_path = toolchain_output_path - - fuzz_config_file = - "$toolchain_root/test/fuzztest/connectserverstopserver_fuzzer" - - resource_config_file = "$toolchain_root/test/resource/tooling/ohos_test.xml" - - sources = [ "connectserverstopserver_fuzzer.cpp" ] - - configs = [ "../../../:toolchain_test_config" ] - - deps = [ - "../../../inspector:connectserver_debugger", - "../../../tooling:libark_ecma_debugger_set", - ] - - # hiviewdfx libraries - external_deps = hiviewdfx_ext_deps - external_deps += [ - "cJSON:cjson", - "ets_runtime:libark_jsruntime", - "libuv:uv", - sdk_libc_secshared_dep, - ] - deps += hiviewdfx_deps -} - -group("fuzztest") { - testonly = true - deps = [] - deps += [ ":ConnectServerStopServerFuzzTest" ] -} diff --git a/test/fuzztest/connectserverstopserver_fuzzer/connectserverstopserver_fuzzer.cpp b/test/fuzztest/connectserverstopserver_fuzzer/connectserverstopserver_fuzzer.cpp deleted file mode 100644 index 88fcf226..00000000 --- a/test/fuzztest/connectserverstopserver_fuzzer/connectserverstopserver_fuzzer.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2023 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. - */ - -#include "connectserverstopserver_fuzzer.h" -#include "ecmascript/napi/include/jsnapi.h" -#include "inspector/connect_server.h" - -using namespace panda; -using namespace panda::ecmascript; -using namespace OHOS::ArkCompiler::Toolchain; - -namespace OHOS { - void TestFunction([[maybe_unused]]std::string &&message) - { - return; - } - void ConnectServerStopServerFuzzTest([[maybe_unused]]const uint8_t* data, size_t size) - { - RuntimeOption option; - option.SetLogLevel(RuntimeOption::LOG_LEVEL::ERROR); - if (size <= 0) { - return; - } - std::function testFunction = TestFunction; - ConnectServer connectServer("com.example.myapplication", testFunction); - connectServer.StopServer(); - } -} - -// Fuzzer entry point. -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) -{ - // Run your code on data. - OHOS::ConnectServerStopServerFuzzTest(data, size); - return 0; -} \ No newline at end of file diff --git a/test/fuzztest/connectserverstopserver_fuzzer/connectserverstopserver_fuzzer.h b/test/fuzztest/connectserverstopserver_fuzzer/connectserverstopserver_fuzzer.h deleted file mode 100644 index b4b801fc..00000000 --- a/test/fuzztest/connectserverstopserver_fuzzer/connectserverstopserver_fuzzer.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2023 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. - */ - -#ifndef CONNECTSERVER_FUZZER_H -#define CONNECTSERVER_FUZZER_H - -#define FUZZ_PROJECT_NAME "connectserverstopserver_fuzzer" - -#endif \ No newline at end of file diff --git a/test/fuzztest/connectserverstopserver_fuzzer/corpus/init b/test/fuzztest/connectserverstopserver_fuzzer/corpus/init deleted file mode 100644 index 69c57917..00000000 --- a/test/fuzztest/connectserverstopserver_fuzzer/corpus/init +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2023 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. - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/connectserverstopserver_fuzzer/project.xml b/test/fuzztest/connectserverstopserver_fuzzer/project.xml deleted file mode 100644 index a9516ff6..00000000 --- a/test/fuzztest/connectserverstopserver_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 1000 - - 300 - - 4096 - - \ No newline at end of file diff --git a/test/fuzztest/wsserver/BUILD.gn b/test/fuzztest/wsserver/BUILD.gn index a6e3c9ab..371f9075 100644 --- a/test/fuzztest/wsserver/BUILD.gn +++ b/test/fuzztest/wsserver/BUILD.gn @@ -15,9 +15,5 @@ group("fuzztest") { testonly = true deps = [] - deps += [ - "wsserver_fuzzer:fuzztest", - "wsservernotifydisconnectevent_fuzzer:fuzztest", - "wsserversendreply_fuzzer:fuzztest", - ] + deps += [ "wsserversendreply_fuzzer:fuzztest" ] } diff --git a/test/fuzztest/wsserver/wsserver_fuzzer/BUILD.gn b/test/fuzztest/wsserver/wsserver_fuzzer/BUILD.gn deleted file mode 100644 index 76d14e65..00000000 --- a/test/fuzztest/wsserver/wsserver_fuzzer/BUILD.gn +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (c) 2023 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("//arkcompiler/toolchain/test/test_helper.gni") -import("//build/config/features.gni") -import("//build/ohos.gni") -import("//build/test.gni") - -####################################fuzztest################################## -ohos_fuzztest("WsServerFuzzTest") { - module_out_path = toolchain_output_path - - fuzz_config_file = "$toolchain_root/test/fuzztest/wsserver/wsserver_fuzzer" - - resource_config_file = "$toolchain_root/test/resource/tooling/ohos_test.xml" - - sources = [ "wsserver_fuzzer.cpp" ] - - configs = [ "../../../../:toolchain_test_config" ] - - deps = [ - "$toolchain_root/inspector:ark_debugger", - "$toolchain_root/inspector:connectserver_debugger", - "$toolchain_root/tooling:libark_ecma_debugger_set", - ] - - # hiviewdfx libraries - external_deps = hiviewdfx_ext_deps - external_deps += [ - "cJSON:cjson", - "ets_runtime:libark_jsruntime", - "libuv:uv", - sdk_libc_secshared_dep, - ] - deps += hiviewdfx_deps -} - -group("fuzztest") { - testonly = true - deps = [] - deps += [ ":WsServerFuzzTest" ] -} diff --git a/test/fuzztest/wsserver/wsserver_fuzzer/corpus/init b/test/fuzztest/wsserver/wsserver_fuzzer/corpus/init deleted file mode 100644 index 69c57917..00000000 --- a/test/fuzztest/wsserver/wsserver_fuzzer/corpus/init +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2023 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. - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/wsserver/wsserver_fuzzer/project.xml b/test/fuzztest/wsserver/wsserver_fuzzer/project.xml deleted file mode 100644 index a9516ff6..00000000 --- a/test/fuzztest/wsserver/wsserver_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 1000 - - 300 - - 4096 - - \ No newline at end of file diff --git a/test/fuzztest/wsserver/wsserver_fuzzer/wsserver_fuzzer.cpp b/test/fuzztest/wsserver/wsserver_fuzzer/wsserver_fuzzer.cpp deleted file mode 100644 index c7f58ca8..00000000 --- a/test/fuzztest/wsserver/wsserver_fuzzer/wsserver_fuzzer.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2023 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. - */ - -#include "wsserver_fuzzer.h" -#include "ecmascript/napi/include/jsnapi.h" -#include "inspector/ws_server.h" - -using namespace panda; -using namespace panda::ecmascript; -using namespace OHOS::ArkCompiler::Toolchain; - -namespace OHOS { - void TestFun([[maybe_unused]]std::string &&message) - { - return; - } - void WsServerFuzzTest([[maybe_unused]]const uint8_t* data, size_t size) - { - if (size <= 0) { - return; - } - RuntimeOption option; - option.SetLogLevel(RuntimeOption::LOG_LEVEL::ERROR); - std::function fun = TestFun; - int32_t instanceId = 10001; // 10001:test instanceId - int port = 9230; // 9230:connection port for test - int fd = -2; // -2 : old debug process - DebugInfo debugInfo = {fd, "toolchain", instanceId, port}; - WsServer wsServer(debugInfo, fun); - } -} - -// Fuzzer entry point. -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) -{ - // Run your code on data. - OHOS::WsServerFuzzTest(data, size); - return 0; -} \ No newline at end of file diff --git a/test/fuzztest/wsserver/wsserver_fuzzer/wsserver_fuzzer.h b/test/fuzztest/wsserver/wsserver_fuzzer/wsserver_fuzzer.h deleted file mode 100644 index 88338e20..00000000 --- a/test/fuzztest/wsserver/wsserver_fuzzer/wsserver_fuzzer.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2023 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. - */ - -#ifndef WSSERVER_FUZZER_H -#define WSSERVER_FUZZER_H - -#define FUZZ_PROJECT_NAME "wsserver_fuzzer" - -#endif \ No newline at end of file diff --git a/test/fuzztest/wsserver/wsservernotifydisconnectevent_fuzzer/BUILD.gn b/test/fuzztest/wsserver/wsservernotifydisconnectevent_fuzzer/BUILD.gn deleted file mode 100644 index 76e59369..00000000 --- a/test/fuzztest/wsserver/wsservernotifydisconnectevent_fuzzer/BUILD.gn +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (c) 2023 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("//arkcompiler/toolchain/test/test_helper.gni") -import("//build/config/features.gni") -import("//build/ohos.gni") -import("//build/test.gni") - -####################################fuzztest################################## -ohos_fuzztest("WsServerNotifyDisconnectEventFuzzTest") { - module_out_path = toolchain_output_path - - fuzz_config_file = "$toolchain_root/test/fuzztest/wsserver/wsservernotifydisconnectevent_fuzzer" - - resource_config_file = "$toolchain_root/test/resource/tooling/ohos_test.xml" - - sources = [ "wsservernotifydisconnectevent_fuzzer.cpp" ] - - configs = [ "../../../../:toolchain_test_config" ] - - deps = [ - "$toolchain_root/inspector:ark_debugger", - "$toolchain_root/inspector:connectserver_debugger", - "$toolchain_root/tooling:libark_ecma_debugger_set", - ] - - # hiviewdfx libraries - external_deps = hiviewdfx_ext_deps - external_deps += [ - "cJSON:cjson", - "ets_runtime:libark_jsruntime", - "libuv:uv", - sdk_libc_secshared_dep, - ] - deps += hiviewdfx_deps -} - -group("fuzztest") { - testonly = true - deps = [] - deps += [ ":WsServerNotifyDisconnectEventFuzzTest" ] -} diff --git a/test/fuzztest/wsserver/wsservernotifydisconnectevent_fuzzer/corpus/init b/test/fuzztest/wsserver/wsservernotifydisconnectevent_fuzzer/corpus/init deleted file mode 100644 index 69c57917..00000000 --- a/test/fuzztest/wsserver/wsservernotifydisconnectevent_fuzzer/corpus/init +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2023 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. - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/wsserver/wsservernotifydisconnectevent_fuzzer/project.xml b/test/fuzztest/wsserver/wsservernotifydisconnectevent_fuzzer/project.xml deleted file mode 100644 index a9516ff6..00000000 --- a/test/fuzztest/wsserver/wsservernotifydisconnectevent_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 1000 - - 300 - - 4096 - - \ No newline at end of file diff --git a/test/fuzztest/wsserver/wsservernotifydisconnectevent_fuzzer/wsservernotifydisconnectevent_fuzzer.cpp b/test/fuzztest/wsserver/wsservernotifydisconnectevent_fuzzer/wsservernotifydisconnectevent_fuzzer.cpp deleted file mode 100644 index f30aed46..00000000 --- a/test/fuzztest/wsserver/wsservernotifydisconnectevent_fuzzer/wsservernotifydisconnectevent_fuzzer.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2023 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. - */ - -#include "wsservernotifydisconnectevent_fuzzer.h" -#include "ecmascript/napi/include/jsnapi.h" -#include "inspector/ws_server.h" - -using namespace panda; -using namespace panda::ecmascript; -using namespace OHOS::ArkCompiler::Toolchain; - -namespace OHOS { - void TestFun([[maybe_unused]]std::string &&message) - { - return; - } - void WsServerNotifyDisconnectEventFuzzTest([[maybe_unused]]const uint8_t* data, size_t size) - { - if (size <= 0) { - return; - } - RuntimeOption option; - option.SetLogLevel(RuntimeOption::LOG_LEVEL::ERROR); - std::function fun = TestFun; - int32_t instanceId = 10001; // 10001:test instanceId - int port = 9230; // 9230:connection port for test - int fd = -2; // -2 : old debug process - DebugInfo debugInfo = {fd, "toolchain", instanceId, port}; - WsServer wsServer(debugInfo, fun); - wsServer.NotifyDisconnectEvent(); - } -} - -// Fuzzer entry point. -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) -{ - // Run your code on data. - OHOS::WsServerNotifyDisconnectEventFuzzTest(data, size); - return 0; -} \ No newline at end of file diff --git a/test/fuzztest/wsserver/wsservernotifydisconnectevent_fuzzer/wsservernotifydisconnectevent_fuzzer.h b/test/fuzztest/wsserver/wsservernotifydisconnectevent_fuzzer/wsservernotifydisconnectevent_fuzzer.h deleted file mode 100644 index 5ca1587a..00000000 --- a/test/fuzztest/wsserver/wsservernotifydisconnectevent_fuzzer/wsservernotifydisconnectevent_fuzzer.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2023 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. - */ - -#ifndef WSSERVER_FUZZER_H -#define WSSERVER_FUZZER_H - -#define FUZZ_PROJECT_NAME "wsservernotifydisconnectevent_fuzzer" - -#endif \ No newline at end of file -- Gitee