From 7f7e8647fa94b9d126cb88f366740f2b50b1f864 Mon Sep 17 00:00:00 2001 From: Zhanglong Xia Date: Thu, 6 Jul 2023 13:37:56 +0800 Subject: [PATCH] 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 Change-Id: If410d7d75abe05c7c2d2c82fa0450e925b9a48bb --- threadnetwork/aidl/default/Android.bp | 1 - threadnetwork/aidl/default/fuzzer.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/threadnetwork/aidl/default/Android.bp b/threadnetwork/aidl/default/Android.bp index 736e808b49..49982f30ea 100644 --- a/threadnetwork/aidl/default/Android.bp +++ b/threadnetwork/aidl/default/Android.bp @@ -77,7 +77,6 @@ cc_fuzz { "fuzzer.cpp", ], - required: ["ot-rcp"], fuzz_config: { cc: [ "zhanglongxia@google.com", diff --git a/threadnetwork/aidl/default/fuzzer.cpp b/threadnetwork/aidl/default/fuzzer.cpp index 512708daf4..fb6e5489bc 100644 --- a/threadnetwork/aidl/default/fuzzer.cpp +++ b/threadnetwork/aidl/default/fuzzer.cpp @@ -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(url); fuzzService(service->asBinder().get(), FuzzedDataProvider(data, size));