Skip to content

Commit a7e7ae2

Browse files
liuw1jyao1
authored andcommittedMar 11, 2024·
Fuzzing: Enhance test scripts to detect issue #667
Signed-off-by: Wei Liu <[email protected]>
1 parent b2c5ffe commit a7e7ae2

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
 

‎sh_script/fuzzing.sh

+21
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ search_test_case() {
8181
for path in ${fuzz_folder[@]};do
8282
pushd $path
8383
fuzz_list=$(cargo fuzz list)
84+
if [ $? != "0" ]; then
85+
exit 1
86+
fi
8487
for fuzz in $fuzz_list;do
8588
if [ "$fuzz" != "$test_case" ];then
8689
continue
@@ -104,6 +107,9 @@ check_build() {
104107
for path in ${fuzz_folder[@]};do
105108
pushd $path
106109
fuzz_list=$(cargo fuzz list)
110+
if [ $? != "0" ]; then
111+
exit 1
112+
fi
107113
for fuzz in ${fuzz_list[@]};do
108114
test_case=$fuzz
109115
echo "## Build test case $test_case in $path"
@@ -125,6 +131,9 @@ run_single_case() {
125131
temp_sw='NO'
126132
pushd $path
127133
fuzz_list=$(cargo fuzz list)
134+
if [ $? != "0" ]; then
135+
exit 1
136+
fi
128137
for fuzz in ${fuzz_list[@]};do
129138
if [ "$fuzz" == "$test_case" ];then
130139
temp_sw="YES"
@@ -221,6 +230,9 @@ run_all_case(){
221230
for path in ${fuzz_folder[@]}; do
222231
pushd $path
223232
fuzz_list=$(cargo fuzz list)
233+
if [ $? != "0" ]; then
234+
exit 1
235+
fi
224236
for fuzz in $fuzz_list; do
225237
if [[ $fuzz =~ "afl" ]]; then
226238
continue
@@ -252,6 +264,9 @@ run_all_case(){
252264
for path in ${fuzz_folder[@]};do
253265
pushd $path
254266
fuzz_list=$(cargo fuzz list)
267+
if [ $? != "0" ]; then
268+
exit 1
269+
fi
255270
for fuzz in $fuzz_list;do
256271
if [[ "$fuzz" =~ "afl" ]];then
257272
if [ "${collect_coverage}" == "YES" ]; then
@@ -299,6 +314,9 @@ check_test_result() {
299314
for path in ${fuzz_folder[@]}; do
300315
pushd $path
301316
fuzz_list=$(cargo fuzz list)
317+
if [ $? != "0" ]; then
318+
exit 1
319+
fi
302320
for fuzz in $fuzz_list; do
303321
if [[ $fuzz =~ "afl" ]]; then
304322
continue
@@ -319,6 +337,9 @@ check_test_result() {
319337
for path in ${fuzz_folder[@]};do
320338
pushd $path
321339
fuzz_list=$(cargo fuzz list)
340+
if [ $? != "0" ]; then
341+
exit 1
342+
fi
322343
for fuzz in $fuzz_list;do
323344
if [[ "$fuzz" =~ "afl" ]];then
324345
queue_seed_num=`ls -A fuzz/artifacts/$fuzz/default/queue | wc -l`

0 commit comments

Comments
 (0)
Please sign in to comment.