S3 Fuzzer: finish describing bucket operations

Finishing touches on decision graph for bucket operations.
This commit is contained in:
Kyle Marsh 2011-08-18 14:11:54 -07:00
parent e12f124686
commit 76956d86e4
2 changed files with 103 additions and 46 deletions

View file

@ -1,5 +1,8 @@
start: start:
set: {} set:
garbage:
- {random 10-3000 printable}
- {random 10-1000 binary}
choices: choices:
- bucket - bucket
@ -10,7 +13,7 @@ bucket:
- 13 bucket_get - 13 bucket_get
- 8 bucket_put - 8 bucket_put
- 5 bucket_delete - 5 bucket_delete
- bucket_garbage - garbage_method
garbage_method: garbage_method:
set: set:
@ -35,14 +38,12 @@ bucket_delete:
bucket: bucket:
- {bucket_writable} - {bucket_writable}
- {bucket_not_writable} - {bucket_not_writable}
- {random 10-3000 printable} - 2 {garbage}
- {random 10-1000 binary}
query: query:
- null - null
- policy - policy
- website - website
- {random 2-20 printable} - 2 {garbage}
- {random 10-1000 binary}
choices: [] choices: []
bucket_get: bucket_get:
@ -51,8 +52,7 @@ bucket_get:
bucket: bucket:
- {bucket_readable} - {bucket_readable}
- {bucket_not_readable} - {bucket_not_readable}
- {random 10-3000 printable} - 2 {garbage}
- {random 10-1000 binary}
choices: choices:
- 11 bucket_get_simple - 11 bucket_get_simple
- bucket_get_filtered - bucket_get_filtered
@ -70,24 +70,43 @@ bucket_get_simple:
- requestPayment - requestPayment
- versioning - versioning
- website - website
- {random 2-20 printable} - 2 {garbage}
- {random 10-1000 binary}
choices: [] choices: []
bucket_get_uploads: bucket_get_uploads:
set: set:
delimiter:
- null
- 3 'delimiter={garbage}'
prefix:
- null
- 3 'prefix={garbage}'
key_marker:
- null
- 'key-marker={object_readable}'
- 'key-marker={object_not_readable}'
- 'key-marker={invalid_key}'
- 'key-marker={random 100-1000 printable}'
max_uploads:
- null
- 'max-uploads={random 1-5 binary}'
- 'max-uploads={random 1-1000 digits}'
upload_id_marker:
- null
- 3 'upload-id-marker={random}'
query: query:
- - 'uploads'
- 'uploads&{delimiter}&{prefix}'
- 'uploads&{max_uploads}&{key_marker}&{upload_id_marker}'
- 2 {garbage}
choices: [] choices: []
bucket_get_filtered: bucket_get_filtered:
set: set:
delimiter: delimiter:
- 'delimiter={random 10-50 binary}' - 'delimiter={garbage}'
- 'delimiter={random 1000-3000 printable}'
prefix: prefix:
- 'prefix={random 10-50 binary}' - 'prefix={garbage}'
- 'prefix={random 100-3000 printable}'
marker: marker:
- 'marker={object_readable}' - 'marker={object_readable}'
- 'marker={object_not_readable}' - 'marker={object_not_readable}'
@ -100,8 +119,7 @@ bucket_get_filtered:
- null - null
- '{delimiter}&{prefix}' - '{delimiter}&{prefix}'
- '{max-keys}&{marker}' - '{max-keys}&{marker}'
- {random 10-1000 printable} - 2 {garbage}
- {random 10-1000 binary}
choices: [] choices: []
bucket_put: bucket_put:
@ -109,8 +127,7 @@ bucket_put:
bucket: bucket:
- {bucket_writable} - {bucket_writable}
- {bucket_not_writable} - {bucket_not_writable}
- {random 10-3000 printable} - 2 {garbage}
- {random 10-1000 binary}
method: PUT method: PUT
choices: choices:
- bucket_put_simple - bucket_put_simple
@ -120,8 +137,7 @@ bucket_put:
bucket_put_create: bucket_put_create:
set: set:
body: body:
- {random 3000 printable} - 2 {garbage}
- {random 10-3000 binary}
- '<CreateBucketConfiguration><LocationConstraint>{random 2-10 binary}</LocationConstraint></CreateBucketConfiguration>' - '<CreateBucketConfiguration><LocationConstraint>{random 2-10 binary}</LocationConstraint></CreateBucketConfiguration>'
acl: acl:
- private - private
@ -134,9 +150,8 @@ bucket_put_create:
bucket_put_versioning: bucket_put_versioning:
set: set:
body: body:
- {random 3000 printable} - {garbage}
- {random 10-3000 binary} - 4 '<VersioningConfiguration>{versioning_status}{mfa_delete_body}</VersioningConfiguration>'
- 8 '<VersioningConfiguration>{versioning_status}{mfa_delete_body}</VersioningConfiguration>'
mfa_delete_body: mfa_delete_body:
- null - null
- '<Status>{random 2-10 binary}</Status>' - '<Status>{random 2-10 binary}</Status>'
@ -146,7 +161,7 @@ bucket_put_versioning:
- '<MfaDelete>{random 2-10 binary}</MfaDelete>' - '<MfaDelete>{random 2-10 binary}</MfaDelete>'
- '<MfaDelete>{random 2000-3000 printable}</MfaDelete>' - '<MfaDelete>{random 2000-3000 printable}</MfaDelete>'
mfa_header: mfa_header:
- {random 10-1000 printable} {random 10-1000 printable} - '{random 10-1000 printable} {random 10-1000 printable}'
headers: headers:
- ['0-1', 'x-amz-mfa', '{mfa_header}'] - ['0-1', 'x-amz-mfa', '{mfa_header}']
choices: [] choices: []
@ -161,6 +176,7 @@ bucket_put_simple:
- {request_payment_body} - {request_payment_body}
- {website_body} - {website_body}
acl_body: acl_body:
- null
- '<AccessControlPolicy>{owner}{acl}</AccessControlPolicy>' - '<AccessControlPolicy>{owner}{acl}</AccessControlPolicy>'
owner: owner:
- null - null
@ -171,9 +187,9 @@ bucket_put_simple:
- '<ID>{random 1000-3000 printable}</ID>' - '<ID>{random 1000-3000 printable}</ID>'
display_name: display_name:
- null - null
- '<DisplayName>{random 10-200 binary}</DisplayName>' - 2 '<DisplayName>{random 10-200 binary}</DisplayName>'
- '<DisplayName>{random 1000-3000 printable}</DisplayName>' - 2 '<DisplayName>{random 1000-3000 printable}</DisplayName>'
- '<DisplayName>{random 10-300 letters}@{random 10-300 letters}.{random 2-4 letters}</DisplayName>' - 2 '<DisplayName>{random 10-300 letters}@{random 10-300 letters}.{random 2-4 letters}</DisplayName>'
acl: acl:
- null - null
- 10 '<AccessControlList><Grant>{grantee}{permission}</Grant></AccessControlList>' - 10 '<AccessControlList><Grant>{grantee}{permission}</Grant></AccessControlList>'
@ -184,17 +200,53 @@ bucket_put_simple:
- null - null
- 7 '<Permission>{permission_value}</Permission>' - 7 '<Permission>{permission_value}</Permission>'
permission_value: permission_value:
- {random 10-100 binary} - 2 {garbage}
- {random 1000-2000 printable}
- FULL_CONTROL - FULL_CONTROL
- WRITE - WRITE
- WRITE_ACP - WRITE_ACP
- READ - READ
- READ_ACP - READ_ACP
policy_body: TODO policy_body:
logging_body: TODO - null
notification_body: TODO - 2 {garbage}
request_payment_body: TODO logging_body:
website_body: TODO - null
- '<BucketLoggingStatus xmlns="http://doc.s3.amazonaws.com/2006-03-01" />'
- '<BucketLoggingStatus xmlns="http://doc.s3.amazonaws.com/2006-03-01"><LoggingEnabled>{bucket}{target_prefix}{target_grants}</LoggingEnabled></BucketLoggingStatus>'
target_prefix:
- null
- '<TargetPrefix>{random 10-1000 printable}</TargetPrefix>'
- '<TargetPrefix>{random 10-1000 binary}</TargetPrefix>'
target_grants:
- null
- 10 '<TargetGrants><Grant>{grantee}{permission}</Grant></TargetGrants>'
notification_body:
- null
- '<NotificationConfiguration />'
- 2 '<NotificationConfiguration><TopicConfiguration>{topic}{event}</TopicConfiguration}</NotificationConfiguration>'
topic:
- null
- 2 '<Topic>{garbage}</Topic>'
event:
- null
- '<Event>s3:ReducedRedundancyLostObject</Event>'
- 2 '<Event>{garbage}</Event>'
request_payment_body:
- null
- '<RequestPaymentConfiguration xlmns="http://s3.amazonaws.com/doc/2006-03-01/"><Payer>{payer}</Payer></RequestPaymentConfiguration>'
payer:
- Requester
- BucketOwner
- 2 {garbage}
website_body:
- null
- '<WebsiteConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><IndexDocument><Suffix>{suffix}</Suffix><IndexDocument>{error_doc}<WebsiteConfiguration/>'
suffix:
- null
- 2 {garbage}
- '{random 2-10 printable}.html'
error_doc:
- null
- '<ErrorDocument><Key>{suffix}</Key></ErrorDocument>'
choices: [] choices: []

