mirror of
https://gitee.com/openharmony/arkcompiler_toolchain
synced 2024-11-23 07:30:33 +00:00
Remove unnecessary fuzz
Issue: #IB4CVI Signed-off-by: yanzhiqi1 <yanzhiqi1@huawei.com>
This commit is contained in:
parent
f45feba189
commit
dd55bebe1e
@ -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",
|
||||
]
|
||||
}
|
||||
|
@ -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" ]
|
||||
}
|
@ -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<void(std::string&&)> 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;
|
||||
}
|
@ -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
|
@ -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
|
@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 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_config>
|
||||
<fuzztest>
|
||||
<!-- maximum length of a test input -->
|
||||
<max_len>1000</max_len>
|
||||
<!-- maximum total time in seconds to run the DTFuzz -->
|
||||
<max_total_time>300</max_total_time>
|
||||
<!-- memory usage limit in Mb -->
|
||||
<rss_limit_mb>4096</rss_limit_mb>
|
||||
</fuzztest>
|
||||
</fuzz_config>
|
@ -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" ]
|
||||
}
|
@ -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<void(std::string&&)> 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;
|
||||
}
|
@ -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
|
@ -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
|
@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 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_config>
|
||||
<fuzztest>
|
||||
<!-- maximum length of a test input -->
|
||||
<max_len>1000</max_len>
|
||||
<!-- maximum total time in seconds to run the DTFuzz -->
|
||||
<max_total_time>300</max_total_time>
|
||||
<!-- memory usage limit in Mb -->
|
||||
<rss_limit_mb>4096</rss_limit_mb>
|
||||
</fuzztest>
|
||||
</fuzz_config>
|
@ -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" ]
|
||||
}
|
@ -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<void(std::string&&)> 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;
|
||||
}
|
@ -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
|
@ -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
|
@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 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_config>
|
||||
<fuzztest>
|
||||
<!-- maximum length of a test input -->
|
||||
<max_len>1000</max_len>
|
||||
<!-- maximum total time in seconds to run the DTFuzz -->
|
||||
<max_total_time>300</max_total_time>
|
||||
<!-- memory usage limit in Mb -->
|
||||
<rss_limit_mb>4096</rss_limit_mb>
|
||||
</fuzztest>
|
||||
</fuzz_config>
|
@ -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" ]
|
||||
}
|
@ -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<void(std::string&&)> 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;
|
||||
}
|
@ -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
|
@ -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
|
@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 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_config>
|
||||
<fuzztest>
|
||||
<!-- maximum length of a test input -->
|
||||
<max_len>1000</max_len>
|
||||
<!-- maximum total time in seconds to run the DTFuzz -->
|
||||
<max_total_time>300</max_total_time>
|
||||
<!-- memory usage limit in Mb -->
|
||||
<rss_limit_mb>4096</rss_limit_mb>
|
||||
</fuzztest>
|
||||
</fuzz_config>
|
@ -15,9 +15,5 @@ group("fuzztest") {
|
||||
testonly = true
|
||||
deps = []
|
||||
|
||||
deps += [
|
||||
"wsserver_fuzzer:fuzztest",
|
||||
"wsservernotifydisconnectevent_fuzzer:fuzztest",
|
||||
"wsserversendreply_fuzzer:fuzztest",
|
||||
]
|
||||
deps += [ "wsserversendreply_fuzzer:fuzztest" ]
|
||||
}
|
||||
|
@ -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" ]
|
||||
}
|
@ -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
|
@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 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_config>
|
||||
<fuzztest>
|
||||
<!-- maximum length of a test input -->
|
||||
<max_len>1000</max_len>
|
||||
<!-- maximum total time in seconds to run the DTFuzz -->
|
||||
<max_total_time>300</max_total_time>
|
||||
<!-- memory usage limit in Mb -->
|
||||
<rss_limit_mb>4096</rss_limit_mb>
|
||||
</fuzztest>
|
||||
</fuzz_config>
|
@ -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<void(std::string&&)> 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;
|
||||
}
|
@ -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
|
@ -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" ]
|
||||
}
|
@ -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
|
@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 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_config>
|
||||
<fuzztest>
|
||||
<!-- maximum length of a test input -->
|
||||
<max_len>1000</max_len>
|
||||
<!-- maximum total time in seconds to run the DTFuzz -->
|
||||
<max_total_time>300</max_total_time>
|
||||
<!-- memory usage limit in Mb -->
|
||||
<rss_limit_mb>4096</rss_limit_mb>
|
||||
</fuzztest>
|
||||
</fuzz_config>
|
@ -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<void(std::string&&)> 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;
|
||||
}
|
@ -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
|
Loading…
Reference in New Issue
Block a user