mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 07:28:54 +08:00
ci: add fuzzing workflow
This will run all fuzzing tests for 15 minutes once a day.
This commit is contained in:
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
# This script runs the fuzz tests from a given binary for a certain amount of time
|
||||
set -e
|
||||
|
||||
if [[ "$1" == "--help" || "$1" == "-h" || -z "$1" ]]; then
|
||||
echo "Usage: $0 <binary> [<duration>]"
|
||||
echo "duration can be for example 5m or 5h"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
binary="$1"
|
||||
duration="$2"
|
||||
[[ -z "$duration" ]] && duration="1m"
|
||||
|
||||
# Iterate over all available fuzz tests in the binary
|
||||
for t in $("$binary" --fuzz=__non_existent__ 2>&1 | sed '1,/^Valid tests:$/d' | tr -d ' '); do
|
||||
echo "Running $t"
|
||||
"$binary" --fuzz="$t" --fuzz_for="$duration"
|
||||
done
|
||||
Reference in New Issue
Block a user