aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtools/fuzz-test.sh18
-rwxr-xr-xtools/randpkt-test.sh16
2 files changed, 23 insertions, 11 deletions
diff --git a/tools/fuzz-test.sh b/tools/fuzz-test.sh
index f150e42638..c8b0fb8ae7 100755
--- a/tools/fuzz-test.sh
+++ b/tools/fuzz-test.sh
@@ -94,7 +94,7 @@ ulimit -c unlimited
if [ $VALGRIND -eq 1 ]; then
RUNNER="$BIN_DIR/tools/valgrind-wireshark.sh"
- RUNNER_ARGS="${CONFIG_PROFILE}${TWO_PASS}"
+ declare -a RUNNER_ARGS=("${CONFIG_PROFILE}${TWO_PASS}")
else
# Not using valgrind, use regular tshark.
# TShark arguments (you won't have to change these)
@@ -103,7 +103,7 @@ else
# x Cause TShark to print a hex and ASCII dump of the packet data after printing the summary or details
# r Read packet data from the following infile
RUNNER="$TSHARK"
- RUNNER_ARGS="${CONFIG_PROFILE}${TWO_PASS}-nVxr"
+ declare -a RUNNER_ARGS=("${CONFIG_PROFILE}${TWO_PASS}-nVxr" "${CONFIG_PROFILE}${TWO_PASS}-nr")
fi
@@ -148,7 +148,9 @@ HOWMANY="forever"
if [ $MAX_PASSES -gt 0 ]; then
HOWMANY="$MAX_PASSES passes"
fi
-echo "Running $RUNNER with args: $RUNNER_ARGS ($HOWMANY)"
+echo -n "Running $RUNNER with args: "
+printf "\"%s\" " "${RUNNER_ARGS[@]}"
+echo "($HOWMANY)"
echo ""
# Clean up on <ctrl>C, etc
@@ -254,9 +256,13 @@ while [ \( $PASS -lt $MAX_PASSES -o $MAX_PASSES -lt 1 \) -a $DONE -ne 1 ] ; do
fi
fi
- "$RUNNER" $RUNNER_ARGS $TMP_DIR/$TMP_FILE \
- > /dev/null 2>> $TMP_DIR/$ERR_FILE
- RETVAL=$?
+ for ARGS in "${RUNNER_ARGS[@]}" ; do
+ echo -n "($ARGS) "
+ "$RUNNER" $ARGS $TMP_DIR/$TMP_FILE \
+ > /dev/null 2>> $TMP_DIR/$ERR_FILE
+ RETVAL=$?
+ if [ $RETVAL -ge 128 ] ; then break ; fi
+ done
# Uncomment the next two lines to enable dissector bug
# checking.
diff --git a/tools/randpkt-test.sh b/tools/randpkt-test.sh
index 2260835951..0195b7e45c 100755
--- a/tools/randpkt-test.sh
+++ b/tools/randpkt-test.sh
@@ -58,7 +58,7 @@ ulimit -c unlimited
# V Print a view of the details of the packet rather than a one-line summary of the packet
# x Cause TShark to print a hex and ASCII dump of the packet data after printing the summary or details
# r Read packet data from the following infile
-TSHARK_ARGS="-nVxr"
+declare -a TSHARK_ARGS=("-nVxr" "-nr")
RANDPKT_ARGS="-b 2000 -c 5000"
NOTFOUND=0
@@ -76,7 +76,9 @@ HOWMANY="forever"
if [ $MAX_PASSES -gt 0 ]; then
HOWMANY="$MAX_PASSES passes"
fi
-echo "Running $TSHARK with args: $TSHARK_ARGS ($HOWMANY)"
+echo -n "Running $TSHARK with args: "
+printf "\"%s\" " "${TSHARK_ARGS[@]}"
+echo "($HOWMANY)"
echo "Running $RANDPKT with args: $RANDPKT_ARGS"
echo ""
@@ -118,9 +120,13 @@ while [ $PASS -lt $MAX_PASSES -o $MAX_PASSES -lt 1 ] ; do
"$RANDPKT" $RANDPKT_ARGS -t $PKT_TYPE $TMP_DIR/$TMP_FILE \
> /dev/null 2>&1
- "$TSHARK" $TSHARK_ARGS $TMP_DIR/$TMP_FILE \
- > /dev/null 2> $TMP_DIR/$ERR_FILE
- RETVAL=$?
+ for ARGS in "${TSHARK_ARGS[@]}" ; do
+ echo -n "($ARGS) "
+ "$TSHARK" $ARGS $TMP_DIR/$TMP_FILE \
+ > /dev/null 2> $TMP_DIR/$ERR_FILE
+ RETVAL=$?
+ if [ $RETVAL -ge 128 ] ; then break ; fi
+ done
grep -i "dissector bug" $TMP_DIR/$ERR_FILE \
> /dev/null 2>&1 && DISSECTOR_BUG=1
if [ $RETVAL -ne 0 -o $DISSECTOR_BUG -ne 0 ] ; then