mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-22 09:29:43 +00:00
s3tests: adjust copy tests to test copy of larger objects
rgw has different code paths for objects > 512k Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
This commit is contained in:
parent
226f5eb507
commit
5407628c3a
1 changed files with 28 additions and 26 deletions
|
@ -4484,6 +4484,7 @@ def test_object_copy_canned_acl():
|
||||||
@attr(method='put')
|
@attr(method='put')
|
||||||
@attr(operation='copy object and retain metadata')
|
@attr(operation='copy object and retain metadata')
|
||||||
def test_object_copy_retaining_metadata():
|
def test_object_copy_retaining_metadata():
|
||||||
|
for size in [3, 1024 * 1024]:
|
||||||
bucket = get_new_bucket()
|
bucket = get_new_bucket()
|
||||||
key = bucket.new_key('foo123bar')
|
key = bucket.new_key('foo123bar')
|
||||||
metadata = {'key1': 'value1', 'key2': 'value2'}
|
metadata = {'key1': 'value1', 'key2': 'value2'}
|
||||||
|
@ -4491,11 +4492,11 @@ def test_object_copy_retaining_metadata():
|
||||||
key.set_metadata('key2', 'value2')
|
key.set_metadata('key2', 'value2')
|
||||||
content_type = 'audio/ogg'
|
content_type = 'audio/ogg'
|
||||||
key.content_type = content_type
|
key.content_type = content_type
|
||||||
key.set_contents_from_string('foo')
|
key.set_contents_from_string(str(bytearray(size)))
|
||||||
|
|
||||||
bucket.copy_key('bar321foo', bucket.name, 'foo123bar')
|
bucket.copy_key('bar321foo', bucket.name, 'foo123bar')
|
||||||
key2 = bucket.get_key('bar321foo')
|
key2 = bucket.get_key('bar321foo')
|
||||||
eq(key2.size, 3)
|
eq(key2.size, size)
|
||||||
eq(key2.metadata, metadata)
|
eq(key2.metadata, metadata)
|
||||||
eq(key2.content_type, content_type)
|
eq(key2.content_type, content_type)
|
||||||
|
|
||||||
|
@ -4503,18 +4504,19 @@ def test_object_copy_retaining_metadata():
|
||||||
@attr(method='put')
|
@attr(method='put')
|
||||||
@attr(operation='copy object and replace metadata')
|
@attr(operation='copy object and replace metadata')
|
||||||
def test_object_copy_replacing_metadata():
|
def test_object_copy_replacing_metadata():
|
||||||
|
for size in [3, 1024 * 1024]:
|
||||||
bucket = get_new_bucket()
|
bucket = get_new_bucket()
|
||||||
key = bucket.new_key('foo123bar')
|
key = bucket.new_key('foo123bar')
|
||||||
key.set_metadata('key1', 'value1')
|
key.set_metadata('key1', 'value1')
|
||||||
key.set_metadata('key2', 'value2')
|
key.set_metadata('key2', 'value2')
|
||||||
key.content_type = 'audio/ogg'
|
key.content_type = 'audio/ogg'
|
||||||
key.set_contents_from_string('foo')
|
key.set_contents_from_string(str(bytearray(size)))
|
||||||
|
|
||||||
metadata = {'key3': 'value3', 'key1': 'value4'}
|
metadata = {'key3': 'value3', 'key1': 'value4'}
|
||||||
content_type = 'audio/mpeg'
|
content_type = 'audio/mpeg'
|
||||||
bucket.copy_key('bar321foo', bucket.name, 'foo123bar', metadata=metadata, headers={'Content-Type': content_type})
|
bucket.copy_key('bar321foo', bucket.name, 'foo123bar', metadata=metadata, headers={'Content-Type': content_type})
|
||||||
key2 = bucket.get_key('bar321foo')
|
key2 = bucket.get_key('bar321foo')
|
||||||
eq(key2.size, 3)
|
eq(key2.size, size)
|
||||||
eq(key2.metadata, metadata)
|
eq(key2.metadata, metadata)
|
||||||
eq(key2.content_type, content_type)
|
eq(key2.content_type, content_type)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue