]> git.apps.os.sepia.ceph.com Git - ceph-ci.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>
Sat, 6 Apr 2024 10:14:16 +0000 (15:44 +0530)
commitf580c2b4d2d3f68c14848ad68608aaa1c507e9b6
tree9915e6b3e137c592209f71b5474735c4bed78635
parent35f01db11076fdf9590c340124af7816e10ad396
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>
(cherry picked from commit 008dbe91e2994a654cba37e07ca6a9ae7c98fa2f)

Conflicts:
  qa/tasks/cephfs/caps_helper.py
  - Conflict occurred because this file went under modification due to
    commit 59c9104c54d6.
  qa/tasks/cephfs/test_admin.py
  - Conflict occurred because code region located around the patch has
    changed.
qa/tasks/cephfs/caps_helper.py
qa/tasks/cephfs/test_admin.py
qa/tasks/cephfs/test_multifs_auth.py