Skip to content

Commit

Permalink
Fuzzing: Enhance test scripts to detect issue #667
Browse files Browse the repository at this point in the history
Signed-off-by: Wei Liu <[email protected]>
  • Loading branch information
liuw1 authored and jyao1 committed Mar 11, 2024
1 parent b2c5ffe commit a7e7ae2
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions sh_script/fuzzing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ search_test_case() {
for path in ${fuzz_folder[@]};do
pushd $path
fuzz_list=$(cargo fuzz list)
if [ $? != "0" ]; then
exit 1
fi
for fuzz in $fuzz_list;do
if [ "$fuzz" != "$test_case" ];then
continue
Expand All @@ -104,6 +107,9 @@ check_build() {
for path in ${fuzz_folder[@]};do
pushd $path
fuzz_list=$(cargo fuzz list)
if [ $? != "0" ]; then
exit 1
fi
for fuzz in ${fuzz_list[@]};do
test_case=$fuzz
echo "## Build test case $test_case in $path"
Expand All @@ -125,6 +131,9 @@ run_single_case() {
temp_sw='NO'
pushd $path
fuzz_list=$(cargo fuzz list)
if [ $? != "0" ]; then
exit 1
fi
for fuzz in ${fuzz_list[@]};do
if [ "$fuzz" == "$test_case" ];then
temp_sw="YES"
Expand Down Expand Up @@ -221,6 +230,9 @@ run_all_case(){
for path in ${fuzz_folder[@]}; do
pushd $path
fuzz_list=$(cargo fuzz list)
if [ $? != "0" ]; then
exit 1
fi
for fuzz in $fuzz_list; do
if [[ $fuzz =~ "afl" ]]; then
continue
Expand Down Expand Up @@ -252,6 +264,9 @@ run_all_case(){
for path in ${fuzz_folder[@]};do
pushd $path
fuzz_list=$(cargo fuzz list)
if [ $? != "0" ]; then
exit 1
fi
for fuzz in $fuzz_list;do
if [[ "$fuzz" =~ "afl" ]];then
if [ "${collect_coverage}" == "YES" ]; then
Expand Down Expand Up @@ -299,6 +314,9 @@ check_test_result() {
for path in ${fuzz_folder[@]}; do
pushd $path
fuzz_list=$(cargo fuzz list)
if [ $? != "0" ]; then
exit 1
fi
for fuzz in $fuzz_list; do
if [[ $fuzz =~ "afl" ]]; then
continue
Expand All @@ -319,6 +337,9 @@ check_test_result() {
for path in ${fuzz_folder[@]};do
pushd $path
fuzz_list=$(cargo fuzz list)
if [ $? != "0" ]; then
exit 1
fi
for fuzz in $fuzz_list;do
if [[ "$fuzz" =~ "afl" ]];then
queue_seed_num=`ls -A fuzz/artifacts/$fuzz/default/queue | wc -l`
Expand Down

0 comments on commit a7e7ae2

Please sign in to comment.