posix: add fuzz testing using MAVLink messages

This adds the env option PX4_FUZZ which runs the LLVM libFuzzer which
throws random bytes at mavlink_receiver using MAVLink messages over UDP.

The MAVLink messages that are being sent are valid, so the CRC is
calculated but the payload and msgid, etc. are generally garbage, unless
the fuzzing gets a msgid right by chance.

As I understand it, libFuzzer watches the test coverage and will try to
execute as much of the code as possible.
This commit is contained in:
Julian Oes
2022-01-07 10:17:12 -05:00
committed by Daniel Agar
parent c17a9e8003
commit 9eda5b373c
5 changed files with 200 additions and 4 deletions
+2
View File
@@ -13,6 +13,8 @@ if(REPLAY_FILE)
message(STATUS "Building without lockstep for replay")
set(ENABLE_LOCKSTEP_SCHEDULER no)
elif(CMAKE_BUILD_TYPE STREQUAL FuzzTesting)
set(ENABLE_LOCKSTEP_SCHEDULER no)
else()
set(ENABLE_LOCKSTEP_SCHEDULER yes)
endif()