fix the Thread Network fuzz testing error

The current fuzz testing comunicates with the Thread radio chip
simulation program `ot-rcp`. The 'ot-rcp' is not installed by all
devices, which causes the fuzz testing program is unable to find
the program '/vendor/bin/ot-rcp'.

This commit enables the HAL to talk to the '/dev/null' to avoid
'/vendor/bin/ot-rcp' not being found.

Bug: 289627270
Test: Run the fuzz test on cuttlefish
(cherry picked from https://android-review.googlesource.com/q/commit:7f7e8647fa94b9d126cb88f366740f2b50b1f864)
Merged-In: If410d7d75abe05c7c2d2c82fa0450e925b9a48bb
Change-Id: If410d7d75abe05c7c2d2c82fa0450e925b9a48bb
This commit is contained in:
Zhanglong Xia
2023-07-06 13:37:56 +08:00
committed by Kangping Dong
parent 83c4ef44e5
commit 3bbcbcdc8a
2 changed files with 1 additions and 2 deletions

View File

@@ -79,7 +79,6 @@ cc_fuzz {
"fuzzer.cpp",
],
required: ["ot-rcp"],
fuzz_config: {
cc: [
"zhanglongxia@google.com",

View File

@@ -22,7 +22,7 @@ using aidl::android::hardware::threadnetwork::ThreadChip;
using android::fuzzService;
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
char url[] = "spinel+hdlc+forkpty:///vendor/bin/ot-rcp?forkpty-arg=2";
char url[] = "spinel+hdlc+null:///dev/null";
auto service = ndk::SharedRefBase::make<ThreadChip>(url);
fuzzService(service->asBinder().get(), FuzzedDataProvider(data, size));