Skip to content

Commit

Permalink
qa/ceph-volume: add a test for put_object_versioned()
Browse files Browse the repository at this point in the history
Test if the version passed to put_object_versioned() is used to
crosscheck.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
(cherry picked from commit 8ab6f84)
  • Loading branch information
rishabh-d-dave authored and smithfarm committed Sep 2, 2018
1 parent 735b855 commit 983a199
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions qa/tasks/cephfs/test_volume_client.py
Expand Up @@ -970,6 +970,27 @@ def test_get_object(self):
obj_data = obj_data
)))

def test_put_object_versioned(self):
vc_mount = self.mounts[1]
vc_mount.umount_wait()
self._configure_vc_auth(vc_mount, "manila")

obj_data = 'test_data'
obj_name = 'test_vc_ob_2'
pool_name = self.fs.get_data_pool_names()[0]
self.fs.rados(['put', obj_name, '-'], pool=pool_name, stdin_data=obj_data)

# Test if put_object_versioned() crosschecks the version of the
# given object. Being a negative test, an exception is expected.
with self.assertRaises(CommandFailedError):
self._volume_client_python(vc_mount, dedent("""
data, version = vc.get_object_and_version("{pool_name}", "{obj_name}")
data += 'm1'
vc.put_object("{pool_name}", "{obj_name}", data)
data += 'm2'
vc.put_object_versioned("{pool_name}", "{obj_name}", data, version)
""").format(pool_name=pool_name, obj_name=obj_name))

def test_delete_object(self):
vc_mount = self.mounts[1]
vc_mount.umount_wait()
Expand Down

0 comments on commit 983a199

Please sign in to comment.