mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-25 03:47:22 +00:00
S3 Fuzzer: PRNG Seed and decisiong graph fixes
- Change random seed generator to always spit out ints between 0 and 100,000 - Fix seeds so randomly generated seeds are *actually* the same as those seeds read from a file. - Tweaks to decision graph Remaining Bugs: - Single } encountered in format string - _mexe complains about "BadStatusLine"
This commit is contained in:
parent
23fee1476a
commit
d2c841d1df
2 changed files with 13 additions and 11 deletions
|
@ -13,17 +13,19 @@ bucket:
|
|||
- 13 bucket_get
|
||||
- 8 bucket_put
|
||||
- 5 bucket_delete
|
||||
- garbage_method
|
||||
- bucket_garbage_method
|
||||
|
||||
garbage_method:
|
||||
bucket_garbage_method:
|
||||
set:
|
||||
method:
|
||||
- '{random 1-100 printable}'
|
||||
- '{random 10-100 binary}'
|
||||
urlpath:
|
||||
- '/{bucket}'
|
||||
- '/{bucket}/{object}'
|
||||
- '{random 10-1000 binary}'
|
||||
bucket:
|
||||
- '{bucket_readable}'
|
||||
- '{bucket_not_readable}'
|
||||
- '{bucket_writable}'
|
||||
- '{bucket_not_writable}'
|
||||
- '2 {garbage}'
|
||||
choices:
|
||||
- bucket_get_simple
|
||||
- bucket_get_filtered
|
||||
|
|
|
@ -215,7 +215,7 @@ def randomlist(seed=None):
|
|||
"""
|
||||
rng = random.Random(seed)
|
||||
while True:
|
||||
yield rng.random()
|
||||
yield rng.randint(0,100000) #100,000 seeds is enough, right?
|
||||
|
||||
|
||||
def populate_buckets(conn, alt):
|
||||
|
@ -275,7 +275,7 @@ def _main():
|
|||
request_seeds = None
|
||||
if options.seedfile:
|
||||
FH = open(options.seedfile, 'r')
|
||||
request_seeds = [float(line) for line in FH.readlines()]
|
||||
request_seeds = [int(line) for line in FH if line != '\n']
|
||||
print>>OUT, 'Seedfile: %s' %options.seedfile
|
||||
print>>OUT, 'Number of requests: %d' %len(request_seeds)
|
||||
else:
|
||||
|
@ -298,7 +298,7 @@ def _main():
|
|||
print>>OUT, "Begin Fuzzing..."
|
||||
print>>VERBOSE, '='*80
|
||||
for request_seed in request_seeds:
|
||||
print>>OUT, request_seed
|
||||
print>>OUT, '%r' %request_seed
|
||||
|
||||
prng = random.Random(request_seed)
|
||||
decision = assemble_decision(decision_graph, prng)
|
||||
|
@ -317,13 +317,13 @@ def _main():
|
|||
except KeyError:
|
||||
headers = {}
|
||||
|
||||
response = s3_connection.make_request(method, path, data=body, headers=headers, override_num_retries=0)
|
||||
|
||||
print>>VERBOSE, "%s %s" %(method[:100], path[:100])
|
||||
for h, v in headers.iteritems():
|
||||
print>>VERBOSE, "%s: %s" %(h[:50], v[:50])
|
||||
print>>VERBOSE, "%s\n" % body[:100]
|
||||
|
||||
response = s3_connection.make_request(method, path, data=body, headers=headers, override_num_retries=0)
|
||||
|
||||
print>>DEBUG, 'FULL REQUEST'
|
||||
print>>DEBUG, 'Method: %r' %method
|
||||
print>>DEBUG, 'Path: %r' %path
|
||||
|
|
Loading…
Reference in a new issue