summaryrefslogtreecommitdiffstats
path: root/src/test/rgw
diff options
context:
space:
mode:
authorCasey Bodley <cbodley@redhat.com>2017-10-12 01:27:55 +0200
committerCasey Bodley <cbodley@redhat.com>2017-10-12 01:27:55 +0200
commit1c14d4daf9201d58b1d0038bdd733a16275e037a (patch)
treef20e92f88e0d522085288b17b099dee1fdb9a386 /src/test/rgw
parentMerge pull request #17824 from shashalu/fix-lc-expiration (diff)
downloadceph-1c14d4daf9201d58b1d0038bdd733a16275e037a.tar.xz
ceph-1c14d4daf9201d58b1d0038bdd733a16275e037a.zip
test/rgw: add test_multipart_object_sync
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Diffstat (limited to 'src/test/rgw')
-rw-r--r--src/test/rgw/rgw_multi/tests.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/rgw/rgw_multi/tests.py b/src/test/rgw/rgw_multi/tests.py
index 0109a02138d..61e531af92c 100644
--- a/src/test/rgw/rgw_multi/tests.py
+++ b/src/test/rgw/rgw_multi/tests.py
@@ -10,6 +10,7 @@ try:
except ImportError:
from itertools import zip_longest
from itertools import combinations
+from cStringIO import StringIO
import boto
import boto.s3.connection
@@ -931,6 +932,27 @@ def test_bucket_sync_disable_enable():
for bucket_name in buckets:
zonegroup_bucket_checkpoint(zonegroup_conns, bucket_name)
+def test_multipart_object_sync():
+ zonegroup = realm.master_zonegroup()
+ zonegroup_conns = ZonegroupConns(zonegroup)
+ buckets, zone_bucket = create_bucket_per_zone(zonegroup_conns)
+
+ _, bucket = zone_bucket[0]
+
+ # initiate a multipart upload
+ upload = bucket.initiate_multipart_upload('MULTIPART')
+ mp = boto.s3.multipart.MultiPartUpload(bucket)
+ mp.key_name = upload.key_name
+ mp.id = upload.id
+ part_size = 5 * 1024 * 1024 # 5M min part size
+ mp.upload_part_from_file(StringIO('a' * part_size), 1)
+ mp.upload_part_from_file(StringIO('b' * part_size), 2)
+ mp.upload_part_from_file(StringIO('c' * part_size), 3)
+ mp.upload_part_from_file(StringIO('d' * part_size), 4)
+ mp.complete_upload()
+
+ zonegroup_bucket_checkpoint(zonegroup_conns, bucket.name)
+
def test_encrypted_object_sync():
zonegroup = realm.master_zonegroup()
zonegroup_conns = ZonegroupConns(zonegroup)