S3 Fuzzer: httplib error handling

Sometimes httplib will through a BadStatusLine error that the fuzzer should
catch and register as a failure.
This commit is contained in:
Kyle Marsh 2011-09-12 12:35:10 -07:00
parent d0a42a7a89
commit 046b92b7eb
2 changed files with 6 additions and 1 deletions

View file

@ -1,4 +1,4 @@
import sys
mport sys
import itertools
import nose
import random

View file

@ -1,6 +1,7 @@
from boto.s3.connection import S3Connection
from boto.exception import BotoServerError
from boto.s3.key import Key
from httplib import BadStatusLine
from optparse import OptionParser
from . import common
@ -341,6 +342,10 @@ def _main():
response = e
body = e.body
failed = True
except BadStatusLine, e:
print>>OUT, 'FAILED: failed to parse response (BadStatusLine); probably a NUL byte in your request?'
print>>VERBOSE, '='*80
continue
if failed:
print>>OUT, 'FAILED:'