diff options
author | Gerald Combs <gerald@wireshark.org> | 2012-10-09 20:47:22 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2012-10-09 20:47:22 +0000 |
commit | ff32bd8000125728c2d6e892d9a896708754fa6d (patch) | |
tree | fa311763b8a4e25ecf82819a4ac90becc547f24c /tools | |
parent | cdd0915addfc4f84fc3470671a693be2741a1bd7 (diff) |
If our error output is huge (> 5 MB) trim out the middle of the file.
The recent loop bugs have generated output that's too large to attach to
Bugzilla.
svn path=/trunk/; revision=45437
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/fuzz-test.sh | 9 | ||||
-rwxr-xr-x | tools/randpkt-test.sh | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/tools/fuzz-test.sh b/tools/fuzz-test.sh index 09dc951359..3e19fdf1ea 100755 --- a/tools/fuzz-test.sh +++ b/tools/fuzz-test.sh @@ -198,6 +198,15 @@ function exit_error() { echo -e "Processing failed. Capture info follows:\n" echo " Input file: $CF" + ERR_SIZE=$(du -sk $TMP_DIR/$ERR_FILE | awk '{ print $1 }') + if [ $ERR_SIZE -ge 5000 ] ; then + mv $TMP_DIR/$ERR_FILE $TMP_DIR/${ERR_FILE}.full + head -n 2000 $TMP_DIR/${ERR_FILE}.full > $TMP_DIR/$ERR_FILE + echo -e "\n\n[ Output removed ]\n\n" >> $TMP_DIR/$ERR_FILE + tail -n 2000 $TMP_DIR/${ERR_FILE}.full >> $TMP_DIR/$ERR_FILE + rm -f $TMP_DIR/${ERR_FILE}.full + fi + if [ -d .svn ] ; then echo -e "\nSubversion revision" >> $TMP_DIR/$ERR_FILE svn log -l 1 >> $TMP_DIR/$ERR_FILE diff --git a/tools/randpkt-test.sh b/tools/randpkt-test.sh index e62df6d2ea..ea87135706 100755 --- a/tools/randpkt-test.sh +++ b/tools/randpkt-test.sh @@ -89,6 +89,15 @@ function exit_error() { echo -e "Processing failed. Capture info follows:\n" echo " Input file: $CF" + ERR_SIZE=$(du -sk $TMP_DIR/$ERR_FILE | awk '{ print $1 }') + if [ $ERR_SIZE -ge 5000 ] ; then + mv $TMP_DIR/$ERR_FILE $TMP_DIR/${ERR_FILE}.full + head -n 2000 $TMP_DIR/${ERR_FILE}.full > $TMP_DIR/$ERR_FILE + echo -e "\n\n[ Output removed ]\n\n" >> $TMP_DIR/$ERR_FILE + tail -n 2000 $TMP_DIR/${ERR_FILE}.full >> $TMP_DIR/$ERR_FILE + rm -f $TMP_DIR/${ERR_FILE}.full + fi + if [ -d .svn ] ; then echo -e "\nSubversion revision" >> $TMP_DIR/$ERR_FILE svn log -l 1 >> $TMP_DIR/$ERR_FILE |