]> git-server-git.apps.pok.os.sepia.ceph.com Git - s3-tests.git/commitdiff
S3 Fuzzer: httplib error handling
authorKyle Marsh <kyle.marsh@dreamhost.com>
Mon, 12 Sep 2011 19:35:10 +0000 (12:35 -0700)
committerKyle Marsh <kyle.marsh@dreamhost.com>
Mon, 12 Sep 2011 20:05:29 +0000 (13:05 -0700)
Sometimes httplib will through a BadStatusLine error that the fuzzer should
catch and register as a failure.

s3tests/functional/test_fuzzer.py
s3tests/fuzz_headers.py

index 1039b55c063242f12e08aca15464574b8597eed5..717b1db1c23eb96c364902fe247d1231f91aed57 100644 (file)
@@ -1,4 +1,4 @@
-import sys
+mport sys
 import itertools
 import nose
 import random
index f5a20bcb883c42b52af8dfcb98e6ecd64653c1f5..e49713f6e4a58535ae52d29a1da5f10ca2d5b47d 100644 (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:'