]> git-server-git.apps.pok.os.sepia.ceph.com Git - s3-tests.git/commitdiff
s3tests: Test copying foreign object in foreign bucket 56/head
authorJavier M. Mellid <jmunhoz@igalia.com>
Wed, 27 May 2015 09:27:08 +0000 (11:27 +0200)
committerJavier M. Mellid <jmunhoz@igalia.com>
Wed, 27 May 2015 09:31:43 +0000 (11:31 +0200)
User should be able to copy non-owned objects inside non-owned buckets when
they have full permissions to both bucket and object.

Test for issue #11639

Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
s3tests/functional/test_s3.py

index f193630486aeca37f5d74f9c37ca9b452534de20..59b5ba84767b731612611384fb571fb39e040ed7 100644 (file)
@@ -4447,6 +4447,18 @@ def test_object_copy_not_owned_bucket():
     except AttributeError:
         pass
 
+@attr(resource='object')
+@attr(method='put')
+@attr(operation='copy a non-owned object in a non-owned bucket, but with perms')
+@attr(assertion='works')
+def test_object_copy_not_owned_object_bucket():
+    bucket = get_new_bucket(targets.main.default)
+    key = bucket.new_key('foo123bar')
+    key.set_contents_from_string('foo')
+    bucket.add_user_grant(permission='FULL_CONTROL', user_id=config.alt.user_id, recursive=True)
+    k2 = s3.alt.get_bucket(bucket.name).get_key('foo123bar')
+    k2.copy(bucket.name, 'bar321foo')
+
 @attr(resource='object')
 @attr(method='put')
 @attr(operation='copy object and change acl')