]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
qa/cephfs: improve caps_helper.CapTester
authorRishabh Dave <ridave@redhat.com>
Fri, 31 Mar 2023 19:14:52 +0000 (00:44 +0530)
committerRishabh Dave <ridave@redhat.com>
Tue, 18 Apr 2023 14:12:55 +0000 (19:42 +0530)
commit008dbe91e2994a654cba37e07ca6a9ae7c98fa2f
tree6a84d2ebbf57262815cbd5edd1b604ca9e7c6e2e
parente8bdf94b814eb09f859e6d1e31d53e826a7bffcc
qa/cephfs: improve caps_helper.CapTester

Improvement #1:

CapTester.write_test_files() not only creates the test file but also
does the following for every mount object it receives in parameters -

* carefully produces the path for the test file as per parameters
  received
* generates the unique data for each test file on a CephFS mount
* creates a data structure -- list of lists -- that holds all this
  information along with mount object itself for each mount object so
  that tests can be conducted at a later point

Untangle this mess of code by splitting this method into 3 separate
methods -

1. To produce the path for test file (as per user's need).
2. To generate the data that will be written into the test file.
3. To actually create the test file on CephFS.

Improvement #2:

Remove the internal data structure used for testing -- self.test_set --
and use separate class attributes to store all the data required for
testing instead of a tuple. This serves two purpose -

One, it makes it easy to manipulate all this data from helper methods
and during debugging session, especially while using a PDB session.

And two, make it impossible to have multiple mounts/multiple "test sets"
within same CapTester instance for the sake of simplicity. Users can
instead create two instances of CapTester instances if needed.

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