diff --git a/test/fuzztest/BUILD.gn b/test/fuzztest/BUILD.gn index 453a71d3d2597359e843fad1940194a2495716ae..e79944a8662c632ec9e7ca31ae89d4bcc4da13c8 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 7493bf051b318f7293a68b5e92ed7308646eca59..0000000000000000000000000000000000000000 --- 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 482ec4a58bb63eb841b139730e08bee3cc7c57ec..0000000000000000000000000000000000000000 --- 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 ccfaaa3c3be322e68e4e7a1b4d170446409ab3c3..0000000000000000000000000000000000000000 --- 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 69c5791762c2df3d7e43cb066be9cd8b56f80621..0000000000000000000000000000000000000000 --- 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 a9516ff614a5d9ba23a56227fffc34fb85ac7abb..0000000000000000000000000000000000000000 --- 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 78298bdb45746c4bf4e87479558322749762ded7..0000000000000000000000000000000000000000 --- 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 a609200ac6ab562aab65487fb8f6739e75c33af2..0000000000000000000000000000000000000000 --- 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 7211812ec4ffb38363bf5c61f747eca737100a5f..0000000000000000000000000000000000000000 --- 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 69c5791762c2df3d7e43cb066be9cd8b56f80621..0000000000000000000000000000000000000000 --- 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 a9516ff614a5d9ba23a56227fffc34fb85ac7abb..0000000000000000000000000000000000000000 --- 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 223ba4d941ca51e87d0b90a7ca8db7a0a8b81741..0000000000000000000000000000000000000000 --- 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 a74ac3d20b7b5809ef6b079b963698826fb4091a..0000000000000000000000000000000000000000 --- 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 d217d0a36eb2ba56ca795425978a1eaefa273d89..0000000000000000000000000000000000000000 --- 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 69c5791762c2df3d7e43cb066be9cd8b56f80621..0000000000000000000000000000000000000000 --- 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 a9516ff614a5d9ba23a56227fffc34fb85ac7abb..0000000000000000000000000000000000000000 --- 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 2518953e90d078221a4bf3953aeb107803957ffe..0000000000000000000000000000000000000000 --- 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 88fcf22612f82003b07074e924e7bc504aa48269..0000000000000000000000000000000000000000 --- 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 b4b801fcabbae903d1170cddc5812b88d0ca2f37..0000000000000000000000000000000000000000 --- 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 69c5791762c2df3d7e43cb066be9cd8b56f80621..0000000000000000000000000000000000000000 --- 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 a9516ff614a5d9ba23a56227fffc34fb85ac7abb..0000000000000000000000000000000000000000 --- 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 a6e3c9ab35317dda9077f6ddf31ae8b98fdb8743..371f9075cc424463250e110cd52b9531b5cf006f 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 76d14e65cb3702d0acd207cc12dc14913d527e98..0000000000000000000000000000000000000000 --- 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 69c5791762c2df3d7e43cb066be9cd8b56f80621..0000000000000000000000000000000000000000 --- 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 a9516ff614a5d9ba23a56227fffc34fb85ac7abb..0000000000000000000000000000000000000000 --- 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 c7f58ca8a6a17a48a653904c459ddb6e4102fe06..0000000000000000000000000000000000000000 --- 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 88338e20660a4488623951c20d69ae0beae3105f..0000000000000000000000000000000000000000 --- 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 76e5936931e402d5eaf2c1e8a1fc7b6311959caa..0000000000000000000000000000000000000000 --- 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 69c5791762c2df3d7e43cb066be9cd8b56f80621..0000000000000000000000000000000000000000 --- 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 a9516ff614a5d9ba23a56227fffc34fb85ac7abb..0000000000000000000000000000000000000000 --- 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 f30aed4624ab6c570ea2193b38f24736bb1d508c..0000000000000000000000000000000000000000 --- 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 5ca1587a74f64f7db30955d5400b0554c26d0f8e..0000000000000000000000000000000000000000 --- 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