1
0
mirror of https://github.com/ceph/ceph synced 2025-04-27 13:19:00 +00:00
Commit Graph

14 Commits

Author SHA1 Message Date
Rishabh Dave
34e94e9ae5 qa/cephfs: refactor and upgrade test_single_path_rootsquash
test_single_path_rootsquash instead of using helper methods duplicates
the code from those methods. This commit fixes that and also upgrade
this method since caps_helper was upgraded in previous commits.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2022-07-21 17:53:16 +05:30
Rishabh Dave
f11a757b78 qa/cephfs: add log entries for caps_helper.py
The intention is to make logs contain some information of what's being
done by caps_helper.py regardless of which test/method is calling it.
This should make logs more understandable and also add hints for
future debugging.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2022-07-21 17:53:16 +05:30
Rishabh Dave
463c9e1714 qa/cephfs: upgrade caps_helper.CapTester.run_mon_cap_tests()
With this commit, the design of run_mon_cap_tests() is now aligned with
rest of CapTester -- it's not meant to be inherited by test class
anymore and it is to be called by using CapTester instance.

This commit also changes working of this method. Now instead of
obtaining FS names from Python objects representing FSs, it obtains
those names from MON cap. This removes the need to pass the FS objects
around.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2022-07-21 17:53:16 +05:30
Rishabh Dave
2601831ff7 qa/cephfs: make file data unique in caps_helper.py
Let's change the file data to include the file path, the CephFS name
and the host FS and CephFS mountpoint so that the bugs where, let's say,
"cephfs2" is mounted instead of "cephfs1" (where obviously both the
CephFSs lie on the same Ceph cluster) is caught by the tests due to
uniqueness of every test file's content.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2022-07-21 17:53:16 +05:30
Rishabh Dave
d1f01cc86d qa/cephfs: simplify caps_helper.CapTester
Simplify methods in CapsTester by adding a test set, which will be a
list of tuples. The first element in tuple will be the mount object,
the second will be the test file path and the third will be the test
file data. Thus instead of having three independent class variables
that are always used together now we have list of test sets making
management of multiple test sets simpler.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2022-07-21 17:53:16 +05:30
Rishabh Dave
370449ac9d qa/cephfs: upgrade and rename class CapsHelper
Modify caps_helper.py such that calling code does't have to store
returned values just to pass those values again to a method in
caps_helper.py. This is a common pattern where write_test_files()
return 3 values and all 3 passed as it is to run_cap_tests().

The easy way to do it is to upgrade caps_helper so that it can be used
an object and not just as a class supplying helper methods. The return
values will be stored by the object internally and thus resued. In case
of testing multiple FSs inside a single test method, we'll now need
multiple instances of this class to keep those values separate.

And since CapsHelper is not just a class supplying helper methods
anymore, it's being renamed to CapTester.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2022-07-21 17:53:16 +05:30
Rishabh Dave
d9013dacc9 qa/cephfs: allow creating files at custom location
Concerned method: caps_helper.CapsHelper.write_test_file()

When CephFS mountpoint is changed inside a single test method, the test
files created at root are neither accessible nor useful. Therefore, add
an option to create the test files in the directory passed by the user.
This also increases general flexibility of the concerned method.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2022-07-21 17:53:16 +05:30
Rishabh Dave
cc30c78162 qa/cephfs: add a helper method in caps_helper.py
This helper method prevents repeating code to write test files in
test methods for caps.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2022-07-21 17:53:16 +05:30
Rishabh Dave
82b58e3667 qa/cephfs: allow checking for multiple error messages while...
while negative testing.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2022-07-20 13:11:31 +05:30
Rishabh Dave
ce942f250a qa/cephfs: delete path from cmd args after use
A new path is obtained every iteration which is appended to command
arguments. After the command has been executed successfully, delete the
the  path from command's arguments so that the command's arguments don't
have two paths in next iteration and it works as expected.

Fixes: https://tracker.ceph.com/issues/56416
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2022-07-06 17:12:58 +05:30
Rishabh Dave
f01188d72a qa/cephfs: fix minor bug in caps_helper.py's run_mon_cap_tests()
When an entity's MON cap contains no FS name in it, the entity has the
access to all the FSs on cluster and not just to the default FS of the
cluster.

Fixes: https://tracker.ceph.com/issues/55558
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2022-05-27 15:19:38 +05:30
Patrick Donnelly
e2b39f6c8c
qa: avoid using sudo for regular test artifacts
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2021-07-01 10:56:10 -07:00
Rishabh Dave
511434ac5a qa/cephfs: remove create_keyring_file from cephfs_test_case.py
Since teuthology.orchestra.remote.mktemp() can write a temporary file
and not just create it, create_keyring_file() is now redundant.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-04-08 12:11:00 +05:30
Rishabh Dave
352a41d1b3 qa/cephfs: add tests for multi-FS auth tests
Add testsuite for testing authorization on Ceph cluster with multiple
file systems and enable it to be executable with Teuthology framework.

Also add helper methods required to setup the test environment for
multi-FS tests.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2020-09-11 18:02:48 +05:30