]> git-server-git.apps.pok.os.sepia.ceph.com Git - s3-tests.git/commitdiff
Add test for muiltpart copy without 'x-amz-copy-source-range' header 205/head
authorMalcolm Lee <fengxueyu35@126.com>
Wed, 24 Jan 2018 05:55:53 +0000 (13:55 +0800)
committerMalcolm Lee <fengxueyu35@126.com>
Wed, 24 Jan 2018 05:56:02 +0000 (13:56 +0800)
s3tests/functional/test_s3.py

index 45a70c34af921c7202f9398764c6c7197c45c751..425d913d3bfe0fe92cd8bd10291c7f5f09c5f0bf 100644 (file)
@@ -5397,6 +5397,25 @@ def test_multipart_copy_invalid_range():
     # no standard error code defined 
     # eq(e.error_code, 'InvalidArgument')
 
+@attr(resource='object')
+@attr(method='put')
+@attr(operation='check multipart copies without x-amz-copy-source-range')
+def test_multipart_copy_without_range():
+    (src_bucket, src_key) = _create_key_with_random_content('source', size=10)
+    dst_bucket = get_new_bucket()
+    dst_keyname = "mymultipartcopy"
+
+    upload = dst_bucket.initiate_multipart_upload(dst_keyname)
+    # MultiPartUpload.copy_part_from_key() always add "x-amz-copy-source-range" in header
+    # So we can use copy_key() with query_args
+    query_args = 'uploadId=%s&partNumber=%d' % (upload.id, 1)
+    dst_bucket.copy_key(dst_keyname, src_bucket.name, src_key.name, query_args=query_args)
+    upload.complete_upload()
+
+    key2 = dst_bucket.get_key(dst_keyname)
+    eq(key2.size, 10)
+    _check_key_content(src_key, key2)
+
 @attr(resource='object')
 @attr(method='put')
 @attr(operation='check multipart copies with single small part')