@@ -56,7 +56,7 @@ elif $IS_DARWIN; then
5656 check_command gtimeout " brew install coreutils"
5757fi
5858
59- FUZZ_TIME=" ${FUZZ_TIME:- " 5m " } "
59+ FUZZ_TIME=" ${FUZZ_TIME:- " 10m " } "
6060
6161# ---------------------------------------
6262# Run fuzz test
@@ -66,18 +66,23 @@ cd ./test/subspace-test-fuzzer
6666# remove existing afl output so that previous run is not continued
6767rm -rf output
6868
69+ # build binary
70+ cargo ziggy build --release --no-honggfuzz
71+
72+ BINARY=" ./target/afl/release/subspace-test-fuzzer"
73+
6974echo " 🚀 Running Ziggy fuzzing for $FUZZ_TIME ..."
7075
7176# run behind a timeout since ziggy by itself one
7277# TODO: https://github.com/srlabs/ziggy/issues/115
7378if $IS_DARWIN ; then
7479 set +e
75- gtimeout --preserve-status " $FUZZ_TIME " cargo ziggy fuzz --release --no-honggfuzz
80+ gtimeout --preserve-status " $FUZZ_TIME " cargo ziggy fuzz -b ${BINARY}
7681 FUZZ_EXIT_CODE=$?
7782 set -e
7883else
7984 set +e
80- timeout --preserve-status " $FUZZ_TIME " cargo ziggy fuzz --release --no-honggfuzz
85+ timeout --preserve-status " $FUZZ_TIME " cargo ziggy fuzz -b ${BINARY}
8186 FUZZ_EXIT_CODE=$?
8287 set -e
8388fi
@@ -95,10 +100,13 @@ if [[ -d "$CRASH_DIR" ]]; then
95100 CRASH_COUNT=$( find " $CRASH_DIR " -type f | wc -l | tr -d ' ' )
96101 if [[ " $CRASH_COUNT " -gt 0 ]]; then
97102 echo " ⚠️ Found $CRASH_COUNT crashes from this fuzzing run."
103+ exit 1
98104 else
99105 echo " ✅ No crashes detected."
106+ exit 0
100107 fi
101108else
102- echo " ⚠️ Crash directory not found: $CRASH_DIR "
103- echo " (Fuzzer output structure may have changed)"
109+ echo " ❌ Crash directory not found: $CRASH_DIR "
110+ echo " (Fuzzer output structure may have changed or fuzzing failed)"
111+ exit 2
104112fi
0 commit comments