Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3bbcbcdc authored by Zhanglong Xia's avatar Zhanglong Xia Committed by Kangping Dong
Browse files

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
parent 83c4ef44
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -79,7 +79,6 @@ cc_fuzz {
        "fuzzer.cpp",
    ],

    required: ["ot-rcp"],
    fuzz_config: {
        cc: [
            "zhanglongxia@google.com",
+1 −1
Original line number Diff line number Diff line
@@ -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));