Compare commits

...
Sign in to create a new pull request.

4 commits

Author SHA1 Message Date
Yehuda Sadeh
e6101d8456 Revert "rgw: remove fails_on_dho tags"
This reverts commit 509715810d.
2013-03-01 16:05:06 -08:00
Yehuda Sadeh
7642d5d2bd Revert "rgw: remove more fails_on_dho tags"
This reverts commit efa352711b.
2013-03-01 16:05:05 -08:00
Matthew Wodrich
125fc8bddd generate_objects: use rewind=True in upload_objects
Use the rewind=True argument when uploading objects to make
realistic.py's use of upload_objects compatible with boto>=2.4.1, which
will try to seek to the end of the fp if rewind is not True.
2013-03-01 16:04:35 -08:00
Yehuda Sadeh
e473dd5cb5 test_s3: fix test_list_multipart_upload
test wasn't really testing what it should have

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2013-02-19 17:58:54 -08:00
3 changed files with 62 additions and 2 deletions

View file

@ -278,6 +278,7 @@ def test_object_create_bad_expect_unreadable():
@attr(operation='create w/empty content length')
@attr(assertion='fails 400')
@nose.with_setup(teardown=_clear_custom_headers)
@attr('fails_on_dho')
@attr('fails_on_rgw')
def test_object_create_bad_contentlength_empty():
key = _setup_bad_object({'Content-Length': ''})
@ -293,6 +294,7 @@ def test_object_create_bad_contentlength_empty():
@attr(operation='create w/negative content length')
@attr(assertion='fails 400')
@nose.with_setup(teardown=_clear_custom_headers)
@attr('fails_on_dho')
def test_object_create_bad_contentlength_negative():
key = _setup_bad_object({'Content-Length': -1})
@ -320,6 +322,7 @@ def test_object_create_bad_contentlength_none():
@attr(operation='create w/non-graphic content length')
@attr(assertion='fails 400')
@nose.with_setup(teardown=_clear_custom_headers)
@attr('fails_on_dho')
def test_object_create_bad_contentlength_unreadable():
key = _setup_bad_object({'Content-Length': '\x07'})
@ -400,6 +403,7 @@ def test_object_create_bad_contenttype_none():
@attr(assertion='fails 403')
@nose.with_setup(teardown=_clear_custom_headers)
@attr('fails_on_rgw')
@attr('fails_on_dho')
def test_object_create_bad_contenttype_unreadable():
key = _setup_bad_object({'Content-Type': '\x08'})
@ -460,6 +464,7 @@ def test_object_create_bad_authorization_invalid():
@attr(assertion='fails 403')
@nose.with_setup(teardown=_clear_custom_headers)
@attr('fails_on_rgw')
@attr('fails_on_dho')
def test_object_create_bad_authorization_unreadable():
key = _setup_bad_object({'Authorization': '\x07'})
@ -715,6 +720,7 @@ def _create_new_connection():
@attr(operation='create w/empty content length')
@attr(assertion='fails 400')
@nose.with_setup(teardown=_clear_custom_headers)
@attr('fails_on_dho')
@attr('fails_on_rgw')
def test_bucket_create_bad_contentlength_empty():
conn = _create_new_connection()
@ -731,6 +737,7 @@ def test_bucket_create_bad_contentlength_empty():
@attr(operation='create w/negative content length')
@attr(assertion='fails 400')
@nose.with_setup(teardown=_clear_custom_headers)
@attr('fails_on_dho')
def test_bucket_create_bad_contentlength_negative():
_add_custom_headers({'Content-Length': -1})
e = assert_raises(boto.exception.S3ResponseError, get_new_bucket)
@ -754,6 +761,7 @@ def test_bucket_create_bad_contentlength_none():
@attr(operation='create w/non-graphic content length')
@attr(assertion='fails 400')
@nose.with_setup(teardown=_clear_custom_headers)
@attr('fails_on_dho')
def test_bucket_create_bad_contentlength_unreadable():
_add_custom_headers({'Content-Length': '\x07'})
e = assert_raises(boto.exception.S3ResponseError, get_new_bucket)
@ -814,6 +822,7 @@ def test_bucket_create_bad_authorization_invalid():
@attr(assertion='fails 403')
@nose.with_setup(teardown=_clear_custom_headers)
@attr('fails_on_rgw')
@attr('fails_on_dho')
def test_bucket_create_bad_authorization_unreadable():
_add_custom_headers({'Authorization': '\x07'})
e = assert_raises(boto.exception.S3ResponseError, get_new_bucket)

View file