View file

@ -234,16 +234,16 @@ def _main():
graph_file = open(options.graph_filename, 'r') graph_file = open(options.graph_filename, 'r')
decision_graph = yaml.safe_load(graph_file) decision_graph = yaml.safe_load(graph_file)
constants = { constants = dict(
'bucket_readable': 'TODO', bucket_readable='TODO-breadable',
'bucket_not_readable': 'TODO', bucket_not_readable='TODO-bnonreadable',
'bucket_writable' : 'TODO', bucket_writable='TODO-bwritable',
'bucket_not_writable' : 'TODO', bucket_not_writable='TODO-bnonwritable',
'object_readable' : 'TODO', object_readable='TODO-oreadable',
'object_not_readable' : 'TODO', object_not_readable='TODO-ononreadable',
'object_writable' : 'TODO', object_writable='TODO-owritable',
'object_not_writable' : 'TODO', object_not_writable='TODO-ononwritable',
} )
for request_seed in request_seeds: for request_seed in request_seeds:
prng = random.Random(request_seed) prng = random.Random(request_seed)
@ -255,7 +255,12 @@ def _main():
body = expand(decision, decision['body'], prng) body = expand(decision, decision['body'], prng)
headers = expand_headers(decision, prng) headers = expand_headers(decision, prng)
response = s3_connection.make_request(method, path, data=body, headers=headers, override_num_retries=0) print "Method: %s" % method
print "Path: %s" % path
print "Headers: %s" % headers
print ""
print "Body: %s" % body
#response = s3_connection.make_request(method, path, data=body, headers=headers, override_num_retries=0)
if response.status == 500 or response.status == 503: if response.status == 500 or response.status == 503:
print 'Request generated with seed %d failed:\n%s' % (request_seed, request) print 'Request generated with seed %d failed:\n%s' % (request_seed, request)