]> git-server-git.apps.pok.os.sepia.ceph.com Git - s3-tests.git/commitdiff
Test begin to overwrite file with MPU then abort 89/head
authorAndrew Gaul <andrew@gaul.org>
Fri, 18 Dec 2015 20:12:59 +0000 (12:12 -0800)
committerAndrew Gaul <andrew@gaul.org>
Fri, 18 Dec 2015 20:16:59 +0000 (12:16 -0800)
Signed-off-by: Andrew Gaul <andrew@gaul.org>
s3tests/functional/test_s3.py

index 0040e43f41f62bb5e17cd9e5ecfcad94b93faf9b..31002d0a76d710a70cd810ee58d72adc7d070fa9 100644 (file)
@@ -5671,6 +5671,27 @@ def test_atomic_write_bucket_gone():
     eq(e.reason, 'Not Found')
     eq(e.error_code, 'NoSuchBucket')
 
+@attr(resource='object')
+@attr(method='put')
+@attr(operation='begin to overwrite file with multipart upload then abort')
+@attr(assertion='read back original key contents')
+def test_atomic_multipart_upload_write():
+    bucket = get_new_bucket()
+    key = bucket.new_key('foo')
+    key.set_contents_from_string('bar')
+
+    upload = bucket.initiate_multipart_upload(key)
+
+    key = bucket.get_key('foo')
+    got = key.get_contents_as_string()
+    eq(got, 'bar')
+
+    upload.cancel_upload()
+
+    key = bucket.get_key('foo')
+    got = key.get_contents_as_string()
+    eq(got, 'bar')
+
 @attr(resource='object')
 @attr(method='get')
 @attr(operation='range')