Skip to content

Commit c8d181a

Browse files
committed
Making bash syntax for P2IM unit test run script more compatible. Adding inotify setting sanity check to the experiment as well.
1 parent 94ddc05 commit c8d181a

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

01-access-modeling-for-fuzzing/p2im-unittests/run_experiment.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ DIR="$(dirname "$(readlink -f "$0")")"
33

44
NUM_INSTANCES=1
55

6+
set -e
67
fuzzware checkenv -n $NUM_INSTANCES || { echo "Error during initial sanity checks. Please fix according to debug output."; exit 1; }
78

89
"$DIR"/run_fuzzers.sh $NUM_INSTANCES || { echo "[ERROR] run_fuzzers failed"; exit 1; }

01-access-modeling-for-fuzzing/p2im-unittests/run_fuzzers.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,19 @@ if [ $num_available_cores -gt 1 ] && [ $num_procs -gt $(( $num_available_cores /
2020
exit 1;
2121
fi
2222

23+
if [ $(( 4 * $num_procs )) -gt $(cat /proc/sys/fs/inotify/max_user_instances) ]; then
24+
echo "[ERROR] inotify limits too low for requested number of fuzzing instances (did you set limits?)"
25+
exit 1
26+
fi
27+
2328
FUZZING_RUNTIME="00:15:00"
2429

2530
export AFL_SKIP_CPUFREQ=1
26-
( for f in `find $DIR -iname '*.elf'`; do echo $(dirname $f); done ) | xargs -I{} --max-procs $num_procs -- \
27-
fuzzware pipeline --run-for=$FUZZING_RUNTIME {};
31+
( for f in `find $DIR -iname '*.elf'`; do
32+
# Skip possible copies within already-existing project directories
33+
if [ "$(basename $(dirname $f))" != "data" ]; then
34+
echo "fuzzware pipeline --run-for=$FUZZING_RUNTIME $(dirname $f)";
35+
fi
36+
done ) | xargs -I{} --max-procs $num_procs -- bash -c "{}"
2837

29-
( for p in `find $DIR -name fuzzware-project`; do echo $p; done ) | xargs -I{} --max-procs $(( $num_procs * 2 )) -- \
30-
fuzzware gentraces -p {} --main-dirs all bb
38+
exit 0

0 commit comments

Comments
 (0)