Pass peer's Init message through to ChannelManager
[rust-lightning] / fuzz / travis-fuzz.sh
index a60d11855d6c43df2de5dd320a1084ca0871e8d9..5ec431d7ef1818ffccde8700fb23142bb9345a9e 100755 (executable)
@@ -1,10 +1,30 @@
 #!/bin/bash
 set -e
+
+pushd src/msg_targets
+rm msg_*.rs
+./gen_target.sh
+[ "$(git diff)" != "" ] && exit 1
+popd
+pushd src/bin
+rm *_target.rs
+./gen_target.sh
+[ "$(git diff)" != "" ] && exit 1
+popd
+
 cargo install --force honggfuzz
-for TARGET in fuzz_targets/*.rs fuzz_targets/msg_targets/*_target.rs; do
+HFUZZ_BUILD_ARGS="--features honggfuzz_fuzz" cargo hfuzz build
+for TARGET in src/bin/*.rs; do
        FILENAME=$(basename $TARGET)
        FILE="${FILENAME%.*}"
-       HFUZZ_BUILD_ARGS="--features honggfuzz_fuzz" HFUZZ_RUN_ARGS="-N1000000 --exit_upon_crash -v" cargo hfuzz run $FILE
+       HFUZZ_RUN_ARGS="--exit_upon_crash -v -n2"
+       if [ "$FILE" = "chanmon_consistency_target" ]; then
+               HFUZZ_RUN_ARGS="$HFUZZ_RUN_ARGS -F 64 -N100000"
+       else
+               HFUZZ_RUN_ARGS="$HFUZZ_RUN_ARGS -N1000000"
+       fi
+       export HFUZZ_RUN_ARGS
+       HFUZZ_BUILD_ARGS="--features honggfuzz_fuzz" cargo hfuzz run $FILE
        if [ -f hfuzz_workspace/$FILE/HONGGFUZZ.REPORT.TXT ]; then
                cat hfuzz_workspace/$FILE/HONGGFUZZ.REPORT.TXT
                for CASE in hfuzz_workspace/$FILE/SIG*; do