@ -506,6 +506,7 @@ def test_bucket_list_maxkeys_invalid():
@attr('fails_on_rgw')
@attr('fails_on_dho')
@attr(resource='bucket')
@attr(method='get')
@attr(operation='list all keys')
@ -788,6 +789,7 @@ def test_object_create_unreadable():
key.set_contents_from_string('bar')
@attr('fails_on_dho')
@attr(resource='object')
@attr(method='post')
@attr(operation='delete multiple objects')
@ -1044,6 +1046,7 @@ def _get_post_url(conn, bucket):
@attr(method='post')
@attr(operation='anonymous browser based upload via POST request')
@attr(assertion='succeeds and returns written data')
@attr('fails_on_dho')
def test_post_object_anonymous_request():
bucket = get_new_bucket()
url = _get_post_url(s3.main, bucket)
@ -1063,6 +1066,7 @@ def test_post_object_anonymous_request():
@attr(method='post')
@attr(operation='authenticated browser based upload via POST request')
@attr(assertion='succeeds and returns written data')
@attr('fails_on_dho')
def test_post_object_authenticated_request():
bucket = get_new_bucket()
@ -1101,6 +1105,7 @@ def test_post_object_authenticated_request():
@attr(method='post')
@attr(operation='anonymous browser based upload via POST request')
@attr(assertion='succeeds with status 201')
@attr('fails_on_dho')
def test_post_object_set_success_code():
bucket = get_new_bucket()
bucket.set_acl('public-read-write')
@ -1120,6 +1125,7 @@ def test_post_object_set_success_code():
@attr(method='post')
@attr(operation='anonymous browser based upload via POST request')
@attr(assertion='succeeds with status 204')
@attr('fails_on_dho')
def test_post_object_set_invalid_success_code():
bucket = get_new_bucket()
bucket.set_acl('public-read-write')
@ -1138,6 +1144,7 @@ def test_post_object_set_invalid_success_code():
@attr(method='post')
@attr(operation='authenticated browser based upload via POST request')
@attr(assertion='succeeds and returns written data')
@attr('fails_on_dho')
def test_post_object_upload_larger_than_chunk():
bucket = get_new_bucket()
@ -1178,6 +1185,7 @@ def test_post_object_upload_larger_than_chunk():
@attr(method='post')
@attr(operation='authenticated browser based upload via POST request')
@attr(assertion='succeeds and returns written data')
@attr('fails_on_dho')
def test_post_object_set_key_from_filename():
bucket = get_new_bucket()
@ -1216,6 +1224,7 @@ def test_post_object_set_key_from_filename():
@attr(method='post')
@attr(operation='authenticated browser based upload via POST request')
@attr(assertion='succeeds with status 204')
@attr('fails_on_dho')
def test_post_object_ignored_header():
bucket = get_new_bucket()
@ -1251,6 +1260,7 @@ def test_post_object_ignored_header():
@attr(method='post')
@attr(operation='authenticated browser based upload via POST request')
@attr(assertion='succeeds with status 204')
@attr('fails_on_dho')
def test_post_object_case_insensitive_condition_fields():
bucket = get_new_bucket()
@ -1286,6 +1296,7 @@ def test_post_object_case_insensitive_condition_fields():
@attr(method='post')
@attr(operation='authenticated browser based upload via POST request')
@attr(assertion='succeeds with escaped leading $ and returns written data')
@attr('fails_on_dho')
def test_post_object_escaped_field_values():
bucket = get_new_bucket()
@ -1324,6 +1335,7 @@ def test_post_object_escaped_field_values():
@attr(method='post')
@attr(operation='authenticated browser based upload via POST request')
@attr(assertion='succeeds and returns redirect url')
@attr('fails_on_dho')
def test_post_object_success_redirect_action():
bucket = get_new_bucket()
@ -1368,6 +1380,7 @@ def test_post_object_success_redirect_action():
@attr(method='post')
@attr(operation='authenticated browser based upload via POST request')
@attr(assertion='fails with invalid signature error')
@attr('fails_on_dho')
def test_post_object_invalid_signature():
bucket = get_new_bucket()
@ -1403,6 +1416,7 @@ def test_post_object_invalid_signature():
@attr(method='post')
@attr(operation='authenticated browser based upload via POST request')
@attr(assertion='fails with access key does not exist error')
@attr('fails_on_dho')
def test_post_object_invalid_access_key():
bucket = get_new_bucket()
@ -1438,6 +1452,7 @@ def test_post_object_invalid_access_key():
@attr(method='post')
@attr(operation='authenticated browser based upload via POST request')
@attr(assertion='fails with invalid expiration error')
@attr('fails_on_dho')
def test_post_object_invalid_date_format():
bucket = get_new_bucket()
@ -1473,6 +1488,7 @@ def test_post_object_invalid_date_format():
@attr(method='post')
@attr(operation='authenticated browser based upload via POST request')
@attr(assertion='fails with missing key error')
@attr('fails_on_dho')
def test_post_object_no_key_specified():
bucket = get_new_bucket()
@ -1507,6 +1523,7 @@ def test_post_object_no_key_specified():
@attr(method='post')
@attr(operation='authenticated browser based upload via POST request')
@attr(assertion='fails with missing signature error')
@attr('fails_on_dho')
def test_post_object_missing_signature():
bucket = get_new_bucket()
@ -1542,6 +1559,7 @@ def test_post_object_missing_signature():
@attr(method='post')
@attr(operation='authenticated browser based upload via POST request')
@attr(assertion='fails with extra input fields policy error')
@attr('fails_on_dho')
def test_post_object_missing_policy_condition():
bucket = get_new_bucket()
@ -1576,6 +1594,7 @@ def test_post_object_missing_policy_condition():
@attr(method='post')
@attr(operation='authenticated browser based upload via POST request')
@attr(assertion='succeeds using starts-with restriction on metadata header')
@attr('fails_on_dho')
def test_post_object_user_specified_header():
bucket = get_new_bucket()
@ -1614,6 +1633,7 @@ def test_post_object_user_specified_header():
@attr(method='post')
@attr(operation='authenticated browser based upload via POST request')
@attr(assertion='fails with policy condition failed error due to missing field in POST request')
@attr('fails_on_dho')
def test_post_object_request_missing_policy_specified_field():
bucket = get_new_bucket()
@ -1650,6 +1670,7 @@ def test_post_object_request_missing_policy_specified_field():
@attr(method='post')
@attr(operation='authenticated browser based upload via POST request')
@attr(assertion='fails with conditions must be list error')
@attr('fails_on_dho')
def test_post_object_condition_is_case_sensitive():
bucket = get_new_bucket()
@ -1685,6 +1706,7 @@ def test_post_object_condition_is_case_sensitive():
@attr(method='post')
@attr(operation='authenticated browser based upload via POST request')
@attr(assertion='fails with expiration must be string error')
@attr('fails_on_dho')
def test_post_object_expires_is_case_sensitive():
bucket = get_new_bucket()
@ -1720,6 +1742,7 @@ def test_post_object_expires_is_case_sensitive():
@attr(method='post')
@attr(operation='authenticated browser based upload via POST request')
@attr(assertion='fails with policy expired error')
@attr('fails_on_dho')
def test_post_object_expired_policy():
bucket = get_new_bucket()
@ -1755,6 +1778,7 @@ def test_post_object_expired_policy():
@attr(method='post')
@attr(operation='authenticated browser based upload via POST request')
@attr(assertion='fails using equality restriction on metadata header')
@attr('fails_on_dho')
def test_post_object_invalid_request_field_value():
bucket = get_new_bucket()
@ -1791,6 +1815,7 @@ def test_post_object_invalid_request_field_value():
@attr(method='post')
@attr(operation='authenticated browser based upload via POST request')
@attr(assertion='fails with policy missing expiration error')
@attr('fails_on_dho')
def test_post_object_missing_expires_condition():
bucket = get_new_bucket()
@ -1826,6 +1851,7 @@ def test_post_object_missing_expires_condition():
@attr(method='post')
@attr(operation='authenticated browser based upload via POST request')
@attr(assertion='fails with policy missing conditions error')
@attr('fails_on_dho')
def test_post_object_missing_conditions_list():
bucket = get_new_bucket()
@ -1854,6 +1880,7 @@ def test_post_object_missing_conditions_list():
@attr(method='post')
@attr(operation='authenticated browser based upload via POST request')
@attr(assertion='fails with allowable upload size exceeded error')
@attr('fails_on_dho')
def test_post_object_upload_size_limit_exceeded():
bucket = get_new_bucket()
@ -1889,6 +1916,7 @@ def test_post_object_upload_size_limit_exceeded():
@attr(method='post')
@attr(operation='authenticated browser based upload via POST request')
@attr(assertion='fails with invalid content length error')
@attr('fails_on_dho')
def test_post_object_missing_content_length_argument():
bucket = get_new_bucket()
@ -1924,6 +1952,7 @@ def test_post_object_missing_content_length_argument():
@attr(method='post')
@attr(operation='authenticated browser based upload via POST request')
@attr(assertion='fails with invalid JSON error')
@attr('fails_on_dho')
def test_post_object_invalid_content_length_argument():
bucket = get_new_bucket()
@ -1959,6 +1988,7 @@ def test_post_object_invalid_content_length_argument():
@attr(method='post')
@attr(operation='authenticated browser based upload via POST request')
@attr(assertion='fails with upload size less than minimum allowable error')
@attr('fails_on_dho')
def test_post_object_upload_size_below_minimum():
bucket = get_new_bucket()
@ -2122,6 +2152,7 @@ def _head_bucket(bucket, authenticated=True):
@attr(method='head')
@attr(operation='head bucket')
@attr(assertion='succeeds')
@attr('fails_on_dho')
def test_bucket_head():
bucket = _setup_bucket_request('private')
@ -2132,6 +2163,7 @@ def test_bucket_head():
@attr(method='head')
@attr(operation='read bucket extended information')
@attr(assertion='extended information is getting updated')
@attr('fails_on_dho')
def test_bucket_head_extended():
bucket = _setup_bucket_request('private')
@ -2189,6 +2221,7 @@ def test_object_raw_authenticated():
@attr(method='get')
@attr(operation='authenticated on private bucket/private object with modified response headers')
@attr(assertion='succeeds')
@attr('fails_on_dho')
@attr('fails_on_rgw')
def test_object_raw_response_headers():
(bucket, key) = _setup_request('private', 'private')
@ -3297,6 +3330,7 @@ def test_bucket_acl_no_grants():
@attr(method='ACLs')
@attr(operation='add second FULL_CONTROL user')
@attr(assertion='works for S3, fails for DHO')
@attr('fails_on_dho')
def test_bucket_acl_grant_email():
bucket = get_new_bucket()
# add alt user
@ -3368,6 +3402,7 @@ def test_bucket_acl_revoke_all():
@attr(operation='set/enable/disable logging target')
@attr(assertion='operations succeed')
@attr('fails_on_rgw')
@attr('fails_on_dho')
def test_logging_toggle():
bucket = get_new_bucket()
log_bucket = s3.main.create_bucket(bucket.name + '-log')
@ -3693,6 +3728,7 @@ def test_bucket_recreate_not_overriding():
@attr(method='put')
@attr(operation='create and list objects with special names')
@attr(assertion='special names work')
@attr('fails_on_dho')
def test_bucket_create_special_key_names():
key_names = [' ', '%', '_', '_ ', '_ _', '__']
bucket = _create_keys(keys=key_names)
@ -3731,6 +3767,7 @@ def test_object_copy_same_bucket():
@attr(method='put')
@attr(operation='copy object to itself')
@attr(assertion='fails')
@attr('fails_on_dho')
def test_object_copy_to_itself():
bucket = get_new_bucket()
key = bucket.new_key('foo123bar')
@ -3744,6 +3781,7 @@ def test_object_copy_to_itself():
@attr(method='put')
@attr(operation='modify object metadata by copying')
@attr(assertion='fails')
@attr('fails_on_dho')
def test_object_copy_to_itself_with_metadata():
bucket = get_new_bucket()
key = bucket.new_key('foo123bar')
@ -3789,6 +3827,7 @@ def test_object_copy_not_owned_bucket():
@attr(method='put')
@attr(operation='copy object and change acl')
@attr(assertion='works')
@attr('fails_on_dho')
def test_object_copy_canned_acl():
bucket = get_new_bucket()
key = bucket.new_key('foo123bar')
@ -3889,11 +3928,22 @@ def test_list_multipart_upload():
bucket = get_new_bucket()
key="mymultipart"
upload1 = _multipart_upload(bucket, key, 5, 1)
upload2 = _multipart_upload(bucket, key, 5, 1)
upload2 = _multipart_upload(bucket, key, 6, 1)
key2="mymultipart2"
upload3 = _multipart_upload(bucket, key2, 5, 1)
l = bucket.list_multipart_uploads()
l = list(l)
index = dict([(key, 2), (key2, 1)])
for upload in l:
index[upload.key_name] -= 1;
for k, c in index.items():
eq(c, 0)
upload1.cancel_upload()
upload2.cancel_upload()
upload3.cancel_upload()
@ -4217,6 +4267,7 @@ def test_atomic_dual_write_8mb():
@attr(operation='write file in deleted bucket')
@attr(assertion='fail 404')
@attr('fails_on_aws')
@attr('fails_on_dho')
def test_atomic_write_bucket_gone():
bucket = get_new_bucket()

View file

@ -46,7 +46,7 @@ def upload_objects(bucket, files, seed):
print >> sys.stderr, 'sending file with size %dB' % fp.size
key = Key(bucket)
key.key = name_generator.next()
key.set_contents_from_file(fp)
key.set_contents_from_file(fp, rewind=True)
key.set_acl('public-read')
keys.append(key)