]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/cephfs: return size of data generated in _do_subvolume_io()
authorRishabh Dave <ridave@redhat.com>
Tue, 21 May 2024 13:23:12 +0000 (18:53 +0530)
committerRishabh Dave <ridave@redhat.com>
Wed, 14 Aug 2024 09:35:46 +0000 (15:05 +0530)
TestVolumesHelper._do_subvolume_io() is a helper method that allows
users to generate data for testing. mgr/vol code that reports progress
made by clone jobs depends on the value set for xattr rbytes. It takes
a bit of a time for rbytes to be set.

And, therefore, all tests in TestCloneProgressReporter needs to wait for
subvolume's rbytes xattr's value to be set to the actual amount of data
present on the subvolume before proceeding to actually testing.

So that this can be achieved make _do_subvolume_io() return size of the
data it has generated.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
qa/tasks/cephfs/test_volumes.py

index ef33e96e21b82cd8d92609350bbb013bb3144027..4b1914a55714ca766b9d29b6734e5530d6405380 100644 (file)
@@ -305,6 +305,8 @@ class TestVolumesHelper(CephFSTestCase):
             filename = "{0}.{1}".format(TestVolumes.TEST_FILE_NAME_PREFIX, i)
             self.mount_a.write_n_mb(os.path.join(io_path, filename), file_size)
 
+        return number_of_files * file_size * 1024 * 1024
+
     def _do_subvolume_io_mixed(self, subvolume, subvolume_group=None):
         subvolpath = self._get_subvolume_path(self.volname, subvolume, group_name=subvolume_group)