From 76956d86e4d0d5325693fc0edf6f18020d0217ed Mon Sep 17 00:00:00 2001 From: Kyle Marsh Date: Thu, 18 Aug 2011 14:11:54 -0700 Subject: [PATCH] S3 Fuzzer: finish describing bucket operations Finishing touches on decision graph for bucket operations. --- request_decision_graph.yml | 122 ++++++++++++++++++++++++++----------- s3tests/fuzz_headers.py | 27 ++++---- 2 files changed, 103 insertions(+), 46 deletions(-) diff --git a/request_decision_graph.yml b/request_decision_graph.yml index 39f3a61..e08155c 100644 --- a/request_decision_graph.yml +++ b/request_decision_graph.yml @@ -1,5 +1,8 @@ start: - set: {} + set: + garbage: + - {random 10-3000 printable} + - {random 10-1000 binary} choices: - bucket @@ -10,7 +13,7 @@ bucket: - 13 bucket_get - 8 bucket_put - 5 bucket_delete - - bucket_garbage + - garbage_method garbage_method: set: @@ -35,14 +38,12 @@ bucket_delete: bucket: - {bucket_writable} - {bucket_not_writable} - - {random 10-3000 printable} - - {random 10-1000 binary} + - 2 {garbage} query: - null - policy - website - - {random 2-20 printable} - - {random 10-1000 binary} + - 2 {garbage} choices: [] bucket_get: @@ -51,8 +52,7 @@ bucket_get: bucket: - {bucket_readable} - {bucket_not_readable} - - {random 10-3000 printable} - - {random 10-1000 binary} + - 2 {garbage} choices: - 11 bucket_get_simple - bucket_get_filtered @@ -70,24 +70,43 @@ bucket_get_simple: - requestPayment - versioning - website - - {random 2-20 printable} - - {random 10-1000 binary} + - 2 {garbage} choices: [] bucket_get_uploads: 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: - - + - 'uploads' + - 'uploads&{delimiter}&{prefix}' + - 'uploads&{max_uploads}&{key_marker}&{upload_id_marker}' + - 2 {garbage} choices: [] bucket_get_filtered: set: delimiter: - - 'delimiter={random 10-50 binary}' - - 'delimiter={random 1000-3000 printable}' + - 'delimiter={garbage}' prefix: - - 'prefix={random 10-50 binary}' - - 'prefix={random 100-3000 printable}' + - 'prefix={garbage}' marker: - 'marker={object_readable}' - 'marker={object_not_readable}' @@ -100,8 +119,7 @@ bucket_get_filtered: - null - '{delimiter}&{prefix}' - '{max-keys}&{marker}' - - {random 10-1000 printable} - - {random 10-1000 binary} + - 2 {garbage} choices: [] bucket_put: @@ -109,8 +127,7 @@ bucket_put: bucket: - {bucket_writable} - {bucket_not_writable} - - {random 10-3000 printable} - - {random 10-1000 binary} + - 2 {garbage} method: PUT choices: - bucket_put_simple @@ -120,8 +137,7 @@ bucket_put: bucket_put_create: set: body: - - {random 3000 printable} - - {random 10-3000 binary} + - 2 {garbage} - '{random 2-10 binary}' acl: - private @@ -134,9 +150,8 @@ bucket_put_create: bucket_put_versioning: set: body: - - {random 3000 printable} - - {random 10-3000 binary} - - 8 '{versioning_status}{mfa_delete_body}' + - {garbage} + - 4 '{versioning_status}{mfa_delete_body}' mfa_delete_body: - null - '{random 2-10 binary}' @@ -146,7 +161,7 @@ bucket_put_versioning: - '{random 2-10 binary}' - '{random 2000-3000 printable}' mfa_header: - - {random 10-1000 printable} {random 10-1000 printable} + - '{random 10-1000 printable} {random 10-1000 printable}' headers: - ['0-1', 'x-amz-mfa', '{mfa_header}'] choices: [] @@ -161,6 +176,7 @@ bucket_put_simple: - {request_payment_body} - {website_body} acl_body: + - null - '{owner}{acl}' owner: - null @@ -171,9 +187,9 @@ bucket_put_simple: - '{random 1000-3000 printable}' display_name: - null - - '{random 10-200 binary}' - - '{random 1000-3000 printable}' - - '{random 10-300 letters}@{random 10-300 letters}.{random 2-4 letters}' + - 2 '{random 10-200 binary}' + - 2 '{random 1000-3000 printable}' + - 2 '{random 10-300 letters}@{random 10-300 letters}.{random 2-4 letters}' acl: - null - 10 '{grantee}{permission}' @@ -184,17 +200,53 @@ bucket_put_simple: - null - 7 '{permission_value}' permission_value: - - {random 10-100 binary} - - {random 1000-2000 printable} + - 2 {garbage} - FULL_CONTROL - WRITE - WRITE_ACP - READ - READ_ACP - policy_body: TODO - logging_body: TODO - notification_body: TODO - request_payment_body: TODO - website_body: TODO + policy_body: + - null + - 2 {garbage} + logging_body: + - null + - '' + - '{bucket}{target_prefix}{target_grants}' + target_prefix: + - null + - '{random 10-1000 printable}' + - '{random 10-1000 binary}' + target_grants: + - null + - 10 '{grantee}{permission}' + notification_body: + - null + - '' + - 2 '{topic}{event}' + topic: + - null + - 2 '{garbage}' + event: + - null + - 's3:ReducedRedundancyLostObject' + - 2 '{garbage}' + request_payment_body: + - null + - '{payer}' + payer: + - Requester + - BucketOwner + - 2 {garbage} + website_body: + - null + - '{suffix}{error_doc}' + suffix: + - null + - 2 {garbage} + - '{random 2-10 printable}.html' + error_doc: + - null + - '{suffix}' choices: [] diff --git a/s3tests/fuzz_headers.py b/s3tests/fuzz_headers.py index 4e7a820..3796fd1 100644 --- a/s3tests/fuzz_headers.py +++ b/s3tests/fuzz_headers.py @@ -234,16 +234,16 @@ def _main(): graph_file = open(options.graph_filename, 'r') decision_graph = yaml.safe_load(graph_file) - constants = { - 'bucket_readable': 'TODO', - 'bucket_not_readable': 'TODO', - 'bucket_writable' : 'TODO', - 'bucket_not_writable' : 'TODO', - 'object_readable' : 'TODO', - 'object_not_readable' : 'TODO', - 'object_writable' : 'TODO', - 'object_not_writable' : 'TODO', - } + constants = dict( + bucket_readable='TODO-breadable', + bucket_not_readable='TODO-bnonreadable', + bucket_writable='TODO-bwritable', + bucket_not_writable='TODO-bnonwritable', + object_readable='TODO-oreadable', + object_not_readable='TODO-ononreadable', + object_writable='TODO-owritable', + object_not_writable='TODO-ononwritable', + ) for request_seed in request_seeds: prng = random.Random(request_seed) @@ -255,7 +255,12 @@ def _main(): body = expand(decision, decision['body'], 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: print 'Request generated with seed %d failed:\n%s' % (request_seed, request)