Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag versioning tests #582

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions s3tests_boto3/functional/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -1413,6 +1413,7 @@ def test_bucket_list_return_data():


@pytest.mark.fails_on_dbstore
@pytest.mark.versioning
def test_bucket_list_return_data_versioning():
bucket_name = get_new_bucket()
check_configure_versioning_retry(bucket_name, "Enabled", "Enabled")
Expand Down Expand Up @@ -1639,6 +1640,7 @@ def _make_objs_dict(key_names):
objs_dict = {'Objects': objs_list}
return objs_dict

@pytest.mark.versioning
def test_versioning_concurrent_multi_object_delete():
num_objects = 5
num_threads = 5
Expand Down Expand Up @@ -5603,6 +5605,7 @@ def test_object_copy_key_not_found():
assert status == 404

@pytest.mark.fails_on_dbstore
@pytest.mark.versioning
def test_object_copy_versioned_bucket():
bucket_name = get_new_bucket()
client = get_client()
Expand Down Expand Up @@ -5667,6 +5670,7 @@ def test_object_copy_versioned_bucket():
assert size == response['ContentLength']

@pytest.mark.fails_on_dbstore
@pytest.mark.versioning
def test_object_copy_versioned_url_encoding():
bucket = get_new_bucket_resource()
check_configure_versioning_retry(bucket.name, "Enabled", "Enabled")
Expand Down Expand Up @@ -5730,6 +5734,7 @@ def _multipart_upload(bucket_name, key, size, part_size=5*1024*1024, client=None
return (upload_id, s, parts)

@pytest.mark.fails_on_dbstore
@pytest.mark.versioning
def test_object_copy_versioning_multipart_upload():
bucket_name = get_new_bucket()
client = get_client()
Expand Down Expand Up @@ -6078,6 +6083,7 @@ def check_configure_versioning_retry(bucket_name, status, expected_string):
assert expected_string == read_status

@pytest.mark.fails_on_dbstore
@pytest.mark.versioning
def test_multipart_copy_versioned():
src_bucket_name = get_new_bucket()
dest_bucket_name = get_new_bucket()
Expand Down Expand Up @@ -7321,6 +7327,7 @@ def test_ranged_request_empty_object():
assert status == 416
assert error_code == 'InvalidRange'

@pytest.mark.versioning
def test_versioning_bucket_create_suspend():
bucket_name = get_new_bucket()
check_versioning(bucket_name, None)
Expand Down Expand Up @@ -7404,6 +7411,7 @@ def _do_test_create_remove_versions(client, bucket_name, key, num_versions, remo
print(response['Versions'])


@pytest.mark.versioning
def test_versioning_obj_create_read_remove():
bucket_name = get_new_bucket()
client = get_client()
Expand All @@ -7418,6 +7426,7 @@ def test_versioning_obj_create_read_remove():
_do_test_create_remove_versions(client, bucket_name, key, num_versions, 4, -1)
_do_test_create_remove_versions(client, bucket_name, key, num_versions, 3, 3)

@pytest.mark.versioning
def test_versioning_obj_create_read_remove_head():
bucket_name = get_new_bucket()

Expand Down Expand Up @@ -7452,6 +7461,7 @@ def test_versioning_obj_create_read_remove_head():

clean_up_bucket(client, bucket_name, key, version_ids)

@pytest.mark.versioning
def test_versioning_obj_plain_null_version_removal():
bucket_name = get_new_bucket()
check_versioning(bucket_name, None)
Expand All @@ -7472,6 +7482,7 @@ def test_versioning_obj_plain_null_version_removal():
response = client.list_object_versions(Bucket=bucket_name)
assert not 'Versions' in response

@pytest.mark.versioning
def test_versioning_obj_plain_null_version_overwrite():
bucket_name = get_new_bucket()
check_versioning(bucket_name, None)
Expand Down Expand Up @@ -7505,6 +7516,7 @@ def test_versioning_obj_plain_null_version_overwrite():
response = client.list_object_versions(Bucket=bucket_name)
assert not 'Versions' in response

@pytest.mark.versioning
def test_versioning_obj_plain_null_version_overwrite_suspended():
bucket_name = get_new_bucket()
check_versioning(bucket_name, None)
Expand Down Expand Up @@ -7570,6 +7582,7 @@ def overwrite_suspended_versioning_obj(client, bucket_name, key, version_ids, co
return (version_ids, contents)


@pytest.mark.versioning
def test_versioning_obj_suspend_versions():
bucket_name = get_new_bucket()
client = get_client()
Expand Down Expand Up @@ -7603,6 +7616,7 @@ def test_versioning_obj_suspend_versions():
assert len(version_ids) == len(contents)

@pytest.mark.fails_on_dbstore
@pytest.mark.versioning
def test_versioning_obj_suspended_copy():
bucket_name = get_new_bucket()
client = get_client()
Expand Down Expand Up @@ -7637,6 +7651,7 @@ def test_versioning_obj_suspended_copy():

clean_up_bucket(client, bucket_name, key1, version_ids)

@pytest.mark.versioning
def test_versioning_obj_create_versions_remove_all():
bucket_name = get_new_bucket()
client = get_client()
Expand All @@ -7653,6 +7668,7 @@ def test_versioning_obj_create_versions_remove_all():
assert len(version_ids) == 0
assert len(version_ids) == len(contents)

@pytest.mark.versioning
def test_versioning_obj_create_versions_remove_special_names():
bucket_name = get_new_bucket()
client = get_client()
Expand All @@ -7671,6 +7687,7 @@ def test_versioning_obj_create_versions_remove_special_names():
assert len(version_ids) == len(contents)

@pytest.mark.fails_on_dbstore
@pytest.mark.versioning
def test_versioning_obj_create_overwrite_multipart():
bucket_name = get_new_bucket()
client = get_client()
Expand Down Expand Up @@ -7699,6 +7716,7 @@ def test_versioning_obj_create_overwrite_multipart():
assert len(version_ids) == 0
assert len(version_ids) == len(contents)

@pytest.mark.versioning
def test_versioning_obj_list_marker():
bucket_name = get_new_bucket()
client = get_client()
Expand Down Expand Up @@ -7755,6 +7773,7 @@ def test_versioning_obj_list_marker():
i += 1

@pytest.mark.fails_on_dbstore
@pytest.mark.versioning
def test_versioning_copy_obj_version():
bucket_name = get_new_bucket()
client = get_client()
Expand Down Expand Up @@ -7792,6 +7811,7 @@ def test_versioning_copy_obj_version():
body = _get_body(response)
assert body == contents[-1]

@pytest.mark.versioning
def test_versioning_multi_object_delete():
bucket_name = get_new_bucket()
client = get_client()
Expand All @@ -7817,6 +7837,7 @@ def test_versioning_multi_object_delete():
response = client.list_object_versions(Bucket=bucket_name)
assert not 'Versions' in response

@pytest.mark.versioning
def test_versioning_multi_object_delete_with_marker():
bucket_name = get_new_bucket()
client = get_client()
Expand Down Expand Up @@ -7850,6 +7871,7 @@ def test_versioning_multi_object_delete_with_marker():
assert not 'DeleteMarkers' in response

@pytest.mark.fails_on_dbstore
@pytest.mark.versioning
def test_versioning_multi_object_delete_with_marker_create():
bucket_name = get_new_bucket()
client = get_client()
Expand All @@ -7871,6 +7893,7 @@ def test_versioning_multi_object_delete_with_marker_create():
assert delete_marker_version_id == delete_markers[0]['VersionId']
assert key == delete_markers[0]['Key']

@pytest.mark.versioning
def test_versioned_object_acl():
bucket_name = get_new_bucket()
client = get_client()
Expand Down Expand Up @@ -7939,6 +7962,7 @@ def test_versioned_object_acl():
check_grants(grants, default_policy)

@pytest.mark.fails_on_dbstore
@pytest.mark.versioning
def test_versioned_object_acl_no_version_specified():
bucket_name = get_new_bucket()
client = get_client()
Expand Down Expand Up @@ -8027,6 +8051,7 @@ def _do_clear_versioned_bucket_concurrent(client, bucket_name):

# TODO: remove fails_on_rgw when https://tracker.ceph.com/issues/39142 is resolved
@pytest.mark.fails_on_rgw
@pytest.mark.versioning
def test_versioned_concurrent_object_create_concurrent_remove():
bucket_name = get_new_bucket()
client = get_client()
Expand All @@ -8051,6 +8076,7 @@ def test_versioned_concurrent_object_create_concurrent_remove():
response = client.list_object_versions(Bucket=bucket_name)
assert not 'Versions' in response

@pytest.mark.versioning
def test_versioned_concurrent_object_create_and_remove():
bucket_name = get_new_bucket()
client = get_client()
Expand Down Expand Up @@ -11154,6 +11180,7 @@ def test_delete_tags_obj_public():
response = client.get_object_tagging(Bucket=bucket_name, Key=key)
assert len(response['TagSet']) == 0

@pytest.mark.versioning
def test_versioning_bucket_atomic_upload_return_version_id():
bucket_name = get_new_bucket()
client = get_client()
Expand Down Expand Up @@ -11183,6 +11210,7 @@ def test_versioning_bucket_atomic_upload_return_version_id():
response = client.put_object(Bucket=bucket_name, Key=key)
assert not 'VersionId' in response

@pytest.mark.versioning
def test_versioning_bucket_multipart_upload_return_version_id():
content_type='text/bla'
objlen = 30 * 1024 * 1024
Expand Down